OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/chromeos/power/peripheral_battery_observer.h" | 5 #include "chrome/browser/chromeos/power/peripheral_battery_observer.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/notifications/notification_ui_manager.h" | 10 #include "chrome/browser/notifications/notification_ui_manager.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 namespace chromeos { | 30 namespace chromeos { |
31 | 31 |
32 class PeripheralBatteryObserverTest : public InProcessBrowserTest { | 32 class PeripheralBatteryObserverTest : public InProcessBrowserTest { |
33 public: | 33 public: |
34 PeripheralBatteryObserverTest() {} | 34 PeripheralBatteryObserverTest() {} |
35 virtual ~PeripheralBatteryObserverTest() {} | 35 virtual ~PeripheralBatteryObserverTest() {} |
36 | 36 |
37 virtual void SetUp() OVERRIDE { | 37 virtual void SetUp() override { |
38 chromeos::DBusThreadManager::Initialize(); | 38 chromeos::DBusThreadManager::Initialize(); |
39 } | 39 } |
40 | 40 |
41 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 41 virtual void SetUpInProcessBrowserTestFixture() override { |
42 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | 42 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
43 } | 43 } |
44 | 44 |
45 virtual void SetUpOnMainThread() OVERRIDE { | 45 virtual void SetUpOnMainThread() override { |
46 observer_.reset(new PeripheralBatteryObserver()); | 46 observer_.reset(new PeripheralBatteryObserver()); |
47 } | 47 } |
48 | 48 |
49 virtual void TearDownOnMainThread() OVERRIDE { | 49 virtual void TearDownOnMainThread() override { |
50 observer_.reset(); | 50 observer_.reset(); |
51 } | 51 } |
52 | 52 |
53 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { | 53 virtual void TearDownInProcessBrowserTestFixture() override { |
54 InProcessBrowserTest::TearDownInProcessBrowserTestFixture(); | 54 InProcessBrowserTest::TearDownInProcessBrowserTestFixture(); |
55 } | 55 } |
56 | 56 |
57 protected: | 57 protected: |
58 scoped_ptr<PeripheralBatteryObserver> observer_; | 58 scoped_ptr<PeripheralBatteryObserver> observer_; |
59 | 59 |
60 private: | 60 private: |
61 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryObserverTest); | 61 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryObserverTest); |
62 }; | 62 }; |
63 | 63 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 observer_->PeripheralBatteryStatusReceived(kTestBatteryPath, | 147 observer_->PeripheralBatteryStatusReceived(kTestBatteryPath, |
148 kTestDeviceName, 5); | 148 kTestDeviceName, 5); |
149 EXPECT_EQ(observer_->batteries_.count(kTestBatteryAddress), 1u); | 149 EXPECT_EQ(observer_->batteries_.count(kTestBatteryAddress), 1u); |
150 EXPECT_TRUE(notification_manager->FindById(kTestBatteryAddress) != NULL); | 150 EXPECT_TRUE(notification_manager->FindById(kTestBatteryAddress) != NULL); |
151 | 151 |
152 observer_->RemoveBattery(kTestBatteryAddress); | 152 observer_->RemoveBattery(kTestBatteryAddress); |
153 EXPECT_FALSE(notification_manager->FindById(kTestBatteryAddress) != NULL); | 153 EXPECT_FALSE(notification_manager->FindById(kTestBatteryAddress) != NULL); |
154 } | 154 } |
155 | 155 |
156 } // namespace chromeos | 156 } // namespace chromeos |
OLD | NEW |