| 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 28 matching lines...) Expand all Loading... |
| 39 new FakeDBusThreadManager; | 39 new FakeDBusThreadManager; |
| 40 fake_dbus_thread_manager->SetFakeClients(); | 40 fake_dbus_thread_manager->SetFakeClients(); |
| 41 DBusThreadManager::SetInstanceForTesting(fake_dbus_thread_manager); | 41 DBusThreadManager::SetInstanceForTesting(fake_dbus_thread_manager); |
| 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 CleanUpOnMainThread() 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 |
| (...skipping 87 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 |