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

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

Issue 623103002: replace OVERRIDE and FINAL with override and final in athena/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 6 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 unified diff | Download patch
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/base/athena_test_base.h" 10 #include "athena/test/base/athena_test_base.h"
(...skipping 17 matching lines...) Expand all
28 media_state_(ACTIVITY_MEDIA_STATE_NONE), 28 media_state_(ACTIVITY_MEDIA_STATE_NONE),
29 is_visible_(false) {} 29 is_visible_(false) {}
30 virtual ~TestActivity() {} 30 virtual ~TestActivity() {}
31 31
32 void set_media_state(ActivityMediaState media_state) { 32 void set_media_state(ActivityMediaState media_state) {
33 media_state_ = media_state; 33 media_state_ = media_state;
34 } 34 }
35 void set_visible(bool visible) { is_visible_ = visible; } 35 void set_visible(bool visible) { is_visible_ = visible; }
36 36
37 // Activity overrides: 37 // Activity overrides:
38 virtual bool IsVisible() OVERRIDE { return is_visible_; } 38 virtual bool IsVisible() override { return is_visible_; }
39 virtual ActivityMediaState GetMediaState() OVERRIDE { return media_state_; } 39 virtual ActivityMediaState GetMediaState() override { return media_state_; }
40 40
41 private: 41 private:
42 // The current media state. 42 // The current media state.
43 ActivityMediaState media_state_; 43 ActivityMediaState media_state_;
44 44
45 // Returns if it is visible or not. 45 // Returns if it is visible or not.
46 bool is_visible_; 46 bool is_visible_;
47 47
48 DISALLOW_COPY_AND_ASSIGN(TestActivity); 48 DISALLOW_COPY_AND_ASSIGN(TestActivity);
49 }; 49 };
50 50
51 } // namespace 51 } // namespace
52 52
53 // Our testing base. 53 // Our testing base.
54 class ResourceManagerTest : public AthenaTestBase { 54 class ResourceManagerTest : public AthenaTestBase {
55 public: 55 public:
56 ResourceManagerTest() {} 56 ResourceManagerTest() {}
57 virtual ~ResourceManagerTest() {} 57 virtual ~ResourceManagerTest() {}
58 58
59 virtual void SetUp() OVERRIDE { 59 virtual void SetUp() override {
60 AthenaTestBase::SetUp(); 60 AthenaTestBase::SetUp();
61 // Override the delay to be instantaneous. 61 // Override the delay to be instantaneous.
62 ResourceManager::Get()->SetWaitTimeBetweenResourceManageCalls(0); 62 ResourceManager::Get()->SetWaitTimeBetweenResourceManageCalls(0);
63 } 63 }
64 virtual void TearDown() OVERRIDE { 64 virtual void TearDown() override {
65 while (!activity_list_.empty()) 65 while (!activity_list_.empty())
66 DeleteActivity(activity_list_[0]); 66 DeleteActivity(activity_list_[0]);
67 AthenaTestBase::TearDown(); 67 AthenaTestBase::TearDown();
68 } 68 }
69 69
70 TestActivity* CreateActivity(const std::string& title) { 70 TestActivity* CreateActivity(const std::string& title) {
71 TestActivity* activity = new TestActivity(title); 71 TestActivity* activity = new TestActivity(title);
72 ActivityManager::Get()->AddActivity(activity); 72 ActivityManager::Get()->AddActivity(activity);
73 activity->SetCurrentState(Activity::ACTIVITY_INVISIBLE); 73 activity->SetCurrentState(Activity::ACTIVITY_INVISIBLE);
74 activity_list_.push_back(activity); 74 activity_list_.push_back(activity);
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 ResourceManager::Get()->SetMemoryPressureAndStopMonitoring( 353 ResourceManager::Get()->SetMemoryPressureAndStopMonitoring(
354 ResourceManager::MEMORY_PRESSURE_CRITICAL); 354 ResourceManager::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/screen/screen_accelerator_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698