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 "content/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "cc/output/begin_frame_args.h" | 10 #include "cc/output/begin_frame_args.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 render_widget_->SetCompositor(render_widget_compositor_.get()); | 244 render_widget_->SetCompositor(render_widget_compositor_.get()); |
245 } | 245 } |
246 | 246 |
247 void RunTest(bool use_null_output_surface, | 247 void RunTest(bool use_null_output_surface, |
248 int num_failures_before_success, | 248 int num_failures_before_success, |
249 int expected_successes, | 249 int expected_successes, |
250 int expected_fallback_succeses) { | 250 int expected_fallback_succeses) { |
251 render_widget_compositor_->SetUp( | 251 render_widget_compositor_->SetUp( |
252 use_null_output_surface, num_failures_before_success, | 252 use_null_output_surface, num_failures_before_success, |
253 expected_successes, expected_fallback_succeses); | 253 expected_successes, expected_fallback_succeses); |
254 render_widget_compositor_->StartCompositor(); | 254 render_widget_compositor_->setVisible(true); |
255 base::ThreadTaskRunnerHandle::Get()->PostTask( | 255 base::ThreadTaskRunnerHandle::Get()->PostTask( |
256 FROM_HERE, | 256 FROM_HERE, |
257 base::Bind(&RenderWidgetCompositorOutputSurface::SynchronousComposite, | 257 base::Bind(&RenderWidgetCompositorOutputSurface::SynchronousComposite, |
258 base::Unretained(render_widget_compositor_.get()))); | 258 base::Unretained(render_widget_compositor_.get()))); |
259 base::MessageLoop::current()->Run(); | 259 base::MessageLoop::current()->Run(); |
260 render_widget_compositor_->AfterTest(); | 260 render_widget_compositor_->AfterTest(); |
261 } | 261 } |
262 | 262 |
263 protected: | 263 protected: |
264 base::MessageLoop ye_olde_message_loope_; | 264 base::MessageLoop ye_olde_message_loope_; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 314 } |
315 | 315 |
316 TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessNormalSuccess) { | 316 TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessNormalSuccess) { |
317 // The first success is a fallback, but the next should not be a fallback. | 317 // The first success is a fallback, but the next should not be a fallback. |
318 RunTest(false, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK, | 318 RunTest(false, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK, |
319 1, 1); | 319 1, 1); |
320 } | 320 } |
321 | 321 |
322 } // namespace | 322 } // namespace |
323 } // namespace content | 323 } // namespace content |
OLD | NEW |