| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 13 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
| 14 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
| 15 #include "content/public/browser/render_view_host.h" | 15 #include "content/public/browser/render_view_host.h" |
| 16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
| 17 #include "content/public/browser/web_ui_controller.h" | 17 #include "content/public/browser/web_ui_controller.h" |
| 18 #include "content/public/browser/web_ui_data_source.h" | 18 #include "content/public/browser/web_ui_data_source.h" |
| 19 #include "content/public/common/content_paths.h" | 19 #include "content/public/common/content_paths.h" |
| 20 #include "content/public/common/content_switches.h" | 20 #include "content/public/common/content_switches.h" |
| 21 #include "content/public/common/url_utils.h" | 21 #include "content/public/common/url_utils.h" |
| 22 #include "content/public/test/content_browser_test.h" | 22 #include "content/public/test/content_browser_test.h" |
| 23 #include "content/public/test/content_browser_test_utils.h" | 23 #include "content/public/test/content_browser_test_utils.h" |
| 24 #include "content/test/data/web_ui_test_mojo_bindings.mojom.h" | 24 #include "content/test/data/web_ui_test_mojo_bindings.mojom.h" |
| 25 #include "grit/content_resources.h" | 25 #include "grit/content_resources.h" |
| 26 #include "mojo/common/test/test_utils.h" | 26 #include "mojo/common/test/test_utils.h" |
| 27 #include "mojo/public/cpp/bindings/allocation_scope.h" | |
| 28 #include "mojo/public/js/bindings/constants.h" | 27 #include "mojo/public/js/bindings/constants.h" |
| 29 | 28 |
| 30 namespace content { | 29 namespace content { |
| 31 namespace { | 30 namespace { |
| 32 | 31 |
| 33 bool got_message = false; | 32 bool got_message = false; |
| 34 | 33 |
| 35 // The bindings for the page are generated from a .mojom file. This code looks | 34 // The bindings for the page are generated from a .mojom file. This code looks |
| 36 // up the generated file from disk and returns it. | 35 // up the generated file from disk and returns it. |
| 37 bool GetResource(const std::string& id, | 36 bool GetResource(const std::string& id, |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 factory()->set_run_loop(&run_loop); | 208 factory()->set_run_loop(&run_loop); |
| 210 GURL test_url(test_server()->GetURL("files/web_ui_mojo.html?ping")); | 209 GURL test_url(test_server()->GetURL("files/web_ui_mojo.html?ping")); |
| 211 NavigateToURL(shell(), test_url); | 210 NavigateToURL(shell(), test_url); |
| 212 // RunLoop is quit when message received from page. | 211 // RunLoop is quit when message received from page. |
| 213 run_loop.Run(); | 212 run_loop.Run(); |
| 214 EXPECT_TRUE(got_message); | 213 EXPECT_TRUE(got_message); |
| 215 } | 214 } |
| 216 | 215 |
| 217 } // namespace | 216 } // namespace |
| 218 } // namespace content | 217 } // namespace content |
| OLD | NEW |