Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/test/layer_tree_test_common.h" | 5 #include "cc/test/layer_tree_test_common.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "cc/active_animation.h" | 8 #include "cc/active_animation.h" |
| 9 #include "cc/content_layer.h" | 9 #include "cc/content_layer.h" |
| 10 #include "cc/font_atlas.h" | 10 #include "cc/font_atlas.h" |
| 11 #include "cc/input_handler.h" | 11 #include "cc/input_handler.h" |
| 12 #include "cc/layer.h" | 12 #include "cc/layer.h" |
| 13 #include "cc/layer_animation_controller.h" | 13 #include "cc/layer_animation_controller.h" |
| 14 #include "cc/layer_impl.h" | 14 #include "cc/layer_impl.h" |
| 15 #include "cc/layer_tree_host_impl.h" | 15 #include "cc/layer_tree_host_impl.h" |
| 16 #include "cc/scoped_thread_proxy.h" | 16 #include "cc/scoped_thread_proxy.h" |
| 17 #include "cc/single_thread_proxy.h" | 17 #include "cc/single_thread_proxy.h" |
| 18 #include "cc/thread_impl.h" | 18 #include "cc/thread_impl.h" |
| 19 #include "cc/test/animation_test_common.h" | 19 #include "cc/test/animation_test_common.h" |
| 20 #include "cc/test/fake_web_compositor_output_surface.h" | 20 #include "cc/test/fake_output_surface.h" |
| 21 #include "cc/test/fake_web_graphics_context_3d.h" | 21 #include "cc/test/fake_web_graphics_context_3d.h" |
| 22 #include "cc/test/occlusion_tracker_test_common.h" | 22 #include "cc/test/occlusion_tracker_test_common.h" |
| 23 #include "cc/test/tiled_layer_test_common.h" | 23 #include "cc/test/tiled_layer_test_common.h" |
| 24 #include "cc/timing_function.h" | 24 #include "cc/timing_function.h" |
| 25 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
| 26 #include <public/WebFilterOperation.h> | 26 #include <public/WebFilterOperation.h> |
| 27 #include <public/WebFilterOperations.h> | 27 #include <public/WebFilterOperations.h> |
| 28 | 28 |
| 29 using cc::FontAtlas; | 29 using cc::FontAtlas; |
| 30 using cc::InputHandler; | 30 using cc::InputHandler; |
| 31 using cc::Layer; | 31 using cc::Layer; |
| 32 using cc::LayerTreeHostImplClient; | 32 using cc::LayerTreeHostImplClient; |
| 33 using cc::LayerTreeSettings; | 33 using cc::LayerTreeSettings; |
| 34 using cc::Proxy; | 34 using cc::Proxy; |
| 35 using cc::ScopedThreadProxy; | 35 using cc::ScopedThreadProxy; |
| 36 | 36 |
| 37 using namespace WebKit; | 37 using namespace WebKit; |
| 38 using namespace WebKitTests; | |
|
jamesr
2012/12/04 07:06:51
can you using the specific types instead of the wh
danakj
2012/12/04 18:15:34
I moved the animation test stuff to cc:: so this c
| |
| 38 | 39 |
| 39 namespace WebKitTests { | 40 namespace cc { |
| 40 | 41 |
| 41 scoped_ptr<CompositorFakeWebGraphicsContext3DWithTextureTracking> CompositorFake WebGraphicsContext3DWithTextureTracking::create(Attributes attrs) | 42 scoped_ptr<CompositorFakeWebGraphicsContext3DWithTextureTracking> CompositorFake WebGraphicsContext3DWithTextureTracking::create(Attributes attrs) |
| 42 { | 43 { |
| 43 return make_scoped_ptr(new CompositorFakeWebGraphicsContext3DWithTextureTrac king(attrs)); | 44 return make_scoped_ptr(new CompositorFakeWebGraphicsContext3DWithTextureTrac king(attrs)); |
| 44 } | 45 } |
| 45 | 46 |
| 46 WebGLId CompositorFakeWebGraphicsContext3DWithTextureTracking::createTexture() | 47 WebGLId CompositorFakeWebGraphicsContext3DWithTextureTracking::createTexture() |
| 47 { | 48 { |
| 48 WebGLId texture = m_textures.size() + 1; | 49 WebGLId texture = m_textures.size() + 1; |
| 49 m_textures.push_back(texture); | 50 m_textures.push_back(texture); |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 80 | 81 |
| 81 CompositorFakeWebGraphicsContext3DWithTextureTracking::~CompositorFakeWebGraphic sContext3DWithTextureTracking() | 82 CompositorFakeWebGraphicsContext3DWithTextureTracking::~CompositorFakeWebGraphic sContext3DWithTextureTracking() |
| 82 { | 83 { |
| 83 } | 84 } |
| 84 | 85 |
| 85 bool TestHooks::prepareToDrawOnThread(cc::LayerTreeHostImpl*) | 86 bool TestHooks::prepareToDrawOnThread(cc::LayerTreeHostImpl*) |
| 86 { | 87 { |
| 87 return true; | 88 return true; |
| 88 } | 89 } |
| 89 | 90 |
| 90 scoped_ptr<WebCompositorOutputSurface> TestHooks::createOutputSurface() | 91 scoped_ptr<OutputSurface> TestHooks::createOutputSurface() |
| 91 { | 92 { |
| 92 return FakeWebCompositorOutputSurface::create(CompositorFakeWebGraphicsConte xt3DWithTextureTracking::create(WebGraphicsContext3D::Attributes()).PassAs<WebKi t::WebGraphicsContext3D>()).PassAs<WebKit::WebCompositorOutputSurface>(); | 93 return FakeOutputSurface::Create(CompositorFakeWebGraphicsContext3DWithTextu reTracking::create(WebGraphicsContext3D::Attributes()).PassAs<WebKit::WebGraphic sContext3D>()).PassAs<OutputSurface>(); |
| 93 } | 94 } |
| 94 | 95 |
| 95 scoped_ptr<MockLayerTreeHostImpl> MockLayerTreeHostImpl::create(TestHooks* testH ooks, const LayerTreeSettings& settings, LayerTreeHostImplClient* client, Proxy* proxy) | 96 scoped_ptr<MockLayerTreeHostImpl> MockLayerTreeHostImpl::create(TestHooks* testH ooks, const LayerTreeSettings& settings, LayerTreeHostImplClient* client, Proxy* proxy) |
| 96 { | 97 { |
| 97 return make_scoped_ptr(new MockLayerTreeHostImpl(testHooks, settings, client , proxy)); | 98 return make_scoped_ptr(new MockLayerTreeHostImpl(testHooks, settings, client , proxy)); |
| 98 } | 99 } |
| 99 | 100 |
| 100 void MockLayerTreeHostImpl::beginCommit() | 101 void MockLayerTreeHostImpl::beginCommit() |
| 101 { | 102 { |
| 102 LayerTreeHostImpl::beginCommit(); | 103 LayerTreeHostImpl::beginCommit(); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 virtual void layout() OVERRIDE | 221 virtual void layout() OVERRIDE |
| 221 { | 222 { |
| 222 m_testHooks->layout(); | 223 m_testHooks->layout(); |
| 223 } | 224 } |
| 224 | 225 |
| 225 virtual void applyScrollAndScale(gfx::Vector2d scrollDelta, float scale) OVERR IDE | 226 virtual void applyScrollAndScale(gfx::Vector2d scrollDelta, float scale) OVERR IDE |
| 226 { | 227 { |
| 227 m_testHooks->applyScrollAndScale(scrollDelta, scale); | 228 m_testHooks->applyScrollAndScale(scrollDelta, scale); |
| 228 } | 229 } |
| 229 | 230 |
| 230 virtual scoped_ptr<WebCompositorOutputSurface> createOutputSurface() OVERRID E | 231 virtual scoped_ptr<OutputSurface> createOutputSurface() OVERRIDE |
| 231 { | 232 { |
| 232 return m_testHooks->createOutputSurface(); | 233 return m_testHooks->createOutputSurface(); |
| 233 } | 234 } |
| 234 | 235 |
| 235 virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE | 236 virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE |
| 236 { | 237 { |
| 237 m_testHooks->didRecreateOutputSurface(succeeded); | 238 m_testHooks->didRecreateOutputSurface(succeeded); |
| 238 } | 239 } |
| 239 | 240 |
| 240 virtual scoped_ptr<InputHandler> createInputHandler() OVERRIDE | 241 virtual scoped_ptr<InputHandler> createInputHandler() OVERRIDE |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 530 | 531 |
| 531 ASSERT_FALSE(m_layerTreeHost.get()); | 532 ASSERT_FALSE(m_layerTreeHost.get()); |
| 532 m_client.reset(); | 533 m_client.reset(); |
| 533 if (m_timedOut) { | 534 if (m_timedOut) { |
| 534 FAIL() << "Test timed out"; | 535 FAIL() << "Test timed out"; |
| 535 return; | 536 return; |
| 536 } | 537 } |
| 537 afterTest(); | 538 afterTest(); |
| 538 } | 539 } |
| 539 | 540 |
| 540 } // namespace WebKitTests | 541 } // namespace cc |
| OLD | NEW |