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 #include <utility> | 6 #include <utility> |
7 | 7 |
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/macros.h" | 10 #include "base/macros.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 TestWebUIControllerFactory factory_; | 197 TestWebUIControllerFactory factory_; |
198 | 198 |
199 DISALLOW_COPY_AND_ASSIGN(WebUIMojoTest); | 199 DISALLOW_COPY_AND_ASSIGN(WebUIMojoTest); |
200 }; | 200 }; |
201 | 201 |
202 bool IsGeneratedResourceAvailable(const std::string& resource_path) { | 202 bool IsGeneratedResourceAvailable(const std::string& resource_path) { |
203 // Currently there is no way to have a generated file included in the isolate | 203 // 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 | 204 // files. If the bindings file doesn't exist assume we're on such a bot and |
205 // pass. | 205 // pass. |
206 // TODO(sky): remove this conditional when isolates support copying from gen. | 206 // TODO(sky): remove this conditional when isolates support copying from gen. |
207 base::ThreadRestrictions::ScopedAllowIO allow_io_for_file_existance_check; | 207 base::ThreadRestrictions::ScopedAllowIO allow_io_for_file_existence_check; |
dschuyler
2017/05/31 22:09:35
This is an 'auto' or 'stack' var, so the variable
| |
208 const base::FilePath test_file_path(GetFilePathForJSResource(resource_path)); | 208 const base::FilePath test_file_path(GetFilePathForJSResource(resource_path)); |
209 if (base::PathExists(test_file_path)) | 209 if (base::PathExists(test_file_path)) |
210 return true; | 210 return true; |
211 LOG(WARNING) << " mojom binding file doesn't exist, assuming on isolate"; | 211 LOG(WARNING) << " mojom binding file doesn't exist, assuming on isolate"; |
212 return false; | 212 return false; |
213 } | 213 } |
214 | 214 |
215 // Loads a webui page that contains mojo bindings and verifies a message makes | 215 // Loads a webui page that contains mojo bindings and verifies a message makes |
216 // it from the browser to the page and back. | 216 // it from the browser to the page and back. |
217 IN_PROC_BROWSER_TEST_F(WebUIMojoTest, EndToEndPing) { | 217 IN_PROC_BROWSER_TEST_F(WebUIMojoTest, EndToEndPing) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 NavigateToURL(shell(), embedded_test_server()->GetURL(kTestNonWebUIUrl)); | 263 NavigateToURL(shell(), embedded_test_server()->GetURL(kTestNonWebUIUrl)); |
264 ASSERT_TRUE(ExecuteScriptAndExtractBool( | 264 ASSERT_TRUE(ExecuteScriptAndExtractBool( |
265 shell()->web_contents(), | 265 shell()->web_contents(), |
266 "domAutomationController.send(" + kTestScript + ")", | 266 "domAutomationController.send(" + kTestScript + ")", |
267 &is_native_mojo_available)); | 267 &is_native_mojo_available)); |
268 EXPECT_FALSE(is_native_mojo_available); | 268 EXPECT_FALSE(is_native_mojo_available); |
269 } | 269 } |
270 | 270 |
271 } // namespace | 271 } // namespace |
272 } // namespace content | 272 } // namespace content |
OLD | NEW |