diff options
-rwxr-xr-x | chrome/browser/extensions/extension_view_unittest.cc | 3 | ||||
-rw-r--r-- | chrome/test/in_process_browser_test.cc | 6 | ||||
-rw-r--r-- | chrome/test/in_process_browser_test.h | 4 |
3 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/extensions/extension_view_unittest.cc b/chrome/browser/extensions/extension_view_unittest.cc index 102b9bb..4003954 100755 --- a/chrome/browser/extensions/extension_view_unittest.cc +++ b/chrome/browser/extensions/extension_view_unittest.cc @@ -104,6 +104,9 @@ class ExtensionViewTest : public InProcessBrowserTest { // with the wrong MessageLoop. ExtensionErrorReporter::Init(false); + // Use single-process in an attempt to speed it up and make it less flaky. + EnableSingleProcess(); + InProcessBrowserTest::SetUp(); } }; diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc index aec6391..2fe5a3bd 100644 --- a/chrome/test/in_process_browser_test.cc +++ b/chrome/test/in_process_browser_test.cc @@ -47,7 +47,8 @@ bool DieFileDie(const std::wstring& file, bool recurse) { InProcessBrowserTest::InProcessBrowserTest() : browser_(NULL), show_window_(false), - dom_automation_enabled_(false) { + dom_automation_enabled_(false), + single_process_(false) { } void InProcessBrowserTest::SetUp() { @@ -78,6 +79,9 @@ void InProcessBrowserTest::SetUp() { if (dom_automation_enabled_) command_line->AppendSwitch(switches::kDomAutomationController); + if (single_process_) + command_line->AppendSwitch(switches::kSingleProcess); + command_line->AppendSwitchWithValue(switches::kUserDataDir, user_data_dir); // For some reason the sandbox wasn't happy running in test mode. These diff --git a/chrome/test/in_process_browser_test.h b/chrome/test/in_process_browser_test.h index 90dcdc9..481103e 100644 --- a/chrome/test/in_process_browser_test.h +++ b/chrome/test/in_process_browser_test.h @@ -77,6 +77,7 @@ class InProcessBrowserTest : public testing::Test, public NotificationObserver { // constructor. void set_show_window(bool show) { show_window_ = show; } void EnableDOMAutomation() { dom_automation_enabled_ = true; } + void EnableSingleProcess() { single_process_ = true; } private: // Invokes CreateBrowser to create a browser, then RunTestOnMainThread, and @@ -100,6 +101,9 @@ class InProcessBrowserTest : public testing::Test, public NotificationObserver { // that can send messages back to the browser). bool dom_automation_enabled_; + // Whether to run the test in single-process mode. + bool single_process_; + DISALLOW_COPY_AND_ASSIGN(InProcessBrowserTest); }; |