OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/compositor/layer_owner.h" | 5 #include "ui/compositor/layer_owner.h" |
6 | 6 |
7 #include "base/test/null_task_runner.h" | 7 #include "base/test/null_task_runner.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "ui/compositor/compositor.h" | 9 #include "ui/compositor/compositor.h" |
10 #include "ui/compositor/layer.h" | 10 #include "ui/compositor/layer.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 void LayerOwnerTestWithCompositor::SetUp() { | 63 void LayerOwnerTestWithCompositor::SetUp() { |
64 scoped_refptr<base::SingleThreadTaskRunner> task_runner = | 64 scoped_refptr<base::SingleThreadTaskRunner> task_runner = |
65 new base::NullTaskRunner(); | 65 new base::NullTaskRunner(); |
66 | 66 |
67 ui::ContextFactory* context_factory = | 67 ui::ContextFactory* context_factory = |
68 ui::InitializeContextFactoryForTests(false); | 68 ui::InitializeContextFactoryForTests(false); |
69 | 69 |
70 compositor_.reset(new ui::Compositor(context_factory, task_runner)); | 70 compositor_.reset(new ui::Compositor(context_factory, task_runner)); |
71 compositor_->SetAcceleratedWidgetAndStartCompositor( | 71 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); |
72 gfx::kNullAcceleratedWidget); | |
73 } | 72 } |
74 | 73 |
75 void LayerOwnerTestWithCompositor::TearDown() { | 74 void LayerOwnerTestWithCompositor::TearDown() { |
76 compositor_.reset(); | 75 compositor_.reset(); |
77 ui::TerminateContextFactoryForTests(); | 76 ui::TerminateContextFactoryForTests(); |
78 } | 77 } |
79 | 78 |
80 } // namespace | 79 } // namespace |
81 | 80 |
82 TEST(LayerOwnerTest, RecreateLayerHonorsAnimationTargets) { | 81 TEST(LayerOwnerTest, RecreateLayerHonorsAnimationTargets) { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 animation.AddObserver(observer.get()); | 211 animation.AddObserver(observer.get()); |
213 gfx::Transform transform; | 212 gfx::Transform transform; |
214 transform.Scale(0.5f, 0.5f); | 213 transform.Scale(0.5f, 0.5f); |
215 child->SetTransform(transform); | 214 child->SetTransform(transform); |
216 } | 215 } |
217 | 216 |
218 scoped_ptr<Layer> layer_copy = owner.RecreateLayer(); | 217 scoped_ptr<Layer> layer_copy = owner.RecreateLayer(); |
219 } | 218 } |
220 | 219 |
221 } // namespace ui | 220 } // namespace ui |
OLD | NEW |