From 81bd9fa3a215b1413f25aa2c835deeba1b9d2d41 Mon Sep 17 00:00:00 2001 From: HariJ Date: Thu, 27 Apr 2017 11:09:27 -0700 Subject: [PATCH] fixing mac ut failure --- atom/browser/api/atom_api_app.cc | 4 +++- spec/api-app-spec.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 54c0ce0ac81..d2fb15fa791 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -34,6 +34,7 @@ #include "chrome/browser/icon_manager.h" #include "chrome/common/chrome_paths.h" #include "content/public/browser/browser_accessibility_state.h" +#include "content/public/browser/browser_child_process_host.h" #include "content/public/browser/client_certificate_delegate.h" #include "content/public/browser/gpu_data_manager.h" #include "content/public/browser/render_frame_host.h" @@ -934,7 +935,8 @@ v8::Local App::GetAppMemoryInfo(v8::Isolate* isolate) { #if defined(OS_MACOSX) std::unique_ptr metrics( - base::ProcessMetrics::CreateProcessMetrics(process.Handle(), nullptr)); + base::ProcessMetrics::CreateProcessMetrics( + process.Handle(), content::BrowserChildProcessHost::GetPortProvider())); #else std::unique_ptr metrics( base::ProcessMetrics::CreateProcessMetrics(process.Handle())); diff --git a/spec/api-app-spec.js b/spec/api-app-spec.js index 80b9bf48e21..5f348f9c185 100644 --- a/spec/api-app-spec.js +++ b/spec/api-app-spec.js @@ -539,7 +539,8 @@ describe('app module', function () { const appMemoryInfo = app.getAppMemoryInfo() assert.ok(appMemoryInfo.length > 0, 'App memory info object is not > 0') assert.ok(appMemoryInfo[0].memory.workingSetSize > 0, 'working set size is not > 0') - assert.ok(appMemoryInfo[0].memory.peakWorkingSetSize > 0, 'peak working set size is not > 0') + assert.ok(appMemoryInfo[0].memory.privateBytes > 0, 'private bytes is not > 0') + assert.ok(appMemoryInfo[0].memory.sharedBytes > 0, 'shared bytes is not > 0') assert.ok(appMemoryInfo[0].pid > 0, 'pid is not > 0') }) })