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

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

Issue 1159623009: content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test build fix. Created 5 years, 6 months 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/message_loop/message_loop.h"
6 #include "base/run_loop.h" 5 #include "base/run_loop.h"
7 #include "base/single_thread_task_runner.h" 6 #include "base/single_thread_task_runner.h"
8 #include "cc/test/fake_output_surface_client.h" 7 #include "cc/test/fake_output_surface_client.h"
9 #include "cc/test/test_context_provider.h" 8 #include "cc/test/test_context_provider.h"
10 #include "cc/test/test_web_graphics_context_3d.h" 9 #include "cc/test/test_web_graphics_context_3d.h"
11 #include "content/browser/compositor/browser_compositor_output_surface.h" 10 #include "content/browser/compositor/browser_compositor_output_surface.h"
12 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida tor.h" 11 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida tor.h"
13 #include "content/browser/compositor/reflector_impl.h" 12 #include "content/browser/compositor/reflector_impl.h"
14 #include "content/browser/compositor/reflector_texture.h" 13 #include "content/browser/compositor/reflector_texture.h"
15 #include "content/browser/compositor/test/no_transport_image_transport_factory.h " 14 #include "content/browser/compositor/test/no_transport_image_transport_factory.h "
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 class ReflectorImplTest : public testing::Test { 111 class ReflectorImplTest : public testing::Test {
113 public: 112 public:
114 void SetUp() override { 113 void SetUp() override {
115 bool enable_pixel_output = false; 114 bool enable_pixel_output = false;
116 ui::ContextFactory* context_factory = 115 ui::ContextFactory* context_factory =
117 ui::InitializeContextFactoryForTests(enable_pixel_output); 116 ui::InitializeContextFactoryForTests(enable_pixel_output);
118 ImageTransportFactory::InitializeForUnitTests( 117 ImageTransportFactory::InitializeForUnitTests(
119 scoped_ptr<ImageTransportFactory>( 118 scoped_ptr<ImageTransportFactory>(
120 new NoTransportImageTransportFactory)); 119 new NoTransportImageTransportFactory));
121 message_loop_.reset(new base::MessageLoop()); 120 message_loop_.reset(new base::MessageLoop());
122 proxy_ = message_loop_->message_loop_proxy(); 121 task_runner_ = message_loop_->task_runner();
123 compositor_task_runner_ = new FakeTaskRunner(); 122 compositor_task_runner_ = new FakeTaskRunner();
124 compositor_.reset(new ui::Compositor(gfx::kNullAcceleratedWidget, 123 compositor_.reset(new ui::Compositor(gfx::kNullAcceleratedWidget,
125 context_factory, 124 context_factory,
126 compositor_task_runner_.get())); 125 compositor_task_runner_.get()));
127 context_provider_ = cc::TestContextProvider::Create( 126 context_provider_ = cc::TestContextProvider::Create(
128 cc::TestWebGraphicsContext3D::Create().Pass()); 127 cc::TestWebGraphicsContext3D::Create().Pass());
129 output_surface_ = 128 output_surface_ =
130 scoped_ptr<TestOutputSurface>( 129 scoped_ptr<TestOutputSurface>(
131 new TestOutputSurface(context_provider_, 130 new TestOutputSurface(context_provider_,
132 compositor_->vsync_manager())).Pass(); 131 compositor_->vsync_manager())).Pass();
(...skipping 26 matching lines...) Expand all
159 ImageTransportFactory::Terminate(); 158 ImageTransportFactory::Terminate();
160 } 159 }
161 160
162 void UpdateTexture() { reflector_->OnSourcePostSubBuffer(kSubRect); } 161 void UpdateTexture() { reflector_->OnSourcePostSubBuffer(kSubRect); }
163 162
164 protected: 163 protected:
165 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; 164 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
166 scoped_refptr<cc::ContextProvider> context_provider_; 165 scoped_refptr<cc::ContextProvider> context_provider_;
167 cc::FakeOutputSurfaceClient output_surface_client_; 166 cc::FakeOutputSurfaceClient output_surface_client_;
168 scoped_ptr<base::MessageLoop> message_loop_; 167 scoped_ptr<base::MessageLoop> message_loop_;
169 scoped_refptr<base::MessageLoopProxy> proxy_; 168 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
170 scoped_ptr<ui::Compositor> compositor_; 169 scoped_ptr<ui::Compositor> compositor_;
171 scoped_ptr<ui::Layer> root_layer_; 170 scoped_ptr<ui::Layer> root_layer_;
172 scoped_ptr<ui::Layer> mirroring_layer_; 171 scoped_ptr<ui::Layer> mirroring_layer_;
173 scoped_ptr<ReflectorImpl> reflector_; 172 scoped_ptr<ReflectorImpl> reflector_;
174 scoped_ptr<TestOutputSurface> output_surface_; 173 scoped_ptr<TestOutputSurface> output_surface_;
175 }; 174 };
176 175
177 namespace { 176 namespace {
178 TEST_F(ReflectorImplTest, CheckNormalOutputSurface) { 177 TEST_F(ReflectorImplTest, CheckNormalOutputSurface) {
179 output_surface_->SetFlip(false); 178 output_surface_->SetFlip(false);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 plane_2.plane_z_order = 1; 213 plane_2.plane_z_order = 1;
215 list.push_back(plane_1); 214 list.push_back(plane_1);
216 list.push_back(plane_2); 215 list.push_back(plane_2);
217 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list); 216 output_surface_->GetOverlayCandidateValidator()->CheckOverlaySupport(&list);
218 EXPECT_FALSE(list[0].overlay_handled); 217 EXPECT_FALSE(list[0].overlay_handled);
219 } 218 }
220 #endif // defined(USE_OZONE) 219 #endif // defined(USE_OZONE)
221 220
222 } // namespace 221 } // namespace
223 } // namespace content 222 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/reflector_impl.h ('k') | content/browser/compositor/software_browser_compositor_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698