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

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: not mac 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
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..48ebcd803ffe93b5861fee6035fec6e564ee095d 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() on the
+ // first browser. This is intended to set up state applicable to all tests
msw 2016/08/29 01:12:29 nit: s/first/supplied/ or given?
sky 2016/08/29 15:51:20 I changed 'on the' on the previous line to 'with t
+ // 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') | chrome/test/base/interactive_ui_tests_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698