| 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/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/test/null_task_runner.h" | 8 #include "base/test/null_task_runner.h" |
| 9 #include "cc/animation/animation_player.h" | 9 #include "cc/animation/animation_player.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 LayerOwnerTestWithCompositor::LayerOwnerTestWithCompositor() { | 64 LayerOwnerTestWithCompositor::LayerOwnerTestWithCompositor() { |
| 65 } | 65 } |
| 66 | 66 |
| 67 LayerOwnerTestWithCompositor::~LayerOwnerTestWithCompositor() { | 67 LayerOwnerTestWithCompositor::~LayerOwnerTestWithCompositor() { |
| 68 } | 68 } |
| 69 | 69 |
| 70 void LayerOwnerTestWithCompositor::SetUp() { | 70 void LayerOwnerTestWithCompositor::SetUp() { |
| 71 scoped_refptr<base::SingleThreadTaskRunner> task_runner = | 71 scoped_refptr<base::SingleThreadTaskRunner> task_runner = |
| 72 new base::NullTaskRunner(); | 72 new base::NullTaskRunner(); |
| 73 | 73 |
| 74 ui::ContextFactory* context_factory = | 74 ui::ContextFactory* context_factory = nullptr; |
| 75 ui::InitializeContextFactoryForTests(false); | 75 ui::ContextFactoryPrivate* context_factory_private = nullptr; |
| 76 | 76 |
| 77 compositor_.reset(new ui::Compositor(context_factory, task_runner)); | 77 ui::InitializeContextFactoryForTests(false, &context_factory, |
| 78 &context_factory_private); |
| 79 |
| 80 compositor_.reset(new ui::Compositor(context_factory, context_factory_private, |
| 81 task_runner)); |
| 78 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); | 82 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); |
| 79 } | 83 } |
| 80 | 84 |
| 81 void LayerOwnerTestWithCompositor::TearDown() { | 85 void LayerOwnerTestWithCompositor::TearDown() { |
| 82 compositor_.reset(); | 86 compositor_.reset(); |
| 83 ui::TerminateContextFactoryForTests(); | 87 ui::TerminateContextFactoryForTests(); |
| 84 } | 88 } |
| 85 | 89 |
| 86 } // namespace | 90 } // namespace |
| 87 | 91 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 205 |
| 202 layer->SetOpacity(0.5f); | 206 layer->SetOpacity(0.5f); |
| 203 | 207 |
| 204 scoped_refptr<cc::AnimationPlayer> player = | 208 scoped_refptr<cc::AnimationPlayer> player = |
| 205 layer->GetAnimator()->GetAnimationPlayerForTesting(); | 209 layer->GetAnimator()->GetAnimationPlayerForTesting(); |
| 206 EXPECT_TRUE(player); | 210 EXPECT_TRUE(player); |
| 207 EXPECT_TRUE(player->animation_timeline()); | 211 EXPECT_TRUE(player->animation_timeline()); |
| 208 } | 212 } |
| 209 | 213 |
| 210 } // namespace ui | 214 } // namespace ui |
| OLD | NEW |