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

Unified Diff: ui/views/test/views_test_base.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
« ui/gl/gl_implementation.h ('K') | « ui/views/run_all_unittests.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/test/views_test_base.cc
diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc
index 37085e38acfd9413ff70475990da7a03873a261d..23539f7c639b0cec318a5cfc84171138d5a2951a 100644
--- a/ui/views/test/views_test_base.cc
+++ b/ui/views/test/views_test_base.cc
@@ -12,6 +12,7 @@
#include "ui/aura/env.h"
#include "ui/aura/root_window.h"
#include "ui/aura/test/aura_test_helper.h"
+#include "ui/compositor/test/context_factories_for_test.h"
#include "ui/views/corewm/capture_controller.h"
#include "ui/views/corewm/wm_state.h"
#endif
@@ -36,9 +37,12 @@ void ViewsTestBase::SetUp() {
if (!views_delegate_.get())
views_delegate_.reset(new TestViewsDelegate());
#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(&message_loop_));
- bool allow_test_contexts = true;
- aura_test_helper_->SetUp(allow_test_contexts);
+ aura_test_helper_->SetUp();
wm_state_.reset(new views::corewm::WMState);
#endif // USE_AURA
ui::InitializeInputMethodForTesting();
@@ -56,6 +60,7 @@ void ViewsTestBase::TearDown() {
ui::ShutdownInputMethodForTesting();
#if defined(USE_AURA)
aura_test_helper_->TearDown();
+ ui::TerminateContextFactoryForTests();
wm_state_.reset();
CHECK(!corewm::ScopedCaptureClient::IsActive());
#endif // USE_AURA
« ui/gl/gl_implementation.h ('K') | « ui/views/run_all_unittests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698