Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2399)

Unified Diff: chrome/browser/process_info_snapshot_mac_unittest.cc

Issue 583193006: mac: Disable parts of ProcessInfoSnapshotMacTest on OSX 10.9+. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test & logic. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/process_info_snapshot_mac.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/process_info_snapshot_mac_unittest.cc
diff --git a/chrome/browser/process_info_snapshot_mac_unittest.cc b/chrome/browser/process_info_snapshot_mac_unittest.cc
index e96804801ad3d8812bc09c0a51cf7b3b731a6816..03323ccc2e8b30f885feb24a9b49821390e22fff 100644
--- a/chrome/browser/process_info_snapshot_mac_unittest.cc
+++ b/chrome/browser/process_info_snapshot_mac_unittest.cc
@@ -12,6 +12,7 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/logging.h"
+#include "base/mac/mac_util.h"
#include "base/posix/eintr_wrapper.h"
#include "base/process/kill.h"
#include "base/process/launch.h"
@@ -77,12 +78,19 @@ TEST_F(ProcessInfoSnapshotMacTest, FindPidSelfTest) {
EXPECT_EQ(ppid, proc_info.ppid);
EXPECT_EQ(uid, proc_info.uid);
EXPECT_EQ(euid, proc_info.euid);
- EXPECT_GE(proc_info.rss, 100u); // Sanity check: we're running, so we
- // should occupy at least 100 kilobytes.
- EXPECT_GE(proc_info.vsize, 1024u); // Sanity check: our |vsize| is presumably
- // at least a megabyte.
- EXPECT_GE(proc_info.rshrd, 1024u); // Shared memory should also > 1 MB.
- EXPECT_GE(proc_info.rprvt, 1024u); // Same with private memory.
+ // Sanity check: we're running, so we should occupy at least 100 kilobytes.
+ EXPECT_GE(proc_info.rss, 100u);
+ // Sanity check: our |vsize| is presumably at least a megabyte.
+ EXPECT_GE(proc_info.vsize, 1024u);
+
+ // Collection of some memory statistics is broken in OSX 10.9+.
+ // http://crbug.com/383553
+ if (!base::mac::IsOSMavericksOrLater()) {
+ // Shared memory should also > 1 MB.
+ EXPECT_GE(proc_info.rshrd, 1024u);
+ // Same with private memory.
+ EXPECT_GE(proc_info.rprvt, 1024u);
+ }
// Find our parent.
ASSERT_TRUE(snapshot.GetProcInfo(ppid, &proc_info));
« no previous file with comments | « chrome/browser/process_info_snapshot_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698