Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: chrome/test/base/web_ui_browser_test.cc

Issue 2331153002: [Merge to 2840] Fix a bug where inactive windows would inappropriately take focus. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser_navigator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/web_ui_browser_test.cc
diff --git a/chrome/test/base/web_ui_browser_test.cc b/chrome/test/base/web_ui_browser_test.cc
index 5dd111115f0265efbb10e82bce7cccf93195bc04..c0135cfe4ca33b23c90b87c7256c0d975b229e6c 100644
--- a/chrome/test/base/web_ui_browser_test.cc
+++ b/chrome/test/base/web_ui_browser_test.cc
@@ -222,6 +222,17 @@ void WebUIBrowserTest::BrowsePreload(const GURL& browse_to) {
chrome::NavigateParams params(
browser(), GURL(browse_to), ui::PAGE_TRANSITION_TYPED);
params.disposition = CURRENT_TAB;
+
+ // This is needed to make the test
+ // MaterialHistoryBrowserTest.HistoryToolbarFocusTest pass on macOS. The test
+ // is fundamentally flawed, since it expects a particular widget to be
+ // focused. Chrome focus semantics are based on the Windows platform, where a
+ // widget cannot be focused without window activation. browser_tests can be
+ // sharded, so there is no way to enforce that a given window is activated.
+ // Focus tests should be interactive_ui_tests, and they should explicitly
+ // activate the window. https://crbug.com/642467.
+ params.window_action = chrome::NavigateParams::SHOW_WINDOW;
+
chrome::Navigate(&params);
navigation_observer.Wait();
}
« no previous file with comments | « chrome/browser/ui/browser_navigator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698