| 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" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 namespace content { | 33 namespace content { |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 bool got_message = false; | 36 bool got_message = false; |
| 37 | 37 |
| 38 // The bindings for the page are generated from a .mojom file. This code looks | 38 // The bindings for the page are generated from a .mojom file. This code looks |
| 39 // up the generated file from disk and returns it. | 39 // up the generated file from disk and returns it. |
| 40 bool GetResource(const std::string& id, | 40 bool GetResource(const std::string& id, |
| 41 const WebUIDataSource::GotDataCallback& callback) { | 41 const WebUIDataSource::GotDataCallback& callback) { |
| 42 // These are handled by the WebUIDataSource that AddMojoDataSource() creates. | 42 // These are handled by the WebUIDataSource that AddMojoDataSource() creates. |
| 43 if (id == mojo::kBufferModuleName || | 43 if (id == mojo::kBindingsModuleName || |
| 44 id == mojo::kBufferModuleName || |
| 44 id == mojo::kCodecModuleName || | 45 id == mojo::kCodecModuleName || |
| 45 id == mojo::kConnectionModuleName || | 46 id == mojo::kConnectionModuleName || |
| 46 id == mojo::kConnectorModuleName || | 47 id == mojo::kConnectorModuleName || |
| 47 id == mojo::kUnicodeModuleName || | 48 id == mojo::kUnicodeModuleName || |
| 48 id == mojo::kRouterModuleName || | 49 id == mojo::kRouterModuleName || |
| 49 id == mojo::kValidatorModuleName) | 50 id == mojo::kValidatorModuleName) |
| 50 return false; | 51 return false; |
| 51 | 52 |
| 52 std::string contents; | 53 std::string contents; |
| 53 CHECK(base::ReadFileToString(mojo::test::GetFilePathForJSResource(id), | 54 CHECK(base::ReadFileToString(mojo::test::GetFilePathForJSResource(id), |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 NavigateToURL(other_shell, test_url); | 223 NavigateToURL(other_shell, test_url); |
| 223 // RunLoop is quit when message received from page. | 224 // RunLoop is quit when message received from page. |
| 224 other_run_loop.Run(); | 225 other_run_loop.Run(); |
| 225 EXPECT_TRUE(got_message); | 226 EXPECT_TRUE(got_message); |
| 226 EXPECT_EQ(shell()->web_contents()->GetRenderProcessHost(), | 227 EXPECT_EQ(shell()->web_contents()->GetRenderProcessHost(), |
| 227 other_shell->web_contents()->GetRenderProcessHost()); | 228 other_shell->web_contents()->GetRenderProcessHost()); |
| 228 } | 229 } |
| 229 | 230 |
| 230 } // namespace | 231 } // namespace |
| 231 } // namespace content | 232 } // namespace content |
| OLD | NEW |