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

Side by Side Diff: content/browser/memory/memory_monitor_win_unittest.cc

Issue 2321313002: Move components/memory_coordinator -> content/ (Closed)
Patch Set: rebase etc Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/memory_coordinator/browser/memory_monitor_win.h" 5 #include "content/browser/memory/memory_monitor_win.h"
6 6
7 #include "components/memory_coordinator/browser/test_memory_monitor.h" 7 #include "content/browser/memory/test_memory_monitor.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace memory_coordinator { 10 namespace content {
11 11
12 namespace { 12 namespace {
13 13
14 // A delegate that allows mocking the various inputs to MemoryMonitorWin. 14 // A delegate that allows mocking the various inputs to MemoryMonitorWin.
15 class TestMemoryMonitorWinDelegate : public TestMemoryMonitorDelegate { 15 class TestMemoryMonitorWinDelegate : public TestMemoryMonitorDelegate {
16 public: 16 public:
17 TestMemoryMonitorWinDelegate() {} 17 TestMemoryMonitorWinDelegate() {}
18 18
19 void SetFreeMemoryKB(int free_memory_kb) { 19 void SetFreeMemoryKB(int free_memory_kb) {
20 mem_info_.free = free_memory_kb; 20 mem_info_.free = free_memory_kb;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 EXPECT_EQ(100, monitor_->GetFreeMemoryUntilCriticalMB()); 128 EXPECT_EQ(100, monitor_->GetFreeMemoryUntilCriticalMB());
129 EXPECT_EQ(1u, delegate_.calls()); 129 EXPECT_EQ(1u, delegate_.calls());
130 delegate_.ResetCalls(); 130 delegate_.ResetCalls();
131 131
132 delegate_.SetFreeMemoryKB(50 * kKBperMB); 132 delegate_.SetFreeMemoryKB(50 * kKBperMB);
133 EXPECT_EQ(-50, monitor_->GetFreeMemoryUntilCriticalMB()); 133 EXPECT_EQ(-50, monitor_->GetFreeMemoryUntilCriticalMB());
134 EXPECT_EQ(1u, delegate_.calls()); 134 EXPECT_EQ(1u, delegate_.calls());
135 delegate_.ResetCalls(); 135 delegate_.ResetCalls();
136 } 136 }
137 137
138 } // namespace memory_coordinator 138 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698