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

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

Issue 2310193002: Added MemoryMonitor for Linux (with test) (Closed)
Patch Set: rebased 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 side-by-side diff with in-line comments
Download patch
Index: components/memory_coordinator/browser/memory_monitor_win_unittest.cc
diff --git a/components/memory_coordinator/browser/memory_monitor_win_unittest.cc b/components/memory_coordinator/browser/memory_monitor_win_unittest.cc
index ce25061544f791d8f283aec3f1571082a7963b6a..50ecf805bfad68e3ceda534e4ff05ef1961b8d15 100644
--- a/components/memory_coordinator/browser/memory_monitor_win_unittest.cc
+++ b/components/memory_coordinator/browser/memory_monitor_win_unittest.cc
@@ -4,7 +4,7 @@
#include "components/memory_coordinator/browser/memory_monitor_win.h"
-#include "base/process/process_metrics.h"
+#include "components/memory_coordinator/browser/test_memory_monitor.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace memory_coordinator {
@@ -12,35 +12,15 @@ namespace memory_coordinator {
namespace {
// A delegate that allows mocking the various inputs to MemoryMonitorWin.
-class TestMemoryMonitorWinDelegate : public MemoryMonitorWinDelegate {
+class TestMemoryMonitorWinDelegate : public TestMemoryMonitorDelegate {
public:
- TestMemoryMonitorWinDelegate() : calls_(0) {
- mem_info_ = {};
- }
-
- ~TestMemoryMonitorWinDelegate() override {}
-
- // GetSystemMemoryInfoDelegate:
- void GetSystemMemoryInfo(base::SystemMemoryInfoKB* mem_info) override {
- *mem_info = mem_info_;
- ++calls_;
- }
-
- size_t calls() const { return calls_; }
- void ResetCalls() { calls_ = 0; }
-
- void SetTotalMemoryKB(int total_memory_kb) {
- mem_info_.total = total_memory_kb;
- }
+ TestMemoryMonitorWinDelegate() {}
void SetFreeMemoryKB(int free_memory_kb) {
mem_info_.free = free_memory_kb;
}
private:
- size_t calls_;
- base::SystemMemoryInfoKB mem_info_;
-
DISALLOW_COPY_AND_ASSIGN(TestMemoryMonitorWinDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698