OLD | NEW |
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 Loading... |
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::GetInstance()->ToggleSplitViewForTest(); | 232 WindowManager::Get()->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 Loading... |
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 |
OLD | NEW |