| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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 "device/battery/battery_monitor_impl.h" | 5 #include "services/device/battery/battery_monitor_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
| 12 #include "device/battery/battery_monitor.mojom.h" | 12 #include "services/device/battery/battery_status_manager.h" |
| 13 #include "device/battery/battery_status_manager.h" | 13 #include "services/device/battery/battery_status_service.h" |
| 14 #include "device/battery/battery_status_service.h" | |
| 15 #include "services/device/device_service_test_base.h" | 14 #include "services/device/device_service_test_base.h" |
| 15 #include "services/device/public/interfaces/battery_monitor.mojom.h" |
| 16 #include "services/device/public/interfaces/constants.mojom.h" | 16 #include "services/device/public/interfaces/constants.mojom.h" |
| 17 | 17 |
| 18 // These tests run against the implementation of the BatteryMonitor interface | 18 // These tests run against the implementation of the BatteryMonitor interface |
| 19 // inside Device Service, with a dummy BatteryManager set as a source of the | 19 // inside Device Service, with a dummy BatteryManager set as a source of the |
| 20 // battery information. They can be run only on platforms that use the default | 20 // battery information. They can be run only on platforms that use the default |
| 21 // battery service implementation, ie. on the platforms where | 21 // battery service implementation, ie. on the platforms where |
| 22 // BatteryStatusService is used. | 22 // BatteryStatusService is used. |
| 23 | 23 |
| 24 namespace device { | 24 namespace device { |
| 25 | 25 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // InvokeUpdateCallback should fire the pending query correctly. | 183 // InvokeUpdateCallback should fire the pending query correctly. |
| 184 battery_manager()->set_battery_status(status); | 184 battery_manager()->set_battery_status(status); |
| 185 battery_manager()->InvokeUpdateCallback(); | 185 battery_manager()->InvokeUpdateCallback(); |
| 186 run_loop2.Run(); | 186 run_loop2.Run(); |
| 187 EXPECT_TRUE(called); | 187 EXPECT_TRUE(called); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace | 190 } // namespace |
| 191 | 191 |
| 192 } // namespace device | 192 } // namespace device |
| OLD | NEW |