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

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

Issue 2450093006: GetCurrentMemoryState() shouldn't return SUSPENDED state in browser (Closed)
Patch Set: DCHECK for UNKNOWN Created 4 years, 2 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_coordinator_impl.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_coordinator_impl_unittest.cc
diff --git a/content/browser/memory/memory_coordinator_impl_unittest.cc b/content/browser/memory/memory_coordinator_impl_unittest.cc
index dd12e5526cd44bb02a5c049a79633cddf85a1b38..9a63c0ef773b308a7e32dc04fe5a012f80a42d63 100644
--- a/content/browser/memory/memory_coordinator_impl_unittest.cc
+++ b/content/browser/memory/memory_coordinator_impl_unittest.cc
@@ -120,9 +120,11 @@ TEST_F(MemoryCoordinatorImplTest, CalculateNextState) {
// Transitions from SUSPENDED
coordinator_->current_state_ = base::MemoryState::SUSPENDED;
- EXPECT_EQ(base::MemoryState::SUSPENDED,
+ // GetCurrentMemoryState() returns THROTTLED state for the browser process
+ // when the global state is SUSPENDED.
+ EXPECT_EQ(base::MemoryState::THROTTLED,
coordinator_->GetCurrentMemoryState());
- EXPECT_EQ(base::MemoryState::SUSPENDED,
+ EXPECT_EQ(base::MemoryState::THROTTLED,
base::MemoryCoordinatorProxy::GetInstance()->
GetCurrentMemoryState());
@@ -188,6 +190,16 @@ TEST_F(MemoryCoordinatorImplTest, SetMemoryStateForTesting) {
EXPECT_EQ(base::MemoryState::NORMAL, client.state());
base::MemoryCoordinatorProxy::GetInstance()->SetCurrentMemoryStateForTesting(
+ base::MemoryState::SUSPENDED);
+ // GetCurrentMemoryState() returns THROTTLED state for the browser process
+ // when the global state is SUSPENDED.
+ EXPECT_EQ(base::MemoryState::THROTTLED,
+ coordinator_->GetCurrentMemoryState());
+ EXPECT_EQ(base::MemoryState::THROTTLED,
+ base::MemoryCoordinatorProxy::GetInstance()->
+ GetCurrentMemoryState());
+
+ base::MemoryCoordinatorProxy::GetInstance()->SetCurrentMemoryStateForTesting(
base::MemoryState::THROTTLED);
EXPECT_EQ(base::MemoryState::THROTTLED,
coordinator_->GetCurrentMemoryState());
« no previous file with comments | « content/browser/memory/memory_coordinator_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698