| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |