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 <limits> | 5 #include <limits> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 12 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
13 #include "content/public/browser/browser_context.h" | 13 #include "content/public/browser/browser_context.h" |
14 #include "content/public/browser/render_frame_host.h" | 14 #include "content/public/browser/render_frame_host.h" |
15 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
16 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
18 #include "content/public/browser/web_ui_controller.h" | 18 #include "content/public/browser/web_ui_controller.h" |
19 #include "content/public/browser/web_ui_data_source.h" | 19 #include "content/public/browser/web_ui_data_source.h" |
20 #include "content/public/common/content_paths.h" | 20 #include "content/public/common/content_paths.h" |
21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
22 #include "content/public/common/service_registry.h" | 22 #include "content/public/common/service_registry.h" |
23 #include "content/public/common/url_utils.h" | 23 #include "content/public/common/url_utils.h" |
24 #include "content/public/test/browser_test_utils.h" | 24 #include "content/public/test/browser_test_utils.h" |
25 #include "content/public/test/content_browser_test.h" | 25 #include "content/public/test/content_browser_test.h" |
26 #include "content/public/test/content_browser_test_utils.h" | 26 #include "content/public/test/content_browser_test_utils.h" |
27 #include "content/shell/browser/shell.h" | 27 #include "content/shell/browser/shell.h" |
28 #include "content/test/data/web_ui_test_mojo_bindings.mojom.h" | 28 #include "content/test/data/web_ui_test_mojo_bindings.mojom.h" |
| 29 #include "mojo/public/cpp/bindings/binding.h" |
| 30 #include "mojo/public/cpp/bindings/interface_request.h" |
| 31 #include "mojo/public/js/constants.h" |
29 #include "mojo/test/test_utils.h" | 32 #include "mojo/test/test_utils.h" |
30 #include "net/test/embedded_test_server/embedded_test_server.h" | 33 #include "net/test/embedded_test_server/embedded_test_server.h" |
31 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | |
32 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h" | |
33 #include "third_party/mojo/src/mojo/public/js/constants.h" | |
34 | 34 |
35 namespace content { | 35 namespace content { |
36 namespace { | 36 namespace { |
37 | 37 |
38 bool got_message = false; | 38 bool got_message = false; |
39 | 39 |
40 // The bindings for the page are generated from a .mojom file. This code looks | 40 // The bindings for the page are generated from a .mojom file. This code looks |
41 // up the generated file from disk and returns it. | 41 // up the generated file from disk and returns it. |
42 bool GetResource(const std::string& id, | 42 bool GetResource(const std::string& id, |
43 const WebUIDataSource::GotDataCallback& callback) { | 43 const WebUIDataSource::GotDataCallback& callback) { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 embedded_test_server()->GetURL("/web_ui_mojo_shell_test.html")); | 237 embedded_test_server()->GetURL("/web_ui_mojo_shell_test.html")); |
238 | 238 |
239 DOMMessageQueue message_queue; | 239 DOMMessageQueue message_queue; |
240 std::string message; | 240 std::string message; |
241 ASSERT_TRUE(message_queue.WaitForMessage(&message)); | 241 ASSERT_TRUE(message_queue.WaitForMessage(&message)); |
242 EXPECT_EQ("true", message); | 242 EXPECT_EQ("true", message); |
243 } | 243 } |
244 | 244 |
245 } // namespace | 245 } // namespace |
246 } // namespace content | 246 } // namespace content |
OLD | NEW |