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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 | 160 |
161 private: | 161 private: |
162 TestWebUIControllerFactory factory_; | 162 TestWebUIControllerFactory factory_; |
163 | 163 |
164 DISALLOW_COPY_AND_ASSIGN(WebUIMojoTest); | 164 DISALLOW_COPY_AND_ASSIGN(WebUIMojoTest); |
165 }; | 165 }; |
166 | 166 |
167 // Loads a webui page that contains mojo bindings and verifies a message makes | 167 // Loads a webui page that contains mojo bindings and verifies a message makes |
168 // it from the browser to the page and back. | 168 // it from the browser to the page and back. |
169 // http://crbug.com/357308 | 169 // http://crbug.com/357308 |
170 #if defined(OS_WIN) | 170 IN_PROC_BROWSER_TEST_F(WebUIMojoTest, DISABLED_EndToEnd) { |
darin (slow to review)
2014/03/28 06:14:46
This test will be re-enabled on all platforms in h
| |
171 #define MAYBE_EndToEnd DISABLED_EndToEnd | |
172 #else | |
173 #define MAYBE_EndToEnd EndToEnd | |
174 #endif | |
175 IN_PROC_BROWSER_TEST_F(WebUIMojoTest, MAYBE_EndToEnd) { | |
176 // Currently there is no way to have a generated file included in the isolate | 171 // Currently there is no way to have a generated file included in the isolate |
177 // files. If the bindings file doesn't exist assume we're on such a bot and | 172 // files. If the bindings file doesn't exist assume we're on such a bot and |
178 // pass. | 173 // pass. |
179 // TODO(sky): remove this conditional when isolates support copying from gen. | 174 // TODO(sky): remove this conditional when isolates support copying from gen. |
180 const base::FilePath test_file_path( | 175 const base::FilePath test_file_path( |
181 GetFilePathForJSResource( | 176 GetFilePathForJSResource( |
182 "content/test/data/web_ui_test_mojo_bindings.mojom")); | 177 "content/test/data/web_ui_test_mojo_bindings.mojom")); |
183 if (!base::PathExists(test_file_path)) { | 178 if (!base::PathExists(test_file_path)) { |
184 LOG(WARNING) << " mojom binding file doesn't exist, assuming on isolate"; | 179 LOG(WARNING) << " mojom binding file doesn't exist, assuming on isolate"; |
185 return; | 180 return; |
186 } | 181 } |
187 | 182 |
188 got_message = false; | 183 got_message = false; |
189 ASSERT_TRUE(test_server()->Start()); | 184 ASSERT_TRUE(test_server()->Start()); |
190 base::RunLoop run_loop; | 185 base::RunLoop run_loop; |
191 factory()->set_run_loop(&run_loop); | 186 factory()->set_run_loop(&run_loop); |
192 GURL test_url(test_server()->GetURL("files/web_ui_mojo.html")); | 187 GURL test_url(test_server()->GetURL("files/web_ui_mojo.html")); |
193 NavigateToURL(shell(), test_url); | 188 NavigateToURL(shell(), test_url); |
194 // RunLoop is quit when message received from page. | 189 // RunLoop is quit when message received from page. |
195 run_loop.Run(); | 190 run_loop.Run(); |
196 EXPECT_TRUE(got_message); | 191 EXPECT_TRUE(got_message); |
197 } | 192 } |
198 | 193 |
199 } // namespace | 194 } // namespace |
200 } // namespace content | 195 } // namespace content |
OLD | NEW |