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

Side by Side Diff: ash/system/chromeos/power/power_status_unittest.cc

Issue 621133002: replace OVERRIDE and FINAL with override and final in ash/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « ash/system/chromeos/power/power_status.h ('k') | ash/system/chromeos/power/power_status_view.h » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ash/system/chromeos/power/power_status.h" 5 #include "ash/system/chromeos/power/power_status.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chromeos/dbus/dbus_thread_manager.h" 9 #include "chromeos/dbus/dbus_thread_manager.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "third_party/cros_system_api/dbus/service_constants.h" 11 #include "third_party/cros_system_api/dbus/service_constants.h"
12 12
13 namespace ash { 13 namespace ash {
14 namespace { 14 namespace {
15 15
16 class TestObserver : public PowerStatus::Observer { 16 class TestObserver : public PowerStatus::Observer {
17 public: 17 public:
18 TestObserver() : power_changed_count_(0) {} 18 TestObserver() : power_changed_count_(0) {}
19 virtual ~TestObserver() {} 19 virtual ~TestObserver() {}
20 20
21 int power_changed_count() const { return power_changed_count_; } 21 int power_changed_count() const { return power_changed_count_; }
22 22
23 // PowerStatus::Observer overrides: 23 // PowerStatus::Observer overrides:
24 virtual void OnPowerStatusChanged() OVERRIDE { ++power_changed_count_; } 24 virtual void OnPowerStatusChanged() override { ++power_changed_count_; }
25 25
26 private: 26 private:
27 int power_changed_count_; 27 int power_changed_count_;
28 28
29 DISALLOW_COPY_AND_ASSIGN(TestObserver); 29 DISALLOW_COPY_AND_ASSIGN(TestObserver);
30 }; 30 };
31 31
32 } // namespace 32 } // namespace
33 33
34 class PowerStatusTest : public testing::Test { 34 class PowerStatusTest : public testing::Test {
35 public: 35 public:
36 PowerStatusTest() : power_status_(NULL) {} 36 PowerStatusTest() : power_status_(NULL) {}
37 virtual ~PowerStatusTest() {} 37 virtual ~PowerStatusTest() {}
38 38
39 virtual void SetUp() OVERRIDE { 39 virtual void SetUp() override {
40 chromeos::DBusThreadManager::Initialize(); 40 chromeos::DBusThreadManager::Initialize();
41 PowerStatus::Initialize(); 41 PowerStatus::Initialize();
42 power_status_ = PowerStatus::Get(); 42 power_status_ = PowerStatus::Get();
43 test_observer_.reset(new TestObserver); 43 test_observer_.reset(new TestObserver);
44 power_status_->AddObserver(test_observer_.get()); 44 power_status_->AddObserver(test_observer_.get());
45 } 45 }
46 46
47 virtual void TearDown() OVERRIDE { 47 virtual void TearDown() override {
48 power_status_->RemoveObserver(test_observer_.get()); 48 power_status_->RemoveObserver(test_observer_.get());
49 test_observer_.reset(); 49 test_observer_.reset();
50 PowerStatus::Shutdown(); 50 PowerStatus::Shutdown();
51 chromeos::DBusThreadManager::Shutdown(); 51 chromeos::DBusThreadManager::Shutdown();
52 } 52 }
53 53
54 protected: 54 protected:
55 base::MessageLoopForUI message_loop_; 55 base::MessageLoopForUI message_loop_;
56 PowerStatus* power_status_; // Not owned. 56 PowerStatus* power_status_; // Not owned.
57 scoped_ptr<TestObserver> test_observer_; 57 scoped_ptr<TestObserver> test_observer_;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 EXPECT_EQ(1, hours); 142 EXPECT_EQ(1, hours);
143 EXPECT_EQ(0, minutes); 143 EXPECT_EQ(0, minutes);
144 144
145 PowerStatus::SplitTimeIntoHoursAndMinutes( 145 PowerStatus::SplitTimeIntoHoursAndMinutes(
146 base::TimeDelta::FromSecondsD(3600.1), &hours, &minutes); 146 base::TimeDelta::FromSecondsD(3600.1), &hours, &minutes);
147 EXPECT_EQ(1, hours); 147 EXPECT_EQ(1, hours);
148 EXPECT_EQ(0, minutes); 148 EXPECT_EQ(0, minutes);
149 } 149 }
150 150
151 } // namespace ash 151 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/power_status.h ('k') | ash/system/chromeos/power/power_status_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698