| 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/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 TestWebUIControllerFactory* factory() { return &factory_; } | 186 TestWebUIControllerFactory* factory() { return &factory_; } |
| 187 | 187 |
| 188 private: | 188 private: |
| 189 TestWebUIControllerFactory factory_; | 189 TestWebUIControllerFactory factory_; |
| 190 | 190 |
| 191 DISALLOW_COPY_AND_ASSIGN(WebUIMojoTest); | 191 DISALLOW_COPY_AND_ASSIGN(WebUIMojoTest); |
| 192 }; | 192 }; |
| 193 | 193 |
| 194 // Loads a webui page that contains mojo bindings and verifies a message makes | 194 // Loads a webui page that contains mojo bindings and verifies a message makes |
| 195 // it from the browser to the page and back. | 195 // it from the browser to the page and back. |
| 196 // Fails on Win and Linux. http://crbug.com/418019 | 196 IN_PROC_BROWSER_TEST_F(WebUIMojoTest, EndToEndPing) { |
| 197 #if defined(OS_WIN) || defined(OS_LINUX) | |
| 198 #define MAYBE_EndToEndPing DISABLED_EndToEndPing | |
| 199 #else | |
| 200 #define MAYBE_EndToEndPing EndToEndPing | |
| 201 #endif | |
| 202 IN_PROC_BROWSER_TEST_F(WebUIMojoTest, MAYBE_EndToEndPing) { | |
| 203 // Currently there is no way to have a generated file included in the isolate | 197 // Currently there is no way to have a generated file included in the isolate |
| 204 // files. If the bindings file doesn't exist assume we're on such a bot and | 198 // files. If the bindings file doesn't exist assume we're on such a bot and |
| 205 // pass. | 199 // pass. |
| 206 // TODO(sky): remove this conditional when isolates support copying from gen. | 200 // TODO(sky): remove this conditional when isolates support copying from gen. |
| 207 const base::FilePath test_file_path( | 201 const base::FilePath test_file_path( |
| 208 mojo::test::GetFilePathForJSResource( | 202 mojo::test::GetFilePathForJSResource( |
| 209 "content/test/data/web_ui_test_mojo_bindings.mojom")); | 203 "content/test/data/web_ui_test_mojo_bindings.mojom")); |
| 210 if (!base::PathExists(test_file_path)) { | 204 if (!base::PathExists(test_file_path)) { |
| 211 LOG(WARNING) << " mojom binding file doesn't exist, assuming on isolate"; | 205 LOG(WARNING) << " mojom binding file doesn't exist, assuming on isolate"; |
| 212 return; | 206 return; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 231 NavigateToURL(other_shell, test_url); | 225 NavigateToURL(other_shell, test_url); |
| 232 // RunLoop is quit when message received from page. | 226 // RunLoop is quit when message received from page. |
| 233 other_run_loop.Run(); | 227 other_run_loop.Run(); |
| 234 EXPECT_TRUE(got_message); | 228 EXPECT_TRUE(got_message); |
| 235 EXPECT_EQ(shell()->web_contents()->GetRenderProcessHost(), | 229 EXPECT_EQ(shell()->web_contents()->GetRenderProcessHost(), |
| 236 other_shell->web_contents()->GetRenderProcessHost()); | 230 other_shell->web_contents()->GetRenderProcessHost()); |
| 237 } | 231 } |
| 238 | 232 |
| 239 } // namespace | 233 } // namespace |
| 240 } // namespace content | 234 } // namespace content |
| OLD | NEW |