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

Side by Side Diff: content/browser/compositor/reflector_impl_unittest.cc

Issue 2563783002: ui + mus: Split ContextFactory into ContextFactory(Client) and ContextFactoryPrivate (Closed)
Patch Set: Updated 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/memory/ptr_util.h" 5 #include "base/memory/ptr_util.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "cc/output/output_surface_frame.h" 9 #include "cc/output/output_surface_frame.h"
10 #include "cc/scheduler/begin_frame_source.h" 10 #include "cc/scheduler/begin_frame_source.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 ui::InitializeContextFactoryForTests(enable_pixel_output); 127 ui::InitializeContextFactoryForTests(enable_pixel_output);
128 ImageTransportFactory::InitializeForUnitTests( 128 ImageTransportFactory::InitializeForUnitTests(
129 std::unique_ptr<ImageTransportFactory>( 129 std::unique_ptr<ImageTransportFactory>(
130 new NoTransportImageTransportFactory)); 130 new NoTransportImageTransportFactory));
131 message_loop_.reset(new base::MessageLoop()); 131 message_loop_.reset(new base::MessageLoop());
132 task_runner_ = message_loop_->task_runner(); 132 task_runner_ = message_loop_->task_runner();
133 compositor_task_runner_ = new FakeTaskRunner(); 133 compositor_task_runner_ = new FakeTaskRunner();
134 begin_frame_source_.reset(new cc::DelayBasedBeginFrameSource( 134 begin_frame_source_.reset(new cc::DelayBasedBeginFrameSource(
135 base::MakeUnique<cc::DelayBasedTimeSource>( 135 base::MakeUnique<cc::DelayBasedTimeSource>(
136 compositor_task_runner_.get()))); 136 compositor_task_runner_.get())));
137 compositor_.reset( 137 // TODO(fsamuel): Move things over to ContextFactoryPrivate.
138 new ui::Compositor(context_factory, compositor_task_runner_.get())); 138 compositor_.reset(new ui::Compositor(context_factory, nullptr,
139 compositor_task_runner_.get()));
139 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget); 140 compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
140 141
141 auto context_provider = cc::TestContextProvider::Create(); 142 auto context_provider = cc::TestContextProvider::Create();
142 context_provider->BindToCurrentThread(); 143 context_provider->BindToCurrentThread();
143 output_surface_ = 144 output_surface_ =
144 base::MakeUnique<TestOutputSurface>(std::move(context_provider)); 145 base::MakeUnique<TestOutputSurface>(std::move(context_provider));
145 146
146 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); 147 root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
147 compositor_->SetRootLayer(root_layer_.get()); 148 compositor_->SetRootLayer(root_layer_.get());
148 mirroring_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); 149 mirroring_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 plane_2.plane_z_order = 1; 226 plane_2.plane_z_order = 1;
226 list.push_back(plane_1); 227 list.push_back(plane_1);
227 list.push_back(plane_2); 228 list.push_back(plane_2);
228 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); 229 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list);
229 EXPECT_FALSE(list[0].overlay_handled); 230 EXPECT_FALSE(list[0].overlay_handled);
230 } 231 }
231 #endif // defined(USE_OZONE) 232 #endif // defined(USE_OZONE)
232 233
233 } // namespace 234 } // namespace
234 } // namespace content 235 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698