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

Unified Diff: content/public/test/browser_test_base.cc

Issue 21052007: aura: Clean up compositor initialization/destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanupcompositor: Created 7 years, 5 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: content/public/test/browser_test_base.cc
diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc
index d15e54bab0a7ea706f3ba46357a1cac339ad23ea..1ec65ec14b1c755d93bc91199af2e4ce0f8a9fc0 100644
--- a/content/public/test/browser_test_base.cc
+++ b/content/public/test/browser_test_base.cc
@@ -13,6 +13,7 @@
#include "content/public/common/main_function_params.h"
#include "content/public/test/test_utils.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
+#include "ui/compositor/compositor_switches.h"
#if defined(OS_POSIX)
#include "base/process/process_handle.h"
@@ -64,7 +65,8 @@ extern int BrowserMain(const MainFunctionParams&);
BrowserTestBase::BrowserTestBase()
: embedded_test_server_(
new net::test_server::EmbeddedTestServer(
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))) {
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))),
+ allow_test_contexts_(true) {
#if defined(OS_MACOSX)
base::mac::SetOverrideAmIBundled(true);
base::PowerMonitor::AllocateSystemIOPorts();
@@ -98,6 +100,14 @@ void BrowserTestBase::SetUp() {
new base::Closure(
base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this));
+#if defined(USE_AURA)
+ // Copy what UITestBase::SetLaunchSwitches() does, and also what
+ // ChromeTestSuite does if the process had went into the test path. Otherwise
+ // tests will fail on bots.
+ if (allow_test_contexts_)
+ command_line->AppendSwitch(switches::kTestCompositor);
+#endif
+
SetUpInProcessBrowserTestFixture();
#if defined(OS_ANDROID)
BrowserMainRunner::Create()->Initialize(params);

Powered by Google App Engine
This is Rietveld 408576698