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

Unified Diff: components/memory_coordinator/browser/memory_coordinator_unittest.cc

Issue 2261073002: Make HistoryBackend a client of memory coordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 4 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: components/memory_coordinator/browser/memory_coordinator_unittest.cc
diff --git a/components/memory_coordinator/browser/memory_coordinator_unittest.cc b/components/memory_coordinator/browser/memory_coordinator_unittest.cc
index 2dc73c4f5472c0c0fce3b99aa4ba3ccec9ac507c..0cae2474d7d8170e3a505ecda8f9e401c1458c50 100644
--- a/components/memory_coordinator/browser/memory_coordinator_unittest.cc
+++ b/components/memory_coordinator/browser/memory_coordinator_unittest.cc
@@ -7,6 +7,7 @@
#include "base/memory/memory_pressure_monitor.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
+#include "components/memory_coordinator/common/memory_coordinator_features.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -47,16 +48,20 @@ public:
class MemoryCoordinatorTest : public testing::Test {
public:
MemoryCoordinatorTest()
- : message_loop_(new base::MessageLoop),
- coordinator_(new MemoryCoordinator) {}
+ : message_loop_(new base::MessageLoop) {}
+
+ void SetUp() override {
+ memory_coordinator::EnableForTesting();
+ }
MockMemoryPressureMonitor& monitor() { return monitor_; }
- MemoryCoordinator& coordinator() { return *coordinator_.get(); }
+ MemoryCoordinator& coordinator() {
+ return *MemoryCoordinator::GetInstance();
+ }
private:
std::unique_ptr<base::MessageLoop> message_loop_;
MockMemoryPressureMonitor monitor_;
- std::unique_ptr<MemoryCoordinator> coordinator_;
};
TEST_F(MemoryCoordinatorTest, ReceivePressureLevels) {

Powered by Google App Engine
This is Rietveld 408576698