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 <utility> | 5 #include <utility> |
6 | 6 |
7 #include "base/callback_list.h" | 7 #include "base/callback_list.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "content/public/browser/content_browser_client.h" | 12 #include "content/public/browser/content_browser_client.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 #include "content/public/common/content_client.h" | 14 #include "content/public/common/content_client.h" |
15 #include "content/public/test/content_browser_test.h" | 15 #include "content/public/test/content_browser_test.h" |
16 #include "content/public/test/content_browser_test_utils.h" | 16 #include "content/public/test/content_browser_test_utils.h" |
17 #include "content/public/test/test_navigation_observer.h" | 17 #include "content/public/test/test_navigation_observer.h" |
18 #include "content/public/test/test_utils.h" | 18 #include "content/public/test/test_utils.h" |
19 #include "content/shell/browser/shell.h" | 19 #include "content/shell/browser/shell.h" |
20 #include "content/shell/browser/shell_content_browser_client.h" | 20 #include "content/shell/browser/shell_content_browser_client.h" |
21 #include "device/battery/battery_monitor.mojom.h" | 21 #include "device/battery/battery_monitor.mojom.h" |
22 #include "mojo/public/cpp/bindings/strong_binding.h" | 22 #include "mojo/public/cpp/bindings/strong_binding.h" |
23 #include "services/shell/public/cpp/interface_registry.h" | 23 #include "services/service_manager/public/cpp/interface_registry.h" |
24 | 24 |
25 // These tests run against a dummy implementation of the BatteryMonitor service. | 25 // These tests run against a dummy implementation of the BatteryMonitor service. |
26 // That is, they verify that the service implementation is correctly exposed to | 26 // That is, they verify that the service implementation is correctly exposed to |
27 // the renderer, whatever the implementation is. | 27 // the renderer, whatever the implementation is. |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
33 typedef base::CallbackList<void(const device::BatteryStatus&)> | 33 typedef base::CallbackList<void(const device::BatteryStatus&)> |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 TestNavigationObserver same_tab_observer2(shell()->web_contents(), 1); | 181 TestNavigationObserver same_tab_observer2(shell()->web_contents(), 1); |
182 status.level = 0.6; | 182 status.level = 0.6; |
183 UpdateBattery(status); | 183 UpdateBattery(status); |
184 same_tab_observer2.Wait(); | 184 same_tab_observer2.Wait(); |
185 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); | 185 EXPECT_EQ("pass", shell()->web_contents()->GetLastCommittedURL().ref()); |
186 } | 186 } |
187 | 187 |
188 } // namespace | 188 } // namespace |
189 | 189 |
190 } // namespace content | 190 } // namespace content |
OLD | NEW |