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

Unified Diff: base/mac/memory_pressure_monitor_mac_unittest.cc

Issue 1124163003: Rename OS-specific MemoryPressureMonitor implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error on ChromeOS. Created 5 years, 7 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
Index: base/mac/memory_pressure_monitor_mac_unittest.cc
diff --git a/base/mac/memory_pressure_monitor_mac_unittest.cc b/base/mac/memory_pressure_monitor_mac_unittest.cc
deleted file mode 100644
index 24ee09aeee1cef3b80b8a46bcdcd323a5d269926..0000000000000000000000000000000000000000
--- a/base/mac/memory_pressure_monitor_mac_unittest.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/mac/memory_pressure_monitor_mac.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace base {
-
-class TestMemoryPressureMonitorMac : public MemoryPressureMonitorMac {
- public:
- using MemoryPressureMonitorMac::MemoryPressureLevelForMacMemoryPressure;
-
- TestMemoryPressureMonitorMac() { }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestMemoryPressureMonitorMac);
-};
-
-TEST(TestMemoryPressureMonitorMac, MemoryPressureFromMacMemoryPressure) {
- EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
- TestMemoryPressureMonitorMac::
- MemoryPressureLevelForMacMemoryPressure(
- DISPATCH_MEMORYPRESSURE_NORMAL));
- EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE,
- TestMemoryPressureMonitorMac::
- MemoryPressureLevelForMacMemoryPressure(
- DISPATCH_MEMORYPRESSURE_WARN));
- EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL,
- TestMemoryPressureMonitorMac::
- MemoryPressureLevelForMacMemoryPressure(
- DISPATCH_MEMORYPRESSURE_CRITICAL));
- EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
- TestMemoryPressureMonitorMac::
- MemoryPressureLevelForMacMemoryPressure(0));
- EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
- TestMemoryPressureMonitorMac::
- MemoryPressureLevelForMacMemoryPressure(3));
- EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
- TestMemoryPressureMonitorMac::
- MemoryPressureLevelForMacMemoryPressure(5));
- EXPECT_EQ(MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE,
- TestMemoryPressureMonitorMac::
- MemoryPressureLevelForMacMemoryPressure(-1));
-}
-
-TEST(TestMemoryPressureMonitorMac, CurrentMemoryPressure) {
- TestMemoryPressureMonitorMac monitor;
- MemoryPressureListener::MemoryPressureLevel memory_pressure =
- monitor.GetCurrentPressureLevel();
- EXPECT_TRUE(memory_pressure ==
- MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE ||
- memory_pressure ==
- MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE ||
- memory_pressure ==
- MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL);
-}
-
-} // namespace base

Powered by Google App Engine
This is Rietveld 408576698