summaryrefslogtreecommitdiffstats
path: root/ui/gfx/compositor/test_compositor.cc
diff options
context:
space:
mode:
authorbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-25 12:48:03 +0000
committerbacker@chromium.org <backer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-25 12:48:03 +0000
commitc6933fcf7d7d3d13a0b9fb7ee2c6c59406d60003 (patch)
treebe2d4459fc9e0c3fa8ba1c222494991af2424592 /ui/gfx/compositor/test_compositor.cc
parentd251633833d12a8fa5030df91261a015f1812b5a (diff)
downloadchromium_src-c6933fcf7d7d3d13a0b9fb7ee2c6c59406d60003.zip
chromium_src-c6933fcf7d7d3d13a0b9fb7ee2c6c59406d60003.tar.gz
chromium_src-c6933fcf7d7d3d13a0b9fb7ee2c6c59406d60003.tar.bz2
ui::TestCompositor::TestCompositor() constructor has been changed to take a a CompositorDelegate* as a parameter. It can be NULL to get the same behaviour as before. But some tests actually require ScheduleDraw() to cause a draw to happen, in order to test that their real delegate is doing its job. Also, we move the compositor_factory from views::Widget and aura::Desktop to ui::Compositor.
BUG=101091 TEST=bots stay green Review URL: http://codereview.chromium.org/8240006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107103 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/compositor/test_compositor.cc')
-rw-r--r--ui/gfx/compositor/test_compositor.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/ui/gfx/compositor/test_compositor.cc b/ui/gfx/compositor/test_compositor.cc
index f34021e..4bc6faa 100644
--- a/ui/gfx/compositor/test_compositor.cc
+++ b/ui/gfx/compositor/test_compositor.cc
@@ -19,9 +19,11 @@ class TestCompositorDelegate : public ui::CompositorDelegate {
DISALLOW_COPY_AND_ASSIGN(TestCompositorDelegate);
};
-TestCompositor::TestCompositor()
- : Compositor(new TestCompositorDelegate, gfx::Size(100, 100)) {
- owned_delegate_.reset(static_cast<TestCompositorDelegate*>(delegate()));
+TestCompositor::TestCompositor(CompositorDelegate *owner)
+ : Compositor((owner ? owner : new TestCompositorDelegate),
+ gfx::Size(100, 100)) {
+ if (!owner)
+ owned_delegate_.reset(static_cast<TestCompositorDelegate*>(delegate()));
}
TestCompositor::~TestCompositor() {
@@ -46,6 +48,10 @@ void TestCompositor::DrawTree() {
#endif
}
+ui::Compositor* TestCompositor::Create(ui::CompositorDelegate* owner) {
+ return new ui::TestCompositor(owner);
+}
+
void TestCompositor::OnWidgetSizeChanged() {
}