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 "chrome/test/base/web_ui_browser_test.h" | 5 #include "chrome/test/base/web_ui_browser_test.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 } | 214 } |
215 | 215 |
216 void WebUIBrowserTest::BrowsePreload(const GURL& browse_to) { | 216 void WebUIBrowserTest::BrowsePreload(const GURL& browse_to) { |
217 content::WebContents* web_contents = | 217 content::WebContents* web_contents = |
218 browser()->tab_strip_model()->GetActiveWebContents(); | 218 browser()->tab_strip_model()->GetActiveWebContents(); |
219 WebUIJsInjectionReadyObserver injection_observer( | 219 WebUIJsInjectionReadyObserver injection_observer( |
220 web_contents, this, preload_test_fixture_, preload_test_name_); | 220 web_contents, this, preload_test_fixture_, preload_test_name_); |
221 content::TestNavigationObserver navigation_observer(web_contents); | 221 content::TestNavigationObserver navigation_observer(web_contents); |
222 chrome::NavigateParams params( | 222 chrome::NavigateParams params( |
223 browser(), GURL(browse_to), ui::PAGE_TRANSITION_TYPED); | 223 browser(), GURL(browse_to), ui::PAGE_TRANSITION_TYPED); |
224 params.disposition = CURRENT_TAB; | 224 params.disposition = WindowOpenDisposition::CURRENT_TAB; |
225 | 225 |
226 // This is needed to make the test | 226 // This is needed to make the test |
227 // MaterialHistoryBrowserTest.HistoryToolbarFocusTest pass on macOS. The test | 227 // MaterialHistoryBrowserTest.HistoryToolbarFocusTest pass on macOS. The test |
228 // is fundamentally flawed, since it expects a particular widget to be | 228 // is fundamentally flawed, since it expects a particular widget to be |
229 // focused. Chrome focus semantics are based on the Windows platform, where a | 229 // focused. Chrome focus semantics are based on the Windows platform, where a |
230 // widget cannot be focused without window activation. browser_tests can be | 230 // widget cannot be focused without window activation. browser_tests can be |
231 // sharded, so there is no way to enforce that a given window is activated. | 231 // sharded, so there is no way to enforce that a given window is activated. |
232 // Focus tests should be interactive_ui_tests, and they should explicitly | 232 // Focus tests should be interactive_ui_tests, and they should explicitly |
233 // activate the window. https://crbug.com/642467. | 233 // activate the window. https://crbug.com/642467. |
234 params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 234 params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 } | 499 } |
500 | 500 |
501 GURL WebUIBrowserTest::WebUITestDataPathToURL( | 501 GURL WebUIBrowserTest::WebUITestDataPathToURL( |
502 const base::FilePath::StringType& path) { | 502 const base::FilePath::StringType& path) { |
503 base::FilePath dir_test_data; | 503 base::FilePath dir_test_data; |
504 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); | 504 EXPECT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &dir_test_data)); |
505 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); | 505 base::FilePath test_path(dir_test_data.Append(kWebUITestFolder).Append(path)); |
506 EXPECT_TRUE(base::PathExists(test_path)); | 506 EXPECT_TRUE(base::PathExists(test_path)); |
507 return net::FilePathToFileURL(test_path); | 507 return net::FilePathToFileURL(test_path); |
508 } | 508 } |
OLD | NEW |