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

Side by Side Diff: ui/gfx/compositor/layer_unittest.cc

Issue 8240006: Use a mocked compositor for unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/gfx/canvas_skia.h" 9 #include "ui/gfx/canvas_skia.h"
10 #include "ui/gfx/compositor/compositor_observer.h" 10 #include "ui/gfx/compositor/compositor_observer.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 DrawTree(l1.get()); 231 DrawTree(l1.get());
232 } 232 }
233 233
234 class LayerWithDelegateTest : public testing::Test { 234 class LayerWithDelegateTest : public testing::Test {
235 public: 235 public:
236 LayerWithDelegateTest() {} 236 LayerWithDelegateTest() {}
237 virtual ~LayerWithDelegateTest() {} 237 virtual ~LayerWithDelegateTest() {}
238 238
239 // Overridden from testing::Test: 239 // Overridden from testing::Test:
240 virtual void SetUp() OVERRIDE { 240 virtual void SetUp() OVERRIDE {
241 compositor_ = new TestCompositor(); 241 compositor_ = new TestCompositor(NULL);
242 } 242 }
243 243
244 virtual void TearDown() OVERRIDE { 244 virtual void TearDown() OVERRIDE {
245 } 245 }
246 246
247 Compositor* compositor() { return compositor_.get(); } 247 Compositor* compositor() { return compositor_.get(); }
248 248
249 virtual Layer* CreateLayer(Layer::LayerType type) { 249 virtual Layer* CreateLayer(Layer::LayerType type) {
250 return new Layer(compositor(), type); 250 return new Layer(compositor(), type);
251 } 251 }
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 EXPECT_FALSE(l2->IsDrawn()); 706 EXPECT_FALSE(l2->IsDrawn());
707 EXPECT_FALSE(l3->IsDrawn()); 707 EXPECT_FALSE(l3->IsDrawn());
708 708
709 l1->SetVisible(true); 709 l1->SetVisible(true);
710 EXPECT_TRUE(l1->IsDrawn()); 710 EXPECT_TRUE(l1->IsDrawn());
711 EXPECT_TRUE(l2->IsDrawn()); 711 EXPECT_TRUE(l2->IsDrawn());
712 EXPECT_FALSE(l3->IsDrawn()); 712 EXPECT_FALSE(l3->IsDrawn());
713 } 713 }
714 714
715 } // namespace ui 715 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698