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

Unified Diff: chrome/test/base/in_process_browser_test.h

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 | « no previous file | chrome/test/base/in_process_browser_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/in_process_browser_test.h
diff --git a/chrome/test/base/in_process_browser_test.h b/chrome/test/base/in_process_browser_test.h
index ae3d8e9c57a5ef4c1daaf139ca6b89195d17e558..d73e8d3ff71042fbd1a14d2a47f72ac0e222fef1 100644
--- a/chrome/test/base/in_process_browser_test.h
+++ b/chrome/test/base/in_process_browser_test.h
@@ -118,6 +118,17 @@ class InProcessBrowserTest : public content::BrowserTestBase {
// Restores state configured in SetUp.
void TearDown() override;
+ using SetUpBrowserFunction = bool(const Browser*);
+
+ // Sets a function that is called from InProcessBrowserTest::SetUp() with the
+ // first browser. This is intended to set up state applicable to all tests
+ // in the suite. For example, interactive_ui_tests installs a function that
+ // ensures the first browser is in the foreground, active and has focus.
+ static void set_global_browser_set_up_function(
+ SetUpBrowserFunction* set_up_function) {
+ global_browser_set_up_function_ = set_up_function;
+ }
+
protected:
// Returns the browser created by CreateBrowser.
Browser* browser() const { return browser_; }
@@ -234,6 +245,8 @@ class InProcessBrowserTest : public content::BrowserTestBase {
// Quits all open browsers and waits until there are no more browsers.
void QuitBrowsers();
+ static SetUpBrowserFunction* global_browser_set_up_function_;
+
// Browser created from CreateBrowser.
Browser* browser_;
« no previous file with comments | « no previous file | chrome/test/base/in_process_browser_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698