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/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 observer_.reset(new PeripheralBatteryObserver()); | 49 observer_.reset(new PeripheralBatteryObserver()); |
50 } | 50 } |
51 | 51 |
52 void TearDownOnMainThread() override { observer_.reset(); } | 52 void TearDownOnMainThread() override { observer_.reset(); } |
53 | 53 |
54 void TearDownInProcessBrowserTestFixture() override { | 54 void TearDownInProcessBrowserTestFixture() override { |
55 InProcessBrowserTest::TearDownInProcessBrowserTestFixture(); | 55 InProcessBrowserTest::TearDownInProcessBrowserTestFixture(); |
56 } | 56 } |
57 | 57 |
58 protected: | 58 protected: |
59 scoped_ptr<PeripheralBatteryObserver> observer_; | 59 std::unique_ptr<PeripheralBatteryObserver> observer_; |
60 | 60 |
61 private: | 61 private: |
62 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryObserverTest); | 62 DISALLOW_COPY_AND_ASSIGN(PeripheralBatteryObserverTest); |
63 }; | 63 }; |
64 | 64 |
65 IN_PROC_BROWSER_TEST_F(PeripheralBatteryObserverTest, Basic) { | 65 IN_PROC_BROWSER_TEST_F(PeripheralBatteryObserverTest, Basic) { |
66 base::SimpleTestTickClock clock; | 66 base::SimpleTestTickClock clock; |
67 observer_->set_testing_clock(&clock); | 67 observer_->set_testing_clock(&clock); |
68 | 68 |
69 NotificationUIManager* notification_manager = | 69 NotificationUIManager* notification_manager = |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 ProfileManager::GetPrimaryUserProfile())) != NULL); | 169 ProfileManager::GetPrimaryUserProfile())) != NULL); |
170 | 170 |
171 observer_->RemoveBattery(kTestBatteryAddress); | 171 observer_->RemoveBattery(kTestBatteryAddress); |
172 EXPECT_FALSE(notification_manager->FindById( | 172 EXPECT_FALSE(notification_manager->FindById( |
173 kTestBatteryAddress, | 173 kTestBatteryAddress, |
174 NotificationUIManager::GetProfileID( | 174 NotificationUIManager::GetProfileID( |
175 ProfileManager::GetPrimaryUserProfile())) != NULL); | 175 ProfileManager::GetPrimaryUserProfile())) != NULL); |
176 } | 176 } |
177 | 177 |
178 } // namespace chromeos | 178 } // namespace chromeos |
OLD | NEW |