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

Side by Side Diff: athena/resource_manager/resource_manager_unittest.cc

Issue 601753002: Revert of [Athena, Cleanup] rename WidnowManager::GetInstance -> ::Get (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 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
« no previous file with comments | « athena/resource_manager/resource_manager_impl.cc ('k') | athena/test/athena_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /// Copyright 2014 The Chromium Authors. All rights reserved. 1 /// Copyright 2014 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 "athena/activity/public/activity.h" 5 #include "athena/activity/public/activity.h"
6 #include "athena/activity/public/activity_manager.h" 6 #include "athena/activity/public/activity_manager.h"
7 #include "athena/activity/public/activity_view_model.h" 7 #include "athena/activity/public/activity_view_model.h"
8 #include "athena/resource_manager/memory_pressure_notifier.h" 8 #include "athena/resource_manager/memory_pressure_notifier.h"
9 #include "athena/resource_manager/public/resource_manager.h" 9 #include "athena/resource_manager/public/resource_manager.h"
10 #include "athena/test/athena_test_base.h" 10 #include "athena/test/athena_test_base.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 ResourceManager::Get()->SetMemoryPressureAndStopMonitoring( 222 ResourceManager::Get()->SetMemoryPressureAndStopMonitoring(
223 MemoryPressureObserver::MEMORY_PRESSURE_CRITICAL); 223 MemoryPressureObserver::MEMORY_PRESSURE_CRITICAL);
224 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app1->GetCurrentState()); 224 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app1->GetCurrentState());
225 EXPECT_EQ(Activity::ACTIVITY_INVISIBLE, app2->GetCurrentState()); 225 EXPECT_EQ(Activity::ACTIVITY_INVISIBLE, app2->GetCurrentState());
226 EXPECT_EQ(Activity::ACTIVITY_INVISIBLE, app3->GetCurrentState()); 226 EXPECT_EQ(Activity::ACTIVITY_INVISIBLE, app3->GetCurrentState());
227 // Note: This might very well be unloaded with this memory pressure. 227 // Note: This might very well be unloaded with this memory pressure.
228 EXPECT_NE(Activity::ACTIVITY_VISIBLE, app4->GetCurrentState()); 228 EXPECT_NE(Activity::ACTIVITY_VISIBLE, app4->GetCurrentState());
229 229
230 // Once the split view mode gets turned on, more windows should become 230 // Once the split view mode gets turned on, more windows should become
231 // visible. 231 // visible.
232 WindowManager::Get()->ToggleSplitViewForTest(); 232 WindowManager::GetInstance()->ToggleSplitViewForTest();
233 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app1->GetCurrentState()); 233 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app1->GetCurrentState());
234 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app2->GetCurrentState()); 234 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app2->GetCurrentState());
235 EXPECT_NE(Activity::ACTIVITY_VISIBLE, app3->GetCurrentState()); 235 EXPECT_NE(Activity::ACTIVITY_VISIBLE, app3->GetCurrentState());
236 EXPECT_NE(Activity::ACTIVITY_VISIBLE, app4->GetCurrentState()); 236 EXPECT_NE(Activity::ACTIVITY_VISIBLE, app4->GetCurrentState());
237 237
238 // Going back to a relaxed memory pressure should reload the old activities. 238 // Going back to a relaxed memory pressure should reload the old activities.
239 ResourceManager::Get()->SetMemoryPressureAndStopMonitoring( 239 ResourceManager::Get()->SetMemoryPressureAndStopMonitoring(
240 MemoryPressureObserver::MEMORY_PRESSURE_LOW); 240 MemoryPressureObserver::MEMORY_PRESSURE_LOW);
241 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app1->GetCurrentState()); 241 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app1->GetCurrentState());
242 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app2->GetCurrentState()); 242 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app2->GetCurrentState());
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 ResourceManager::Get()->SetMemoryPressureAndStopMonitoring( 353 ResourceManager::Get()->SetMemoryPressureAndStopMonitoring(
354 MemoryPressureObserver::MEMORY_PRESSURE_CRITICAL); 354 MemoryPressureObserver::MEMORY_PRESSURE_CRITICAL);
355 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app1->GetCurrentState()); 355 EXPECT_EQ(Activity::ACTIVITY_VISIBLE, app1->GetCurrentState());
356 EXPECT_EQ(Activity::ACTIVITY_INVISIBLE, app2->GetCurrentState()); 356 EXPECT_EQ(Activity::ACTIVITY_INVISIBLE, app2->GetCurrentState());
357 EXPECT_EQ(Activity::ACTIVITY_UNLOADED, app3->GetCurrentState()); 357 EXPECT_EQ(Activity::ACTIVITY_UNLOADED, app3->GetCurrentState());
358 EXPECT_EQ(Activity::ACTIVITY_UNLOADED, app4->GetCurrentState()); 358 EXPECT_EQ(Activity::ACTIVITY_UNLOADED, app4->GetCurrentState());
359 } 359 }
360 360
361 } // namespace test 361 } // namespace test
362 } // namespace athena 362 } // namespace athena
OLDNEW
« no previous file with comments | « athena/resource_manager/resource_manager_impl.cc ('k') | athena/test/athena_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698