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

Unified Diff: views/test/views_test_base.cc

Issue 8240006: Use a mocked compositor for unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missed views_test_base.cc Created 9 years, 2 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: views/test/views_test_base.cc
diff --git a/views/test/views_test_base.cc b/views/test/views_test_base.cc
index 264a58a6a9f69f1a56bfa1e0e16016100f1e6e82..4501341a394b059f4b1d8abd940587e7ae9b98a6 100644
--- a/views/test/views_test_base.cc
+++ b/views/test/views_test_base.cc
@@ -8,8 +8,8 @@
#include <ole2.h>
#endif
+#include "ui/gfx/compositor/compositor.h"
#include "ui/gfx/compositor/test_compositor.h"
-#include "views/widget/widget.h"
#if defined(USE_AURA)
#include "ui/aura/desktop.h"
@@ -18,8 +18,8 @@
namespace views {
-static ui::Compositor* TestCreateCompositor() {
- return new ui::TestCompositor();
+static ui::Compositor* TestCreateCompositor(ui::CompositorDelegate *owner) {
+ return new ui::TestCompositor(owner);
}
ViewsTestBase::ViewsTestBase()
@@ -28,11 +28,9 @@ ViewsTestBase::ViewsTestBase()
#if defined(OS_WIN)
OleInitialize(NULL);
#endif
+ ui::Compositor::set_compositor_factory_for_testing(&TestCreateCompositor);
#if defined(USE_AURA)
- aura::Desktop::set_compositor_factory_for_testing(&TestCreateCompositor);
new aura::test::TestDesktopDelegate;
-#else
- Widget::set_compositor_factory_for_testing(&TestCreateCompositor);
#endif
}
@@ -60,11 +58,7 @@ void ViewsTestBase::TearDown() {
teardown_called_ = true;
views_delegate_.reset();
testing::Test::TearDown();
-#if defined(USE_AURA)
- aura::Desktop::set_compositor_factory_for_testing(NULL);
-#else
- Widget::set_compositor_factory_for_testing(NULL);
-#endif
+ ui::Compositor::set_compositor_factory_for_testing(NULL);
}
void ViewsTestBase::RunPendingMessages() {

Powered by Google App Engine
This is Rietveld 408576698