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

Unified Diff: base/process/process_metrics_unittest.cc

Issue 2786313002: Revert of Add new wired memory metric to memory-infra dumps. (Closed)
Patch Set: Created 3 years, 9 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 | « base/process/process_metrics_mac.cc ('k') | chrome/browser/task_manager/sampling/task_group_sampler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics_unittest.cc
diff --git a/base/process/process_metrics_unittest.cc b/base/process/process_metrics_unittest.cc
index 74ecc87d38f0ed93680f1fd3270c0c000ff9e833..b11a26b24ba7cfd5417c519dff06257d5b3bb17b 100644
--- a/base/process/process_metrics_unittest.cc
+++ b/base/process/process_metrics_unittest.cc
@@ -24,10 +24,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/multiprocess_func_list.h"
-#if defined(OS_MACOSX)
-#include <sys/mman.h>
-#endif
-
namespace base {
namespace debug {
@@ -56,42 +52,6 @@
};
/////////////////////////////////////////////////////////////////////////////
-
-#if defined(OS_MACOSX) && !defined(OS_IOS)
-TEST_F(SystemMetricsTest, LockedBytes) {
- ProcessHandle handle = GetCurrentProcessHandle();
- std::unique_ptr<ProcessMetrics> metrics(
- ProcessMetrics::CreateProcessMetrics(handle, nullptr));
-
- size_t initial_locked_bytes;
- bool result =
- metrics->GetMemoryBytes(nullptr, nullptr, nullptr, &initial_locked_bytes);
- ASSERT_TRUE(result);
-
- size_t size = 8 * 1024 * 1024;
- std::unique_ptr<char[]> memory(new char[size]);
- int r = mlock(memory.get(), size);
- ASSERT_EQ(0, r);
-
- size_t new_locked_bytes;
- result =
- metrics->GetMemoryBytes(nullptr, nullptr, nullptr, &new_locked_bytes);
- ASSERT_TRUE(result);
-
- // There should be around |size| more locked bytes, but multi-threading might
- // cause noise.
- EXPECT_LT(initial_locked_bytes + size / 2, new_locked_bytes);
- EXPECT_GT(initial_locked_bytes + size * 1.5, new_locked_bytes);
-
- r = munlock(memory.get(), size);
- ASSERT_EQ(0, r);
-
- result =
- metrics->GetMemoryBytes(nullptr, nullptr, nullptr, &new_locked_bytes);
- ASSERT_TRUE(result);
- EXPECT_EQ(initial_locked_bytes, new_locked_bytes);
-}
-#endif // defined(OS_MACOSX)
#if defined(OS_LINUX) || defined(OS_ANDROID)
TEST_F(SystemMetricsTest, IsValidDiskName) {
« no previous file with comments | « base/process/process_metrics_mac.cc ('k') | chrome/browser/task_manager/sampling/task_group_sampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698