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

Unified Diff: content/browser/memory/memory_monitor_chromeos_unittest.cc

Issue 2731273003: Update MemoryMonitorChromeOS (Closed)
Patch Set: comment Created 3 years, 9 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 | « content/browser/memory/memory_monitor_chromeos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/memory/memory_monitor_chromeos_unittest.cc
diff --git a/content/browser/memory/memory_monitor_chromeos_unittest.cc b/content/browser/memory/memory_monitor_chromeos_unittest.cc
index 733d03999a9751cac903c48b8ec559517528bb1a..905fe8f0538f8e79f9a33b62642a237e96acdd2a 100644
--- a/content/browser/memory/memory_monitor_chromeos_unittest.cc
+++ b/content/browser/memory/memory_monitor_chromeos_unittest.cc
@@ -20,12 +20,14 @@ class TestMemoryMonitorChromeOSDelegate : public TestMemoryMonitorDelegate {
int swap_kb,
int active_kb,
int inactive_kb,
- int dirty_kb) {
+ int dirty_kb,
+ int available_kb) {
mem_info_.free = free_kb;
mem_info_.swap_free = swap_kb;
mem_info_.active_file = active_kb;
mem_info_.inactive_file = inactive_kb;
mem_info_.dirty = dirty_kb;
+ mem_info_.available = available_kb;
}
private:
@@ -56,10 +58,17 @@ TEST_F(MemoryMonitorChromeOSTest, GetFreeMemoryUntilCriticalMB) {
monitor_.reset(new MemoryMonitorChromeOS(&delegate_));
EXPECT_EQ(0u, delegate_.calls());
- delegate_.SetFreeMemoryKB(256 * kKBperMB, 128 * kKBperMB, 64 * kKBperMB,
- 32 * kKBperMB, 16 * kKBperMB);
- EXPECT_EQ(318, monitor_->GetFreeMemoryUntilCriticalMB());
+ // |available| is supported.
+ delegate_.SetFreeMemoryKB(1 * kKBperMB, 1 * kKBperMB, 1 * kKBperMB,
+ 1 * kKBperMB, 1 * kKBperMB, 286 * kKBperMB);
+ EXPECT_EQ(286, monitor_->GetFreeMemoryUntilCriticalMB());
EXPECT_EQ(1U, delegate_.calls());
+
+ // |available| is not supported.
+ delegate_.SetFreeMemoryKB(256 * kKBperMB, 128 * kKBperMB, 64 * kKBperMB,
+ 32 * kKBperMB, 16 * kKBperMB, 0 * kKBperMB);
+ EXPECT_EQ(286, monitor_->GetFreeMemoryUntilCriticalMB());
+ EXPECT_EQ(2U, delegate_.calls());
}
} // namespace content
« no previous file with comments | « content/browser/memory/memory_monitor_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698