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

Side by Side Diff: content/renderer/gpu/render_widget_compositor_unittest.cc

Issue 1149803002: cc: Make single-thread renderer compositor always synchronous. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: syncsinglethread: . Created 5 years, 7 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
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | content/renderer/render_thread_impl.h » ('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 "content/renderer/gpu/render_widget_compositor.h" 5 #include "content/renderer/gpu/render_widget_compositor.h"
6 6
7 #include "cc/output/begin_frame_args.h" 7 #include "cc/output/begin_frame_args.h"
8 #include "cc/test/failure_output_surface.h" 8 #include "cc/test/failure_output_surface.h"
9 #include "cc/trees/layer_tree_host.h" 9 #include "cc/trees/layer_tree_host.h"
10 #include "components/scheduler/renderer/renderer_scheduler.h" 10 #include "components/scheduler/renderer/renderer_scheduler.h"
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 bool use_null_output_surface_; 225 bool use_null_output_surface_;
226 226
227 DISALLOW_COPY_AND_ASSIGN(RenderWidgetCompositorOutputSurface); 227 DISALLOW_COPY_AND_ASSIGN(RenderWidgetCompositorOutputSurface);
228 }; 228 };
229 229
230 class RenderWidgetCompositorOutputSurfaceTest : public testing::Test { 230 class RenderWidgetCompositorOutputSurfaceTest : public testing::Test {
231 public: 231 public:
232 RenderWidgetCompositorOutputSurfaceTest() 232 RenderWidgetCompositorOutputSurfaceTest()
233 : render_widget_(make_scoped_refptr(new RenderWidgetOutputSurface)), 233 : render_widget_(make_scoped_refptr(new RenderWidgetOutputSurface)),
234 compositor_deps_(make_scoped_ptr(new FakeCompositorDependencies)) { 234 compositor_deps_(make_scoped_ptr(new FakeCompositorDependencies)) {
235 // Required in order to call the synchronous LayerTreeHost::Composite.
236 compositor_deps_->set_use_single_thread_scheduler(false);
237 render_widget_compositor_.reset(new RenderWidgetCompositorOutputSurface( 235 render_widget_compositor_.reset(new RenderWidgetCompositorOutputSurface(
238 render_widget_.get(), compositor_deps_.get())); 236 render_widget_.get(), compositor_deps_.get()));
239 render_widget_compositor_->Initialize(); 237 render_widget_compositor_->Initialize();
240 render_widget_->SetCompositor(render_widget_compositor_.get()); 238 render_widget_->SetCompositor(render_widget_compositor_.get());
241 } 239 }
242 240
243 void RunTest(bool use_null_output_surface, 241 void RunTest(bool use_null_output_surface,
244 int num_failures_before_success, 242 int num_failures_before_success,
245 int expected_successes, 243 int expected_successes,
246 int expected_fallback_succeses) { 244 int expected_fallback_succeses) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 308 }
311 309
312 TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessNormalSuccess) { 310 TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessNormalSuccess) {
313 // The first success is a fallback, but the next should not be a fallback. 311 // The first success is a fallback, but the next should not be a fallback.
314 RunTest(false, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK, 312 RunTest(false, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK,
315 1, 1); 313 1, 1);
316 } 314 }
317 315
318 } // namespace 316 } // namespace
319 } // namespace content 317 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698