Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: ui/compositor/layer_owner_unittest.cc

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Restore mash Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/compositor/layer_animator_unittest.cc ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/compositor/layer_animator_unittest.cc ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698