| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 DrawTree(l1.get()); | 206 DrawTree(l1.get()); |
| 207 } | 207 } |
| 208 | 208 |
| 209 class LayerWithDelegateTest : public testing::Test { | 209 class LayerWithDelegateTest : public testing::Test { |
| 210 public: | 210 public: |
| 211 LayerWithDelegateTest() {} | 211 LayerWithDelegateTest() {} |
| 212 virtual ~LayerWithDelegateTest() {} | 212 virtual ~LayerWithDelegateTest() {} |
| 213 | 213 |
| 214 // Overridden from testing::Test: | 214 // Overridden from testing::Test: |
| 215 virtual void SetUp() OVERRIDE { | 215 virtual void SetUp() OVERRIDE { |
| 216 compositor_ = new TestCompositor(); | 216 compositor_ = new TestCompositor(NULL); |
| 217 } | 217 } |
| 218 | 218 |
| 219 virtual void TearDown() OVERRIDE { | 219 virtual void TearDown() OVERRIDE { |
| 220 } | 220 } |
| 221 | 221 |
| 222 Compositor* compositor() { return compositor_.get(); } | 222 Compositor* compositor() { return compositor_.get(); } |
| 223 | 223 |
| 224 virtual Layer* CreateLayer(Layer::LayerType type) { | 224 virtual Layer* CreateLayer(Layer::LayerType type) { |
| 225 return new Layer(compositor(), type); | 225 return new Layer(compositor(), type); |
| 226 } | 226 } |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 EXPECT_FALSE(l2->IsDrawn()); | 664 EXPECT_FALSE(l2->IsDrawn()); |
| 665 EXPECT_FALSE(l3->IsDrawn()); | 665 EXPECT_FALSE(l3->IsDrawn()); |
| 666 | 666 |
| 667 l1->SetVisible(true); | 667 l1->SetVisible(true); |
| 668 EXPECT_TRUE(l1->IsDrawn()); | 668 EXPECT_TRUE(l1->IsDrawn()); |
| 669 EXPECT_TRUE(l2->IsDrawn()); | 669 EXPECT_TRUE(l2->IsDrawn()); |
| 670 EXPECT_FALSE(l3->IsDrawn()); | 670 EXPECT_FALSE(l3->IsDrawn()); |
| 671 } | 671 } |
| 672 | 672 |
| 673 } // namespace ui | 673 } // namespace ui |
| OLD | NEW |