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

Unified Diff: base/memory/discardable_memory_unittest.cc

Issue 458343003: Revert of base: Introduce an explicit call for reducing emulated discardable memory usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « base/memory/discardable_memory_manager_unittest.cc ('k') | base/memory/discardable_memory_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory_unittest.cc
diff --git a/base/memory/discardable_memory_unittest.cc b/base/memory/discardable_memory_unittest.cc
index 516a96b5a4fa2576a6cb031877ddf7d7bff0cfac..dc0e2cd21262b4d7da8dd3edb891b91bb8f2d5b7 100644
--- a/base/memory/discardable_memory_unittest.cc
+++ b/base/memory/discardable_memory_unittest.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "base/run_loop.h"
#include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_ANDROID)
@@ -18,8 +19,12 @@
class DiscardableMemoryTest
: public testing::TestWithParam<DiscardableMemoryType> {
public:
- DiscardableMemoryTest() {}
+ DiscardableMemoryTest() : message_loop_(MessageLoop::TYPE_IO) {
+ // Register memory pressure listeners now that we have a message loop.
+ DiscardableMemory::RegisterMemoryPressureListeners();
+ }
virtual ~DiscardableMemoryTest() {
+ DiscardableMemory::UnregisterMemoryPressureListeners();
}
protected:
@@ -27,6 +32,9 @@
return DiscardableMemory::CreateLockedMemoryWithType(
GetParam(), size).Pass();
}
+
+ private:
+ MessageLoop message_loop_;
};
const size_t kSize = 1024;
« no previous file with comments | « base/memory/discardable_memory_manager_unittest.cc ('k') | base/memory/discardable_memory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698