| 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" |
| (...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::kCodecModuleName || | 43 if (id == mojo::kBufferModuleName || |
| 44 id == mojo::kCodecModuleName || |
| 44 id == mojo::kConnectionModuleName || | 45 id == mojo::kConnectionModuleName || |
| 45 id == mojo::kConnectorModuleName || | 46 id == mojo::kConnectorModuleName || |
| 46 id == mojo::kUnicodeModuleName || | 47 id == mojo::kUnicodeModuleName || |
| 47 id == mojo::kRouterModuleName) | 48 id == mojo::kRouterModuleName) |
| 48 return false; | 49 return false; |
| 49 | 50 |
| 50 std::string contents; | 51 std::string contents; |
| 51 CHECK(base::ReadFileToString(mojo::test::GetFilePathForJSResource(id), | 52 CHECK(base::ReadFileToString(mojo::test::GetFilePathForJSResource(id), |
| 52 &contents, | 53 &contents, |
| 53 std::string::npos)) << id; | 54 std::string::npos)) << id; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 NavigateToURL(other_shell, test_url); | 232 NavigateToURL(other_shell, test_url); |
| 232 // RunLoop is quit when message received from page. | 233 // RunLoop is quit when message received from page. |
| 233 other_run_loop.Run(); | 234 other_run_loop.Run(); |
| 234 EXPECT_TRUE(got_message); | 235 EXPECT_TRUE(got_message); |
| 235 EXPECT_EQ(shell()->web_contents()->GetRenderProcessHost(), | 236 EXPECT_EQ(shell()->web_contents()->GetRenderProcessHost(), |
| 236 other_shell->web_contents()->GetRenderProcessHost()); | 237 other_shell->web_contents()->GetRenderProcessHost()); |
| 237 } | 238 } |
| 238 | 239 |
| 239 } // namespace | 240 } // namespace |
| 240 } // namespace content | 241 } // namespace content |
| OLD | NEW |