diff options
author | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-03 17:52:43 +0000 |
---|---|---|
committer | mmenke@chromium.org <mmenke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-03 17:52:43 +0000 |
commit | e9960c85761f024674bda4624fe3089137dcfa23 (patch) | |
tree | 56decca2b8bd478b2c0966061a1ad539b1431267 /chrome/test/base/in_process_browser_test.h | |
parent | 4c46d7a5b0af9b7d320e709291b270ab7cf07e83 (diff) | |
download | chromium_src-e9960c85761f024674bda4624fe3089137dcfa23.zip chromium_src-e9960c85761f024674bda4624fe3089137dcfa23.tar.gz chromium_src-e9960c85761f024674bda4624fe3089137dcfa23.tar.bz2 |
Revert 135164 - Cleanup of browser_test harness.
-share the browser startup code with chrome. Apart from the benefit of making browser_tests more like Chrome, this allows us to write browser_tests that test app mode etc.
-get rid of InProcessBrowserTest::set_initial_window_required now that the above is done
-get rid of InProcessBrowserTest::set_show_window which didn't do anything
-get rid of --disable-tab-closeable-state-watcher which was set by a chromeos test but not used anywhere
I had to create the Mac autorelease pool object a little earlier, since it must be created before the first Browser window is created (which used to happen in InProcessBrowserTest::RunTestOnMainThreadLoop but now happens in BrowserTestBase::SetUp()).
Review URL: https://chromiumcodereview.appspot.com/10278003
TBR=jam@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10352015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135175 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/base/in_process_browser_test.h')
-rw-r--r-- | chrome/test/base/in_process_browser_test.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/chrome/test/base/in_process_browser_test.h b/chrome/test/base/in_process_browser_test.h index 2636b9a..e695912 100644 --- a/chrome/test/base/in_process_browser_test.h +++ b/chrome/test/base/in_process_browser_test.h @@ -143,10 +143,10 @@ class InProcessBrowserTest : public BrowserTestBase { // finish loading and shows the browser. // // This is invoked from Setup. - Browser* CreateBrowser(Profile* profile); + virtual Browser* CreateBrowser(Profile* profile); // Similar to |CreateBrowser|, but creates an incognito browser. - Browser* CreateIncognitoBrowser(); + virtual Browser* CreateIncognitoBrowser(); // Creates a browser for a popup window with a single tab (about:blank), waits // for the tab to finish loading, and shows the browser. @@ -178,7 +178,14 @@ class InProcessBrowserTest : public BrowserTestBase { // Sets some test states (see below for comments). Call this in your test // constructor. + void set_show_window(bool show) { show_window_ = show; } + void set_initial_window_required(bool flag) { + initial_window_required_= flag; + } void EnableDOMAutomation() { dom_automation_enabled_ = true; } + void EnableTabCloseableStateWatcher() { + tab_closeable_state_watcher_enabled_ = true; + } #if defined(OS_POSIX) // This is only needed by a test that raises SIGTERM to ensure that a specific // codepath is taken. @@ -215,10 +222,20 @@ class InProcessBrowserTest : public BrowserTestBase { // ContentRendererClient when running in single-process mode. scoped_ptr<content::ContentRendererClient> single_process_renderer_client_; + // Whether this test requires the browser windows to be shown (interactive + // tests for example need the windows shown). + bool show_window_; + + // Whether this test requires an initial window. + bool initial_window_required_; + // Whether the JavaScript can access the DOMAutomationController (a JS object // that can send messages back to the browser). bool dom_automation_enabled_; + // Whether this test requires the TabCloseableStateWatcher. + bool tab_closeable_state_watcher_enabled_; + // Host resolver to use during the test. scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_; |