OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 } | 355 } |
356 | 356 |
357 class LayerWithDelegateTest : public testing::Test, public CompositorDelegate { | 357 class LayerWithDelegateTest : public testing::Test, public CompositorDelegate { |
358 public: | 358 public: |
359 LayerWithDelegateTest() : schedule_draw_invoked_(false) {} | 359 LayerWithDelegateTest() : schedule_draw_invoked_(false) {} |
360 virtual ~LayerWithDelegateTest() {} | 360 virtual ~LayerWithDelegateTest() {} |
361 | 361 |
362 // Overridden from testing::Test: | 362 // Overridden from testing::Test: |
363 virtual void SetUp() OVERRIDE { | 363 virtual void SetUp() OVERRIDE { |
364 ui::SetupTestCompositor(); | 364 ui::SetupTestCompositor(); |
365 compositor_ = ui::Compositor::Create(this, NULL, gfx::Size(1000, 1000)); | 365 compositor_ = new ui::Compositor(this, NULL, gfx::Size(1000, 1000)); |
366 } | 366 } |
367 | 367 |
368 virtual void TearDown() OVERRIDE { | 368 virtual void TearDown() OVERRIDE { |
369 } | 369 } |
370 | 370 |
371 Compositor* compositor() { return compositor_.get(); } | 371 Compositor* compositor() { return compositor_.get(); } |
372 | 372 |
373 virtual Layer* CreateLayer(Layer::LayerType type) { | 373 virtual Layer* CreateLayer(Layer::LayerType type) { |
374 return new Layer(type); | 374 return new Layer(type); |
375 } | 375 } |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 EXPECT_TRUE(schedule_draw_invoked_); | 1015 EXPECT_TRUE(schedule_draw_invoked_); |
1016 // Because SchedulePaint() was invoked from OnPaintLayer() |child| should | 1016 // Because SchedulePaint() was invoked from OnPaintLayer() |child| should |
1017 // still need to be painted. | 1017 // still need to be painted. |
1018 DrawTree(root.get()); | 1018 DrawTree(root.get()); |
1019 EXPECT_EQ(1, child_delegate.GetPaintCountAndClear()); | 1019 EXPECT_EQ(1, child_delegate.GetPaintCountAndClear()); |
1020 EXPECT_TRUE(child_delegate.last_clip_rect().Contains( | 1020 EXPECT_TRUE(child_delegate.last_clip_rect().Contains( |
1021 gfx::Rect(10, 10, 30, 30))); | 1021 gfx::Rect(10, 10, 30, 30))); |
1022 } | 1022 } |
1023 | 1023 |
1024 } // namespace ui | 1024 } // namespace ui |
OLD | NEW |