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

Side by Side Diff: cc/delegating_renderer_unittest.cc

Issue 12211110: Implement WebKit::WebUnitTestSupport::createLayerTreeViewForTesting() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add enum, fix NON_EXPORTED_BASE Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « cc/delegated_renderer_layer_impl_unittest.cc ('k') | cc/fake_web_graphics_context_3d.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "cc/delegating_renderer.h" 5 #include "cc/delegating_renderer.h"
6 6
7 #include "cc/test/fake_output_surface.h" 7 #include "cc/test/fake_output_surface.h"
8 #include "cc/test/layer_tree_test_common.h" 8 #include "cc/test/layer_tree_test_common.h"
9 #include "cc/test/render_pass_test_common.h" 9 #include "cc/test/render_pass_test_common.h"
10 #include "cc/test/render_pass_test_utils.h" 10 #include "cc/test/render_pass_test_utils.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 class DelegatingRendererTest : public ThreadedTest { 15 class DelegatingRendererTest : public ThreadedTest {
16 public: 16 public:
17 DelegatingRendererTest() : ThreadedTest(), output_surface_(NULL) {} 17 DelegatingRendererTest() : ThreadedTest(), output_surface_(NULL) {}
18 virtual ~DelegatingRendererTest() {} 18 virtual ~DelegatingRendererTest() {}
19 19
20 virtual scoped_ptr<OutputSurface> createOutputSurface() OVERRIDE { 20 virtual scoped_ptr<OutputSurface> createOutputSurface() OVERRIDE {
21 scoped_ptr<FakeWebGraphicsContext3D> context3d = 21 scoped_ptr<TestWebGraphicsContext3D> context3d =
22 FakeWebGraphicsContext3D::Create( 22 TestWebGraphicsContext3D::Create(
23 WebKit::WebGraphicsContext3D::Attributes()); 23 WebKit::WebGraphicsContext3D::Attributes());
24 context3d_ = context3d.get(); 24 context3d_ = context3d.get();
25 scoped_ptr<FakeOutputSurface> output_surface = 25 scoped_ptr<FakeOutputSurface> output_surface =
26 FakeOutputSurface::CreateDelegating3d( 26 FakeOutputSurface::CreateDelegating3d(
27 context3d.PassAs<WebKit::WebGraphicsContext3D>()); 27 context3d.PassAs<WebKit::WebGraphicsContext3D>());
28 output_surface_ = output_surface.get(); 28 output_surface_ = output_surface.get();
29 return output_surface.PassAs<OutputSurface>(); 29 return output_surface.PassAs<OutputSurface>();
30 } 30 }
31 31
32 protected: 32 protected:
33 FakeWebGraphicsContext3D* context3d_; 33 TestWebGraphicsContext3D* context3d_;
34 FakeOutputSurface* output_surface_; 34 FakeOutputSurface* output_surface_;
35 }; 35 };
36 36
37 class DelegatingRendererTestDraw : public DelegatingRendererTest { 37 class DelegatingRendererTestDraw : public DelegatingRendererTest {
38 public: 38 public:
39 virtual void beginTest() OVERRIDE { 39 virtual void beginTest() OVERRIDE {
40 m_layerTreeHost->setPageScaleFactorAndLimits(1.f, 0.5f, 4.f); 40 m_layerTreeHost->setPageScaleFactorAndLimits(1.f, 0.5f, 4.f);
41 postSetNeedsCommitToMainThread(); 41 postSetNeedsCommitToMainThread();
42 } 42 }
43 43
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 EXPECT_EQ( 126 EXPECT_EQ(
127 15u, last_frame.delegated_frame_data->resource_list.resources.size()); 127 15u, last_frame.delegated_frame_data->resource_list.resources.size());
128 128
129 endTest(); 129 endTest();
130 } 130 }
131 }; 131 };
132 132
133 SINGLE_AND_MULTI_THREAD_TEST_F(DelegatingRendererTestResources) 133 SINGLE_AND_MULTI_THREAD_TEST_F(DelegatingRendererTestResources)
134 134
135 } // namespace cc 135 } // namespace cc
OLDNEW
« no previous file with comments | « cc/delegated_renderer_layer_impl_unittest.cc ('k') | cc/fake_web_graphics_context_3d.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698