| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/callback_list.h" | 5 #include "base/callback_list.h" |
| 6 #include "base/lazy_instance.h" | 6 #include "base/lazy_instance.h" |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "content/public/browser/content_browser_client.h" | 8 #include "content/public/browser/content_browser_client.h" |
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
| 10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
| 11 #include "content/public/common/service_registry.h" | 11 #include "content/public/common/service_registry.h" |
| 12 #include "content/public/test/content_browser_test.h" | 12 #include "content/public/test/content_browser_test.h" |
| 13 #include "content/public/test/content_browser_test_utils.h" | 13 #include "content/public/test/content_browser_test_utils.h" |
| 14 #include "content/public/test/test_navigation_observer.h" | 14 #include "content/public/test/test_navigation_observer.h" |
| 15 #include "content/public/test/test_utils.h" | 15 #include "content/public/test/test_utils.h" |
| 16 #include "content/shell/browser/shell.h" | 16 #include "content/shell/browser/shell.h" |
| 17 #include "content/shell/browser/shell_content_browser_client.h" | 17 #include "content/shell/browser/shell_content_browser_client.h" |
| 18 #include "device/battery/battery_monitor.mojom.h" | 18 #include "device/battery/battery_monitor.mojom.h" |
| 19 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | 19 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 20 | 20 |
| 21 // These tests run against a dummy implementation of the BatteryMonitor service. | 21 // These tests run against a dummy implementation of the BatteryMonitor service. |
| 22 // That is, they verify that the service implementation is correctly exposed to | 22 // That is, they verify that the service implementation is correctly exposed to |
| 23 // the renderer, whatever the implementation is. | 23 // the renderer, whatever the implementation is. |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 typedef base::CallbackList<void(const device::BatteryStatus&)> | 29 typedef base::CallbackList<void(const device::BatteryStatus&)> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 TestNavigationObserver same_tab_observer2(shell()->web_contents(), 1); | 169 TestNavigationObserver same_tab_observer2(shell()->web_contents(), 1); |
| 170 status.level = 0.6; | 170 status.level = 0.6; |
| 171 UpdateBattery(status); | 171 UpdateBattery(status); |
| 172 same_tab_observer2.Wait(); | 172 same_tab_observer2.Wait(); |
| 173 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); | 173 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace | 176 } // namespace |
| 177 | 177 |
| 178 } // namespace content | 178 } // namespace content |
| OLD | NEW |