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

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

Issue 2285023003: Ensures the first browser in each interactive_ui_test is in the foreground (Closed)
Patch Set: feedback Created 4 years, 4 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/test/base/in_process_browser_test.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/interactive_ui_tests_main.cc
diff --git a/chrome/test/base/interactive_ui_tests_main.cc b/chrome/test/base/interactive_ui_tests_main.cc
index b9af4fe9399e06af3f9cdd5432797e695d386c95..c6258dc393b65111c947c0339f807621d9d799cb 100644
--- a/chrome/test/base/interactive_ui_tests_main.cc
+++ b/chrome/test/base/interactive_ui_tests_main.cc
@@ -6,6 +6,8 @@
#include "build/build_config.h"
#include "chrome/test/base/chrome_test_suite.h"
+#include "chrome/test/base/in_process_browser_test.h"
+#include "chrome/test/base/interactive_test_utils.h"
#include "ui/base/test/ui_controls.h"
#if defined(USE_AURA)
@@ -79,6 +81,18 @@ int main(int argc, char** argv) {
#if defined(OS_WIN)
KillAlwaysOnTopWindows(RunType::BEFORE_TEST);
#endif
+ // TODO(sky): this causes a crash in an autofill test on macosx, figure out
+ // why: http://crbug.com/641969.
+#if !defined(OS_MACOSX)
+ // Without this it's possible for the first browser to start up in the
+ // background, generally because the last test did something that causes the
+ // test to run in the background. Most interactive ui tests assume they are in
+ // the foreground and fail in weird ways if they aren't (for example, clicks
+ // go to the wrong place). This ensures the first browser is always in the
+ // foreground.
+ InProcessBrowserTest::set_global_browser_set_up_function(
+ &ui_test_utils::BringBrowserWindowToFront);
+#endif
// Run interactive_ui_tests serially, they do not support running in parallel.
int default_jobs = 1;
InteractiveUITestSuiteRunner runner;
« no previous file with comments | « chrome/test/base/in_process_browser_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698