Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layer_tree_host.h" | 5 #include "cc/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "cc/content_layer.h" | 8 #include "cc/content_layer.h" |
| 9 #include "cc/delegated_renderer_layer.h" | 9 #include "cc/delegated_renderer_layer.h" |
| 10 #include "cc/delegated_renderer_layer_impl.h" | 10 #include "cc/delegated_renderer_layer_impl.h" |
| 11 #include "cc/heads_up_display_layer.h" | 11 #include "cc/heads_up_display_layer.h" |
| 12 #include "cc/io_surface_layer.h" | 12 #include "cc/io_surface_layer.h" |
| 13 #include "cc/layer_impl.h" | 13 #include "cc/layer_impl.h" |
| 14 #include "cc/layer_tree_host_impl.h" | 14 #include "cc/layer_tree_host_impl.h" |
| 15 #include "cc/layer_tree_impl.h" | 15 #include "cc/layer_tree_impl.h" |
| 16 #include "cc/picture_layer.h" | |
| 16 #include "cc/scrollbar_layer.h" | 17 #include "cc/scrollbar_layer.h" |
| 17 #include "cc/single_thread_proxy.h" | 18 #include "cc/single_thread_proxy.h" |
| 18 #include "cc/test/fake_content_layer.h" | 19 #include "cc/test/fake_content_layer.h" |
| 19 #include "cc/test/fake_content_layer_client.h" | 20 #include "cc/test/fake_content_layer_client.h" |
| 20 #include "cc/test/fake_content_layer_impl.h" | 21 #include "cc/test/fake_content_layer_impl.h" |
| 21 #include "cc/test/fake_output_surface.h" | 22 #include "cc/test/fake_output_surface.h" |
| 22 #include "cc/test/fake_scrollbar_theme_painter.h" | 23 #include "cc/test/fake_scrollbar_theme_painter.h" |
| 23 #include "cc/test/fake_video_frame_provider.h" | 24 #include "cc/test/fake_video_frame_provider.h" |
| 24 #include "cc/test/fake_web_graphics_context_3d.h" | 25 #include "cc/test/fake_web_graphics_context_3d.h" |
| 25 #include "cc/test/fake_web_scrollbar.h" | 26 #include "cc/test/fake_web_scrollbar.h" |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 805 | 806 |
| 806 virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE { | 807 virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE { |
| 807 EXPECT_FALSE(succeeded); | 808 EXPECT_FALSE(succeeded); |
| 808 // If we make it this far without crashing, we pass! | 809 // If we make it this far without crashing, we pass! |
| 809 endTest(); | 810 endTest(); |
| 810 } | 811 } |
| 811 }; | 812 }; |
| 812 | 813 |
| 813 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestFailsImmediately); | 814 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostContextTestFailsImmediately); |
| 814 | 815 |
| 816 class ImplSidePaintingLayerTreeHostContextTest | |
|
enne (OOO)
2013/01/15 22:35:41
How would this test fail before your patch?
I was
reveman
2013/01/15 23:16:26
The DCHECK(tiles_.size() == 0) in the tile manager
| |
| 817 : public LayerTreeHostContextTest { | |
| 818 public: | |
| 819 virtual void initializeSettings(LayerTreeSettings& settings) OVERRIDE { | |
| 820 settings.implSidePainting = true; | |
| 821 } | |
| 822 }; | |
| 823 | |
| 824 class LayerTreeHostContextTestImplSidePainting : | |
| 825 public ImplSidePaintingLayerTreeHostContextTest { | |
| 826 public: | |
| 827 virtual void setupTree() OVERRIDE { | |
| 828 scoped_refptr<Layer> root = Layer::create(); | |
| 829 root->setBounds(gfx::Size(10, 10)); | |
| 830 root->setAnchorPoint(gfx::PointF()); | |
| 831 root->setIsDrawable(true); | |
| 832 | |
| 833 scoped_refptr<PictureLayer> picture = PictureLayer::create(&client_); | |
| 834 picture->setBounds(gfx::Size(10, 10)); | |
| 835 picture->setAnchorPoint(gfx::PointF()); | |
| 836 picture->setIsDrawable(true); | |
| 837 root->addChild(picture); | |
| 838 | |
| 839 m_layerTreeHost->setRootLayer(root); | |
| 840 LayerTreeHostContextTest::setupTree(); | |
| 841 } | |
| 842 | |
| 843 virtual void beginTest() OVERRIDE { | |
| 844 times_to_lose_during_commit_ = 1; | |
| 845 postSetNeedsCommitToMainThread(); | |
| 846 } | |
| 847 | |
| 848 virtual void afterTest() OVERRIDE {} | |
| 849 | |
| 850 virtual void didRecreateOutputSurface(bool succeeded) OVERRIDE { | |
| 851 EXPECT_TRUE(succeeded); | |
| 852 endTest(); | |
| 853 } | |
| 854 | |
| 855 private: | |
| 856 FakeContentLayerClient client_; | |
| 857 }; | |
| 858 | |
| 859 MULTI_THREAD_TEST_F(LayerTreeHostContextTestImplSidePainting) | |
| 860 | |
| 815 } // namespace | 861 } // namespace |
| 816 } // namespace cc | 862 } // namespace cc |
| OLD | NEW |