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

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

Issue 145293007: ui: No more TestCompositor. Use NullDraw contexts in unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: testsnulldraw: Created 6 years, 11 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/test_renderer_host.cc
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc
index c837a76eda2dbce04b2aa7385514cf2cb5fa4848..2c13db47e886ee338ac35f12328170c16de182ce 100644
--- a/content/public/test/test_renderer_host.cc
+++ b/content/public/test/test_renderer_host.cc
@@ -24,6 +24,7 @@
#if defined(USE_AURA)
#include "ui/aura/test/aura_test_helper.h"
+#include "ui/compositor/test/context_factories_for_test.h"
#endif
namespace content {
@@ -165,10 +166,13 @@ void RenderViewHostTestHarness::SetUp() {
ole_initializer_.reset(new ui::ScopedOleInitializer());
#endif
#if defined(USE_AURA)
+ // The ContextFactory must exist before any Compositors are created.
+ bool enable_pixel_output = false;
+ ui::InitializeContextFactoryForTests(enable_pixel_output);
+
aura_test_helper_.reset(
new aura::test::AuraTestHelper(base::MessageLoopForUI::current()));
- bool allow_test_contexts = true;
- aura_test_helper_->SetUp(allow_test_contexts);
+ aura_test_helper_->SetUp();
#endif
DCHECK(!browser_context_);
@@ -181,6 +185,7 @@ void RenderViewHostTestHarness::TearDown() {
SetContents(NULL);
#if defined(USE_AURA)
aura_test_helper_->TearDown();
+ ui::TerminateContextFactoryForTests();
#endif
// Make sure that we flush any messages related to WebContentsImpl destruction
// before we destroy the browser context.

Powered by Google App Engine
This is Rietveld 408576698