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 "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 "content/public/test/mock_render_thread.h" | 10 #include "content/public/test/mock_render_thread.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 class RenderWidgetCompositorOutputSurface; | 87 class RenderWidgetCompositorOutputSurface; |
88 | 88 |
89 class RenderWidgetOutputSurface : public TestRenderWidget { | 89 class RenderWidgetOutputSurface : public TestRenderWidget { |
90 public: | 90 public: |
91 RenderWidgetOutputSurface() : compositor_(NULL) {} | 91 RenderWidgetOutputSurface() : compositor_(NULL) {} |
92 void SetCompositor(RenderWidgetCompositorOutputSurface* compositor); | 92 void SetCompositor(RenderWidgetCompositorOutputSurface* compositor); |
93 | 93 |
94 scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) override; | 94 scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback) override; |
95 | 95 |
96 protected: | 96 protected: |
97 ~RenderWidgetOutputSurface() {} | 97 ~RenderWidgetOutputSurface() override {} |
98 | 98 |
99 private: | 99 private: |
100 RenderWidgetCompositorOutputSurface* compositor_; | 100 RenderWidgetCompositorOutputSurface* compositor_; |
101 | 101 |
102 DISALLOW_COPY_AND_ASSIGN(RenderWidgetOutputSurface); | 102 DISALLOW_COPY_AND_ASSIGN(RenderWidgetOutputSurface); |
103 }; | 103 }; |
104 | 104 |
105 // Verify that failing to create an output surface will cause the compositor | 105 // Verify that failing to create an output surface will cause the compositor |
106 // to attempt to repeatedly create another output surface. After enough | 106 // to attempt to repeatedly create another output surface. After enough |
107 // failures, verify that it attempts to create a fallback output surface. | 107 // failures, verify that it attempts to create a fallback output surface. |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } | 290 } |
291 | 291 |
292 TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessNormalSuccess) { | 292 TEST_F(RenderWidgetCompositorOutputSurfaceTest, FallbackSuccessNormalSuccess) { |
293 // The first success is a fallback, but the next should not be a fallback. | 293 // The first success is a fallback, but the next should not be a fallback. |
294 RunTest(false, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK, | 294 RunTest(false, RenderWidgetCompositor::OUTPUT_SURFACE_RETRIES_BEFORE_FALLBACK, |
295 1, 1); | 295 1, 1); |
296 } | 296 } |
297 | 297 |
298 } // namespace | 298 } // namespace |
299 } // namespace content | 299 } // namespace content |
OLD | NEW |