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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2456093003: Enable more layer_tree_host_unittest for LayerTreeHostRemote. (Closed)
Patch Set: PushPropertiesCountingLayer refactored for remote test. Created 4 years, 1 month 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
OLDNEW
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/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 29 matching lines...) Expand all
40 #include "cc/test/fake_painted_scrollbar_layer.h" 40 #include "cc/test/fake_painted_scrollbar_layer.h"
41 #include "cc/test/fake_picture_layer.h" 41 #include "cc/test/fake_picture_layer.h"
42 #include "cc/test/fake_picture_layer_impl.h" 42 #include "cc/test/fake_picture_layer_impl.h"
43 #include "cc/test/fake_proxy.h" 43 #include "cc/test/fake_proxy.h"
44 #include "cc/test/fake_recording_source.h" 44 #include "cc/test/fake_recording_source.h"
45 #include "cc/test/fake_scoped_ui_resource.h" 45 #include "cc/test/fake_scoped_ui_resource.h"
46 #include "cc/test/fake_video_frame_provider.h" 46 #include "cc/test/fake_video_frame_provider.h"
47 #include "cc/test/geometry_test_utils.h" 47 #include "cc/test/geometry_test_utils.h"
48 #include "cc/test/layer_internals_for_test.h" 48 #include "cc/test/layer_internals_for_test.h"
49 #include "cc/test/layer_tree_test.h" 49 #include "cc/test/layer_tree_test.h"
50 #include "cc/test/push_properties_counting_layer.h"
51 #include "cc/test/push_properties_counting_layer_impl.h"
50 #include "cc/test/render_pass_test_utils.h" 52 #include "cc/test/render_pass_test_utils.h"
51 #include "cc/test/skia_common.h" 53 #include "cc/test/skia_common.h"
52 #include "cc/test/test_compositor_frame_sink.h" 54 #include "cc/test/test_compositor_frame_sink.h"
53 #include "cc/test/test_shared_bitmap_manager.h" 55 #include "cc/test/test_shared_bitmap_manager.h"
54 #include "cc/test/test_web_graphics_context_3d.h" 56 #include "cc/test/test_web_graphics_context_3d.h"
55 #include "cc/trees/effect_node.h" 57 #include "cc/trees/effect_node.h"
56 #include "cc/trees/layer_tree_host_common.h" 58 #include "cc/trees/layer_tree_host_common.h"
57 #include "cc/trees/layer_tree_host_impl.h" 59 #include "cc/trees/layer_tree_host_impl.h"
58 #include "cc/trees/layer_tree_impl.h" 60 #include "cc/trees/layer_tree_impl.h"
59 #include "cc/trees/single_thread_proxy.h" 61 #include "cc/trees/single_thread_proxy.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 EXPECT_TRUE(all_tiles_required_for_activation_are_ready_to_draw_); 282 EXPECT_TRUE(all_tiles_required_for_activation_are_ready_to_draw_);
281 EXPECT_LE(size_t(1), required_for_activation_count_); 283 EXPECT_LE(size_t(1), required_for_activation_count_);
282 } 284 }
283 285
284 private: 286 private:
285 FakeContentLayerClient client_; 287 FakeContentLayerClient client_;
286 }; 288 };
287 289
288 // No single thread test because the commit goes directly to the active tree in 290 // No single thread test because the commit goes directly to the active tree in
289 // single thread mode, so notify ready to activate is skipped. 291 // single thread mode, so notify ready to activate is skipped.
290 // No remote test because we currently don't deserialize FakePictureLayer, 292 REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestReadyToActivateNonEmpty);
291 // so on the impl side, PictureLayerImpl is created instead of
292 // FakePictureLayerImpl, see crbug/657871.
293 MULTI_THREAD_TEST_F(LayerTreeHostTestReadyToActivateNonEmpty);
294 293
295 // Test if the LTHI receives ReadyToDraw notifications from the TileManager when 294 // Test if the LTHI receives ReadyToDraw notifications from the TileManager when
296 // no raster tasks get scheduled. 295 // no raster tasks get scheduled.
297 class LayerTreeHostTestReadyToDrawEmpty : public LayerTreeHostTest { 296 class LayerTreeHostTestReadyToDrawEmpty : public LayerTreeHostTest {
298 public: 297 public:
299 LayerTreeHostTestReadyToDrawEmpty() 298 LayerTreeHostTestReadyToDrawEmpty()
300 : did_notify_ready_to_draw_(false), 299 : did_notify_ready_to_draw_(false),
301 all_tiles_required_for_draw_are_ready_to_draw_(false), 300 all_tiles_required_for_draw_are_ready_to_draw_(false),
302 required_for_draw_count_(0) {} 301 required_for_draw_count_(0) {}
303 302
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1617 private: 1616 private:
1618 int num_draws_; 1617 int num_draws_;
1619 const gfx::Size bounds_; 1618 const gfx::Size bounds_;
1620 const gfx::Rect invalid_rect_; 1619 const gfx::Rect invalid_rect_;
1621 FakeContentLayerClient client_; 1620 FakeContentLayerClient client_;
1622 scoped_refptr<FakePictureLayer> root_layer_; 1621 scoped_refptr<FakePictureLayer> root_layer_;
1623 }; 1622 };
1624 1623
1625 // As there's no pending tree in single-threaded case, this test should run 1624 // As there's no pending tree in single-threaded case, this test should run
1626 // only for multi-threaded case. 1625 // only for multi-threaded case.
1627 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterDeviceSizeChanged); 1626 REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterDeviceSizeChanged);
1628 1627
1629 class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest { 1628 class LayerTreeHostTestNoExtraCommitFromInvalidate : public LayerTreeHostTest {
1630 public: 1629 public:
1631 void InitializeSettings(LayerTreeSettings* settings) override { 1630 void InitializeSettings(LayerTreeSettings* settings) override {
1632 settings->layer_transforms_should_scale_layer_contents = true; 1631 settings->layer_transforms_should_scale_layer_contents = true;
1633 } 1632 }
1634 1633
1635 void SetupTree() override { 1634 void SetupTree() override {
1636 root_layer_ = Layer::Create(); 1635 root_layer_ = Layer::Create();
1637 root_layer_->SetBounds(gfx::Size(10, 20)); 1636 root_layer_->SetBounds(gfx::Size(10, 20));
(...skipping 29 matching lines...) Expand all
1667 void AfterTest() override { 1666 void AfterTest() override {
1668 EXPECT_EQ(gfx::Size(4, 4).ToString(), scaled_layer_->bounds().ToString()); 1667 EXPECT_EQ(gfx::Size(4, 4).ToString(), scaled_layer_->bounds().ToString());
1669 } 1668 }
1670 1669
1671 private: 1670 private:
1672 FakeContentLayerClient client_; 1671 FakeContentLayerClient client_;
1673 scoped_refptr<Layer> root_layer_; 1672 scoped_refptr<Layer> root_layer_;
1674 scoped_refptr<Layer> scaled_layer_; 1673 scoped_refptr<Layer> scaled_layer_;
1675 }; 1674 };
1676 1675
1677 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNoExtraCommitFromInvalidate); 1676 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestNoExtraCommitFromInvalidate);
1678 1677
1679 class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate 1678 class LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate
1680 : public LayerTreeHostTest { 1679 : public LayerTreeHostTest {
1681 public: 1680 public:
1682 void InitializeSettings(LayerTreeSettings* settings) override { 1681 void InitializeSettings(LayerTreeSettings* settings) override {
1683 settings->layer_transforms_should_scale_layer_contents = true; 1682 settings->layer_transforms_should_scale_layer_contents = true;
1684 } 1683 }
1685 1684
1686 void SetupTree() override { 1685 void SetupTree() override {
1687 root_layer_ = Layer::Create(); 1686 root_layer_ = Layer::Create();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1724 } 1723 }
1725 1724
1726 void AfterTest() override {} 1725 void AfterTest() override {}
1727 1726
1728 private: 1727 private:
1729 FakeContentLayerClient client_; 1728 FakeContentLayerClient client_;
1730 scoped_refptr<Layer> root_layer_; 1729 scoped_refptr<Layer> root_layer_;
1731 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_; 1730 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_;
1732 }; 1731 };
1733 1732
1733 // No remote test here because PaintedScrollbarLayer is not supported by LTH
1734 // remote.
1734 SINGLE_AND_MULTI_THREAD_TEST_F( 1735 SINGLE_AND_MULTI_THREAD_TEST_F(
1735 LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate); 1736 LayerTreeHostTestNoExtraCommitFromScrollbarInvalidate);
1736 1737
1737 class LayerTreeHostTestDeviceScaleFactorChange : public LayerTreeHostTest { 1738 class LayerTreeHostTestDeviceScaleFactorChange : public LayerTreeHostTest {
1738 public: 1739 public:
1739 void InitializeSettings(LayerTreeSettings* settings) override { 1740 void InitializeSettings(LayerTreeSettings* settings) override {
1740 settings->layer_transforms_should_scale_layer_contents = true; 1741 settings->layer_transforms_should_scale_layer_contents = true;
1741 } 1742 }
1742 1743
1743 void SetupTree() override { 1744 void SetupTree() override {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1791 } 1792 }
1792 1793
1793 void AfterTest() override {} 1794 void AfterTest() override {}
1794 1795
1795 private: 1796 private:
1796 FakeContentLayerClient client_; 1797 FakeContentLayerClient client_;
1797 scoped_refptr<Layer> root_layer_; 1798 scoped_refptr<Layer> root_layer_;
1798 scoped_refptr<Layer> child_layer_; 1799 scoped_refptr<Layer> child_layer_;
1799 }; 1800 };
1800 1801
1801 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorChange); 1802 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestDeviceScaleFactorChange);
1802 1803
1803 class LayerTreeHostTestDeviceColorSpaceChange : public LayerTreeHostTest { 1804 class LayerTreeHostTestDeviceColorSpaceChange : public LayerTreeHostTest {
1804 public: 1805 public:
1805 void SetupTree() override { 1806 void SetupTree() override {
1806 space1_ = gfx::ColorSpace::CreateXYZD50(); 1807 space1_ = gfx::ColorSpace::CreateXYZD50();
1807 space2_ = gfx::ColorSpace::CreateSRGB(); 1808 space2_ = gfx::ColorSpace::CreateSRGB();
1808 1809
1809 root_layer_ = Layer::Create(); 1810 root_layer_ = Layer::Create();
1810 root_layer_->SetBounds(gfx::Size(10, 20)); 1811 root_layer_->SetBounds(gfx::Size(10, 20));
1811 1812
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 void AfterTest() override {} 1915 void AfterTest() override {}
1915 1916
1916 private: 1917 private:
1917 gfx::ColorSpace space1_; 1918 gfx::ColorSpace space1_;
1918 gfx::ColorSpace space2_; 1919 gfx::ColorSpace space2_;
1919 FakeContentLayerClient client_; 1920 FakeContentLayerClient client_;
1920 scoped_refptr<Layer> root_layer_; 1921 scoped_refptr<Layer> root_layer_;
1921 scoped_refptr<Layer> child_layer_; 1922 scoped_refptr<Layer> child_layer_;
1922 }; 1923 };
1923 1924
1925 // No remote test because LTH remote doesn't serialize device_color_space, so
1926 // LTH in process will always use the default color space here.
1927 // see crbug/658786.
1924 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceColorSpaceChange); 1928 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceColorSpaceChange);
1925 1929
1926 class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest { 1930 class LayerTreeHostTestSetNextCommitForcesRedraw : public LayerTreeHostTest {
1927 public: 1931 public:
1928 LayerTreeHostTestSetNextCommitForcesRedraw() 1932 LayerTreeHostTestSetNextCommitForcesRedraw()
1929 : num_draws_(0), bounds_(50, 50), invalid_rect_(10, 10, 20, 20) {} 1933 : num_draws_(0), bounds_(50, 50), invalid_rect_(10, 10, 20, 20) {}
1930 1934
1931 void BeginTest() override { 1935 void BeginTest() override {
1932 root_layer_ = FakePictureLayer::Create(&client_); 1936 root_layer_ = FakePictureLayer::Create(&client_);
1933 root_layer_->SetIsDrawable(true); 1937 root_layer_->SetIsDrawable(true);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 private: 2008 private:
2005 int num_draws_; 2009 int num_draws_;
2006 const gfx::Size bounds_; 2010 const gfx::Size bounds_;
2007 const gfx::Rect invalid_rect_; 2011 const gfx::Rect invalid_rect_;
2008 FakeContentLayerClient client_; 2012 FakeContentLayerClient client_;
2009 scoped_refptr<FakePictureLayer> root_layer_; 2013 scoped_refptr<FakePictureLayer> root_layer_;
2010 }; 2014 };
2011 2015
2012 // This test blocks activation which is not supported for single thread mode. 2016 // This test blocks activation which is not supported for single thread mode.
2013 MULTI_THREAD_BLOCKNOTIFY_TEST_F(LayerTreeHostTestSetNextCommitForcesRedraw); 2017 MULTI_THREAD_BLOCKNOTIFY_TEST_F(LayerTreeHostTestSetNextCommitForcesRedraw);
2018 REMOTE_TEST_F(LayerTreeHostTestSetNextCommitForcesRedraw);
2014 2019
2015 // Tests that if a layer is not drawn because of some reason in the parent then 2020 // Tests that if a layer is not drawn because of some reason in the parent then
2016 // its damage is preserved until the next time it is drawn. 2021 // its damage is preserved until the next time it is drawn.
2017 class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest { 2022 class LayerTreeHostTestUndrawnLayersDamageLater : public LayerTreeHostTest {
2018 public: 2023 public:
2019 void InitializeSettings(LayerTreeSettings* settings) override { 2024 void InitializeSettings(LayerTreeSettings* settings) override {
2020 // If we don't set the minimum contents scale, it's harder to verify whether 2025 // If we don't set the minimum contents scale, it's harder to verify whether
2021 // the damage we get is correct. For other scale amounts, please see 2026 // the damage we get is correct. For other scale amounts, please see
2022 // LayerTreeHostTestDamageWithScale. 2027 // LayerTreeHostTestDamageWithScale.
2023 settings->minimum_contents_scale = 1.f; 2028 settings->minimum_contents_scale = 1.f;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 2105
2101 void AfterTest() override {} 2106 void AfterTest() override {}
2102 2107
2103 private: 2108 private:
2104 FakeContentLayerClient client_; 2109 FakeContentLayerClient client_;
2105 scoped_refptr<FakePictureLayer> root_layer_; 2110 scoped_refptr<FakePictureLayer> root_layer_;
2106 scoped_refptr<FakePictureLayer> parent_layer_; 2111 scoped_refptr<FakePictureLayer> parent_layer_;
2107 scoped_refptr<FakePictureLayer> child_layer_; 2112 scoped_refptr<FakePictureLayer> child_layer_;
2108 }; 2113 };
2109 2114
2110 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestUndrawnLayersDamageLater); 2115 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestUndrawnLayersDamageLater);
2111 2116
2112 // Tests that if a layer is not drawn because of some reason in the parent then 2117 // Tests that if a layer is not drawn because of some reason in the parent then
2113 // its damage is preserved until the next time it is drawn. 2118 // its damage is preserved until the next time it is drawn.
2114 class LayerTreeHostTestDamageWithScale : public LayerTreeHostTest { 2119 class LayerTreeHostTestDamageWithScale : public LayerTreeHostTest {
2115 public: 2120 public:
2116 LayerTreeHostTestDamageWithScale() {} 2121 LayerTreeHostTestDamageWithScale() {}
2117 2122
2118 void SetupTree() override { 2123 void SetupTree() override {
2119 client_.set_fill_with_nonsolid_color(true); 2124 client_.set_fill_with_nonsolid_color(true);
2120 2125
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 } 2210 }
2206 2211
2207 void AfterTest() override {} 2212 void AfterTest() override {}
2208 2213
2209 private: 2214 private:
2210 FakeContentLayerClient client_; 2215 FakeContentLayerClient client_;
2211 scoped_refptr<Layer> root_layer_; 2216 scoped_refptr<Layer> root_layer_;
2212 scoped_refptr<Layer> child_layer_; 2217 scoped_refptr<Layer> child_layer_;
2213 }; 2218 };
2214 2219
2215 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDamageWithScale); 2220 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestDamageWithScale);
2216 2221
2217 // This test verifies that properties on the layer tree host are commited 2222 // This test verifies that properties on the layer tree host are commited
2218 // to the impl side. 2223 // to the impl side.
2219 class LayerTreeHostTestCommit : public LayerTreeHostTest { 2224 class LayerTreeHostTestCommit : public LayerTreeHostTest {
2220 public: 2225 public:
2221 LayerTreeHostTestCommit() {} 2226 LayerTreeHostTestCommit() {}
2222 2227
2223 void BeginTest() override { 2228 void BeginTest() override {
2224 layer_tree()->SetViewportSize(gfx::Size(20, 20)); 2229 layer_tree()->SetViewportSize(gfx::Size(20, 20));
2225 layer_tree()->set_background_color(SK_ColorGRAY); 2230 layer_tree()->set_background_color(SK_ColorGRAY);
(...skipping 23 matching lines...) Expand all
2249 impl->active_tree()->event_listener_properties( 2254 impl->active_tree()->event_listener_properties(
2250 EventListenerClass::kTouchEndOrCancel)); 2255 EventListenerClass::kTouchEndOrCancel));
2251 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers()); 2256 EXPECT_TRUE(impl->active_tree()->have_scroll_event_handlers());
2252 2257
2253 EndTest(); 2258 EndTest();
2254 } 2259 }
2255 2260
2256 void AfterTest() override {} 2261 void AfterTest() override {}
2257 }; 2262 };
2258 2263
2259 MULTI_THREAD_TEST_F(LayerTreeHostTestCommit); 2264 REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestCommit);
2260 2265
2261 // This test verifies that LayerTreeHostImpl's current frame time gets 2266 // This test verifies that LayerTreeHostImpl's current frame time gets
2262 // updated in consecutive frames when it doesn't draw due to tree 2267 // updated in consecutive frames when it doesn't draw due to tree
2263 // activation failure. 2268 // activation failure.
2264 class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails 2269 class LayerTreeHostTestFrameTimeUpdatesAfterActivationFails
2265 : public LayerTreeHostTest { 2270 : public LayerTreeHostTest {
2266 public: 2271 public:
2267 LayerTreeHostTestFrameTimeUpdatesAfterActivationFails() 2272 LayerTreeHostTestFrameTimeUpdatesAfterActivationFails()
2268 : frame_count_with_pending_tree_(0) {} 2273 : frame_count_with_pending_tree_(0) {}
2269 2274
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 void AfterTest() override {} 2312 void AfterTest() override {}
2308 2313
2309 private: 2314 private:
2310 int frame_count_with_pending_tree_; 2315 int frame_count_with_pending_tree_;
2311 base::TimeTicks first_frame_time_; 2316 base::TimeTicks first_frame_time_;
2312 }; 2317 };
2313 2318
2314 // This test blocks activation which is not supported for single thread mode. 2319 // This test blocks activation which is not supported for single thread mode.
2315 MULTI_THREAD_BLOCKNOTIFY_TEST_F( 2320 MULTI_THREAD_BLOCKNOTIFY_TEST_F(
2316 LayerTreeHostTestFrameTimeUpdatesAfterActivationFails); 2321 LayerTreeHostTestFrameTimeUpdatesAfterActivationFails);
2322 REMOTE_TEST_F(LayerTreeHostTestFrameTimeUpdatesAfterActivationFails);
2317 2323
2318 // This test verifies that LayerTreeHostImpl's current frame time gets 2324 // This test verifies that LayerTreeHostImpl's current frame time gets
2319 // updated in consecutive frames when it draws in each frame. 2325 // updated in consecutive frames when it draws in each frame.
2320 class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest { 2326 class LayerTreeHostTestFrameTimeUpdatesAfterDraw : public LayerTreeHostTest {
2321 public: 2327 public:
2322 LayerTreeHostTestFrameTimeUpdatesAfterDraw() : frame_(0) {} 2328 LayerTreeHostTestFrameTimeUpdatesAfterDraw() : frame_(0) {}
2323 2329
2324 void BeginTest() override { 2330 void BeginTest() override {
2325 layer_tree()->SetViewportSize(gfx::Size(20, 20)); 2331 layer_tree()->SetViewportSize(gfx::Size(20, 20));
2326 layer_tree()->set_background_color(SK_ColorGRAY); 2332 layer_tree()->set_background_color(SK_ColorGRAY);
(...skipping 28 matching lines...) Expand all
2355 EXPECT_EQ(0, frame_); 2361 EXPECT_EQ(0, frame_);
2356 } 2362 }
2357 2363
2358 void AfterTest() override {} 2364 void AfterTest() override {}
2359 2365
2360 private: 2366 private:
2361 int frame_; 2367 int frame_;
2362 base::TimeTicks first_frame_time_; 2368 base::TimeTicks first_frame_time_;
2363 }; 2369 };
2364 2370
2365 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestFrameTimeUpdatesAfterDraw); 2371 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestFrameTimeUpdatesAfterDraw);
2366 2372
2367 // Verifies that StartPageScaleAnimation events propagate correctly 2373 // Verifies that StartPageScaleAnimation events propagate correctly
2368 // from LayerTreeHost to LayerTreeHostImpl in the MT compositor. 2374 // from LayerTreeHost to LayerTreeHostImpl in the MT compositor.
2369 class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest { 2375 class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest {
2370 public: 2376 public:
2371 LayerTreeHostTestStartPageScaleAnimation() {} 2377 LayerTreeHostTestStartPageScaleAnimation() {}
2372 2378
2373 void SetupTree() override { 2379 void SetupTree() override {
2374 LayerTreeHostTest::SetupTree(); 2380 LayerTreeHostTest::SetupTree();
2375 2381
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2433 } 2439 }
2434 } 2440 }
2435 2441
2436 void AfterTest() override {} 2442 void AfterTest() override {}
2437 2443
2438 FakeContentLayerClient client_; 2444 FakeContentLayerClient client_;
2439 scoped_refptr<Layer> scroll_layer_; 2445 scoped_refptr<Layer> scroll_layer_;
2440 }; 2446 };
2441 2447
2442 // Single thread proxy does not support impl-side page scale changes. 2448 // Single thread proxy does not support impl-side page scale changes.
2449 // Remote test does not support page scale animation.
2443 MULTI_THREAD_TEST_F(LayerTreeHostTestStartPageScaleAnimation); 2450 MULTI_THREAD_TEST_F(LayerTreeHostTestStartPageScaleAnimation);
2444 2451
2445 class LayerTreeHostTestSetVisible : public LayerTreeHostTest { 2452 class LayerTreeHostTestSetVisible : public LayerTreeHostTest {
2446 public: 2453 public:
2447 LayerTreeHostTestSetVisible() : num_draws_(0) {} 2454 LayerTreeHostTestSetVisible() : num_draws_(0) {}
2448 2455
2449 void BeginTest() override { 2456 void BeginTest() override {
2450 PostSetNeedsCommitToMainThread(); 2457 PostSetNeedsCommitToMainThread();
2451 } 2458 }
2452 2459
(...skipping 10 matching lines...) Expand all
2463 ++num_draws_; 2470 ++num_draws_;
2464 EndTest(); 2471 EndTest();
2465 } 2472 }
2466 2473
2467 void AfterTest() override { EXPECT_EQ(1, num_draws_); } 2474 void AfterTest() override { EXPECT_EQ(1, num_draws_); }
2468 2475
2469 private: 2476 private:
2470 int num_draws_; 2477 int num_draws_;
2471 }; 2478 };
2472 2479
2473 MULTI_THREAD_TEST_F(LayerTreeHostTestSetVisible); 2480 REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetVisible);
2474 2481
2475 class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers 2482 class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers
2476 : public LayerTreeHostTest { 2483 : public LayerTreeHostTest {
2477 public: 2484 public:
2478 LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers() {} 2485 LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers() {}
2479 2486
2480 void BeginTest() override { 2487 void BeginTest() override {
2481 client_.set_fill_with_nonsolid_color(true); 2488 client_.set_fill_with_nonsolid_color(true);
2482 root_layer_ = FakePictureLayer::Create(&client_); 2489 root_layer_ = FakePictureLayer::Create(&client_);
2483 child_layer_ = FakePictureLayer::Create(&client_); 2490 child_layer_ = FakePictureLayer::Create(&client_);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
2565 } 2572 }
2566 2573
2567 void AfterTest() override {} 2574 void AfterTest() override {}
2568 2575
2569 private: 2576 private:
2570 FakeContentLayerClient client_; 2577 FakeContentLayerClient client_;
2571 scoped_refptr<FakePictureLayer> root_layer_; 2578 scoped_refptr<FakePictureLayer> root_layer_;
2572 scoped_refptr<FakePictureLayer> child_layer_; 2579 scoped_refptr<FakePictureLayer> child_layer_;
2573 }; 2580 };
2574 2581
2575 MULTI_THREAD_TEST_F(LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers); 2582 REMOTE_AND_MULTI_THREAD_TEST_F(
2583 LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers);
2576 2584
2577 class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest { 2585 class LayerTreeHostTestContinuousInvalidate : public LayerTreeHostTest {
2578 public: 2586 public:
2579 LayerTreeHostTestContinuousInvalidate() 2587 LayerTreeHostTestContinuousInvalidate()
2580 : num_commit_complete_(0), num_draw_layers_(0) {} 2588 : num_commit_complete_(0), num_draw_layers_(0) {}
2581 2589
2582 void BeginTest() override { 2590 void BeginTest() override {
2583 layer_tree()->SetViewportSize(gfx::Size(10, 10)); 2591 layer_tree()->SetViewportSize(gfx::Size(10, 10));
2584 layer_tree()->root_layer()->SetBounds(gfx::Size(10, 10)); 2592 layer_tree()->root_layer()->SetBounds(gfx::Size(10, 10));
2585 2593
(...skipping 29 matching lines...) Expand all
2615 EXPECT_EQ(1, num_commit_complete_); 2623 EXPECT_EQ(1, num_commit_complete_);
2616 } 2624 }
2617 2625
2618 private: 2626 private:
2619 FakeContentLayerClient client_; 2627 FakeContentLayerClient client_;
2620 scoped_refptr<Layer> layer_; 2628 scoped_refptr<Layer> layer_;
2621 int num_commit_complete_; 2629 int num_commit_complete_;
2622 int num_draw_layers_; 2630 int num_draw_layers_;
2623 }; 2631 };
2624 2632
2625 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousInvalidate); 2633 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestContinuousInvalidate);
2626 2634
2627 class LayerTreeHostTestDeferCommits : public LayerTreeHostTest { 2635 class LayerTreeHostTestDeferCommits : public LayerTreeHostTest {
2628 public: 2636 public:
2629 LayerTreeHostTestDeferCommits() 2637 LayerTreeHostTestDeferCommits()
2630 : num_will_begin_impl_frame_(0), num_send_begin_main_frame_(0) {} 2638 : num_will_begin_impl_frame_(0), num_send_begin_main_frame_(0) {}
2631 2639
2632 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 2640 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
2633 2641
2634 void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, 2642 void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl,
2635 const BeginFrameArgs& args) override { 2643 const BeginFrameArgs& args) override {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 void AfterTest() override { 2681 void AfterTest() override {
2674 EXPECT_GE(num_will_begin_impl_frame_, 5); 2682 EXPECT_GE(num_will_begin_impl_frame_, 5);
2675 EXPECT_EQ(2, num_send_begin_main_frame_); 2683 EXPECT_EQ(2, num_send_begin_main_frame_);
2676 } 2684 }
2677 2685
2678 private: 2686 private:
2679 int num_will_begin_impl_frame_; 2687 int num_will_begin_impl_frame_;
2680 int num_send_begin_main_frame_; 2688 int num_send_begin_main_frame_;
2681 }; 2689 };
2682 2690
2683 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDeferCommits); 2691 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestDeferCommits);
2684 2692
2685 class LayerTreeHostTestCompositeImmediatelyStateTransitions 2693 class LayerTreeHostTestCompositeImmediatelyStateTransitions
2686 : public LayerTreeHostTest { 2694 : public LayerTreeHostTest {
2687 public: 2695 public:
2688 enum { 2696 enum {
2689 kInvalid, 2697 kInvalid,
2690 kStartedTest, 2698 kStartedTest,
2691 kStartedImplFrame, 2699 kStartedImplFrame,
2692 kStartedMainFrame, 2700 kStartedMainFrame,
2693 kStartedCommit, 2701 kStartedCommit,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2832 } 2840 }
2833 } 2841 }
2834 2842
2835 void AfterTest() override {} 2843 void AfterTest() override {}
2836 2844
2837 private: 2845 private:
2838 FakeContentLayerClient client_; 2846 FakeContentLayerClient client_;
2839 int num_tiles_rastered_; 2847 int num_tiles_rastered_;
2840 }; 2848 };
2841 2849
2842 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestLCDChange); 2850 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestLCDChange);
2843 2851
2844 class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled 2852 class LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled
2845 : public LayerTreeHostTest { 2853 : public LayerTreeHostTest {
2846 public: 2854 public:
2847 void InitializeSettings(LayerTreeSettings* settings) override { 2855 void InitializeSettings(LayerTreeSettings* settings) override {
2848 settings->using_synchronous_renderer_compositor = true; 2856 settings->using_synchronous_renderer_compositor = true;
2849 } 2857 }
2850 2858
2851 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 2859 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
2852 2860
2853 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { 2861 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
2854 // The BeginFrame notification is turned off now but will get enabled 2862 // The BeginFrame notification is turned off now but will get enabled
2855 // once we return. End test while it's enabled. 2863 // once we return. End test while it's enabled.
2856 ImplThreadTaskRunner()->PostTask( 2864 ImplThreadTaskRunner()->PostTask(
2857 FROM_HERE, 2865 FROM_HERE,
2858 base::Bind(&LayerTreeHostTest::EndTest, base::Unretained(this))); 2866 base::Bind(&LayerTreeHostTest::EndTest, base::Unretained(this)));
2859 } 2867 }
2860 2868
2861 void AfterTest() override {} 2869 void AfterTest() override {}
2862 }; 2870 };
2863 2871
2872 // No remote test since synchronous renderer compositor is not supported for LTH
2873 // remote.
2864 MULTI_THREAD_TEST_F( 2874 MULTI_THREAD_TEST_F(
2865 LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled); 2875 LayerTreeHostTestBeginFrameNotificationShutdownWhileEnabled);
2866 2876
2867 class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest { 2877 class LayerTreeHostTestAbortedCommitDoesntStall : public LayerTreeHostTest {
2868 protected: 2878 protected:
2869 LayerTreeHostTestAbortedCommitDoesntStall() 2879 LayerTreeHostTestAbortedCommitDoesntStall()
2870 : commit_count_(0), commit_abort_count_(0), commit_complete_count_(0) {} 2880 : commit_count_(0), commit_abort_count_(0), commit_complete_count_(0) {}
2871 2881
2872 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 2882 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
2873 2883
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2978 ImplThreadTaskRunner()->PostTask( 2988 ImplThreadTaskRunner()->PostTask(
2979 FROM_HERE, base::Bind(&OnDrawCompositorFrameSink::OnDraw, 2989 FROM_HERE, base::Bind(&OnDrawCompositorFrameSink::OnDraw,
2980 base::Unretained(compositor_frame_sink_), 2990 base::Unretained(compositor_frame_sink_),
2981 resourceless_software_draw)); 2991 resourceless_software_draw));
2982 } 2992 }
2983 } 2993 }
2984 2994
2985 OnDrawCompositorFrameSink* compositor_frame_sink_ = nullptr; 2995 OnDrawCompositorFrameSink* compositor_frame_sink_ = nullptr;
2986 }; 2996 };
2987 2997
2998 // No remote test since synchronous renderer compositor is not supported for LTH
2999 // remote.
2988 MULTI_THREAD_TEST_F( 3000 MULTI_THREAD_TEST_F(
2989 LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor); 3001 LayerTreeHostTestAbortedCommitDoesntStallSynchronousCompositor);
2990 3002
2991 class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation 3003 class LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation
2992 : public LayerTreeHostTest { 3004 : public LayerTreeHostTest {
2993 protected: 3005 protected:
2994 void SetupTree() override { 3006 void SetupTree() override {
2995 LayerTreeHostTest::SetupTree(); 3007 LayerTreeHostTest::SetupTree();
2996 3008
2997 scoped_refptr<Layer> layer = PictureLayer::Create(&client_); 3009 scoped_refptr<Layer> layer = PictureLayer::Create(&client_);
2998 layer->SetTransform(gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); 3010 layer->SetTransform(gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
2999 layer->SetBounds(gfx::Size(10, 10)); 3011 layer->SetBounds(gfx::Size(10, 10));
3000 layer_tree()->root_layer()->AddChild(layer); 3012 layer_tree()->root_layer()->AddChild(layer);
3001 client_.set_bounds(layer->bounds()); 3013 client_.set_bounds(layer->bounds());
3002 } 3014 }
3003 3015
3004 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 3016 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
3005 3017
3006 void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { 3018 void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override {
3007 EndTest(); 3019 EndTest();
3008 } 3020 }
3009 3021
3010 void AfterTest() override {} 3022 void AfterTest() override {}
3011 3023
3012 FakeContentLayerClient client_; 3024 FakeContentLayerClient client_;
3013 }; 3025 };
3014 3026
3015 SINGLE_AND_MULTI_THREAD_TEST_F( 3027 SINGLE_MULTI_AND_REMOTE_TEST_F(
3016 LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation); 3028 LayerTreeHostTestUninvertibleTransformDoesNotBlockActivation);
3017 3029
3018 class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest { 3030 class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest {
3019 public: 3031 public:
3020 void BeginTest() override { 3032 void BeginTest() override {
3021 frame_ = 0; 3033 frame_ = 0;
3022 PostSetNeedsCommitToMainThread(); 3034 PostSetNeedsCommitToMainThread();
3023 } 3035 }
3024 3036
3025 // Round 1: commit + draw 3037 // Round 1: commit + draw
(...skipping 28 matching lines...) Expand all
3054 break; 3066 break;
3055 } 3067 }
3056 } 3068 }
3057 3069
3058 void AfterTest() override {} 3070 void AfterTest() override {}
3059 3071
3060 protected: 3072 protected:
3061 int frame_; 3073 int frame_;
3062 }; 3074 };
3063 3075
3064 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNumFramesPending); 3076 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestNumFramesPending);
3065 3077
3066 class LayerTreeHostTestResourcelessSoftwareDraw : public LayerTreeHostTest { 3078 class LayerTreeHostTestResourcelessSoftwareDraw : public LayerTreeHostTest {
3067 protected: 3079 protected:
3068 void InitializeSettings(LayerTreeSettings* settings) override { 3080 void InitializeSettings(LayerTreeSettings* settings) override {
3069 settings->using_synchronous_renderer_compositor = true; 3081 settings->using_synchronous_renderer_compositor = true;
3070 } 3082 }
3071 3083
3072 void SetupTree() override { 3084 void SetupTree() override {
3073 root_layer_ = FakePictureLayer::Create(&client_); 3085 root_layer_ = FakePictureLayer::Create(&client_);
3074 root_layer_->SetIsDrawable(true); 3086 root_layer_->SetIsDrawable(true);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
3160 private: 3172 private:
3161 OnDrawCompositorFrameSink* compositor_frame_sink_ = nullptr; 3173 OnDrawCompositorFrameSink* compositor_frame_sink_ = nullptr;
3162 FakeContentLayerClient client_; 3174 FakeContentLayerClient client_;
3163 scoped_refptr<Layer> root_layer_; 3175 scoped_refptr<Layer> root_layer_;
3164 scoped_refptr<Layer> parent_layer_; 3176 scoped_refptr<Layer> parent_layer_;
3165 scoped_refptr<Layer> child_layer_; 3177 scoped_refptr<Layer> child_layer_;
3166 int draw_count_ = 0; 3178 int draw_count_ = 0;
3167 }; 3179 };
3168 3180
3169 // Resourceless is not used for SingleThreadProxy, so it is unimplemented. 3181 // Resourceless is not used for SingleThreadProxy, so it is unimplemented.
3182 // No remote test since synchronous renderer compositor is not supported for LTH
3183 // remote.
3170 MULTI_THREAD_TEST_F(LayerTreeHostTestResourcelessSoftwareDraw); 3184 MULTI_THREAD_TEST_F(LayerTreeHostTestResourcelessSoftwareDraw);
3171 3185
3172 // Test for UI Resource management. 3186 // Test for UI Resource management.
3173 class LayerTreeHostTestUIResource : public LayerTreeHostTest { 3187 class LayerTreeHostTestUIResource : public LayerTreeHostTest {
3174 public: 3188 public:
3175 LayerTreeHostTestUIResource() : num_ui_resources_(0) {} 3189 LayerTreeHostTestUIResource() : num_ui_resources_(0) {}
3176 3190
3177 void InitializeSettings(LayerTreeSettings* settings) override { 3191 void InitializeSettings(LayerTreeSettings* settings) override {
3178 settings->renderer_settings.texture_id_allocation_chunk_size = 1; 3192 settings->renderer_settings.texture_id_allocation_chunk_size = 1;
3179 } 3193 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
3256 3270
3257 void CreateResource() { 3271 void CreateResource() {
3258 ui_resources_[num_ui_resources_++] = 3272 ui_resources_[num_ui_resources_++] =
3259 FakeScopedUIResource::Create(layer_tree_host()->GetUIResourceManager()); 3273 FakeScopedUIResource::Create(layer_tree_host()->GetUIResourceManager());
3260 } 3274 }
3261 3275
3262 std::unique_ptr<FakeScopedUIResource> ui_resources_[5]; 3276 std::unique_ptr<FakeScopedUIResource> ui_resources_[5];
3263 int num_ui_resources_; 3277 int num_ui_resources_;
3264 }; 3278 };
3265 3279
3280 // No remote test since LTH remote does not support UIResourceLayers and
3281 // PaintedScrollbarLayers, which uses UIResourceManager.
3266 MULTI_THREAD_TEST_F(LayerTreeHostTestUIResource); 3282 MULTI_THREAD_TEST_F(LayerTreeHostTestUIResource);
3267 3283
3268 class PushPropertiesCountingLayerImpl : public LayerImpl {
3269 public:
3270 static std::unique_ptr<PushPropertiesCountingLayerImpl> Create(
3271 LayerTreeImpl* tree_impl,
3272 int id) {
3273 return base::WrapUnique(new PushPropertiesCountingLayerImpl(tree_impl, id));
3274 }
3275
3276 ~PushPropertiesCountingLayerImpl() override {}
3277
3278 void PushPropertiesTo(LayerImpl* layer) override {
3279 LayerImpl::PushPropertiesTo(layer);
3280 push_properties_count_++;
3281 // Push state to the active tree because we can only access it from there.
3282 static_cast<PushPropertiesCountingLayerImpl*>(layer)
3283 ->push_properties_count_ = push_properties_count_;
3284 }
3285
3286 std::unique_ptr<LayerImpl> CreateLayerImpl(
3287 LayerTreeImpl* tree_impl) override {
3288 return PushPropertiesCountingLayerImpl::Create(tree_impl, id());
3289 }
3290
3291 size_t push_properties_count() const { return push_properties_count_; }
3292 void reset_push_properties_count() { push_properties_count_ = 0; }
3293
3294 private:
3295 size_t push_properties_count_;
3296
3297 PushPropertiesCountingLayerImpl(LayerTreeImpl* tree_impl, int id)
3298 : LayerImpl(tree_impl, id), push_properties_count_(0) {
3299 SetBounds(gfx::Size(1, 1));
3300 }
3301 };
3302
3303 class PushPropertiesCountingLayer : public Layer {
3304 public:
3305 static scoped_refptr<PushPropertiesCountingLayer> Create() {
3306 return new PushPropertiesCountingLayer();
3307 }
3308
3309 void PushPropertiesTo(LayerImpl* layer) override {
3310 Layer::PushPropertiesTo(layer);
3311 push_properties_count_++;
3312 if (persist_needs_push_properties_) {
3313 GetLayerTree()->AddLayerShouldPushProperties(this);
3314 }
3315 }
3316
3317 // Something to make this layer push properties, but no other layer.
3318 void MakePushProperties() { SetContentsOpaque(!contents_opaque()); }
3319
3320 std::unique_ptr<LayerImpl> CreateLayerImpl(
3321 LayerTreeImpl* tree_impl) override {
3322 return PushPropertiesCountingLayerImpl::Create(tree_impl, id());
3323 }
3324
3325 void SetDrawsContent(bool draws_content) { SetIsDrawable(draws_content); }
3326
3327 size_t push_properties_count() const { return push_properties_count_; }
3328 void reset_push_properties_count() { push_properties_count_ = 0; }
3329
3330 void set_persist_needs_push_properties(bool persist) {
3331 persist_needs_push_properties_ = persist;
3332 }
3333
3334 private:
3335 PushPropertiesCountingLayer()
3336 : push_properties_count_(0), persist_needs_push_properties_(false) {
3337 SetBounds(gfx::Size(1, 1));
3338 }
3339 ~PushPropertiesCountingLayer() override {}
3340
3341 size_t push_properties_count_;
3342 bool persist_needs_push_properties_;
3343 };
3344
3345 class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest { 3284 class LayerTreeHostTestLayersPushProperties : public LayerTreeHostTest {
3346 protected: 3285 protected:
3347 void BeginTest() override { 3286 void BeginTest() override {
3348 num_commits_ = 0; 3287 num_commits_ = 0;
3349 expected_push_properties_root_ = 0; 3288 expected_push_properties_root_ = 0;
3350 expected_push_properties_child_ = 0; 3289 expected_push_properties_child_ = 0;
3351 expected_push_properties_grandchild_ = 0; 3290 expected_push_properties_grandchild_ = 0;
3352 expected_push_properties_child2_ = 0; 3291 expected_push_properties_child2_ = 0;
3353 expected_push_properties_other_root_ = 0; 3292 expected_push_properties_other_root_ = 0;
3354 expected_push_properties_leaf_layer_ = 0; 3293 expected_push_properties_leaf_layer_ = 0;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
3535 scoped_refptr<PushPropertiesCountingLayer> other_root_; 3474 scoped_refptr<PushPropertiesCountingLayer> other_root_;
3536 scoped_refptr<PushPropertiesCountingLayer> leaf_always_pushing_layer_; 3475 scoped_refptr<PushPropertiesCountingLayer> leaf_always_pushing_layer_;
3537 size_t expected_push_properties_root_; 3476 size_t expected_push_properties_root_;
3538 size_t expected_push_properties_child_; 3477 size_t expected_push_properties_child_;
3539 size_t expected_push_properties_child2_; 3478 size_t expected_push_properties_child2_;
3540 size_t expected_push_properties_grandchild_; 3479 size_t expected_push_properties_grandchild_;
3541 size_t expected_push_properties_other_root_; 3480 size_t expected_push_properties_other_root_;
3542 size_t expected_push_properties_leaf_layer_; 3481 size_t expected_push_properties_leaf_layer_;
3543 }; 3482 };
3544 3483
3484 // No remote test because LTH remote does not build property trees, so layers
3485 // to push properties are different between engine and client.
3486 // See crbug/655795.
3545 MULTI_THREAD_TEST_F(LayerTreeHostTestLayersPushProperties); 3487 MULTI_THREAD_TEST_F(LayerTreeHostTestLayersPushProperties);
3546 3488
3547 class LayerTreeHostTestImplLayersPushProperties 3489 class LayerTreeHostTestImplLayersPushProperties
3548 : public LayerTreeHostTestLayersPushProperties { 3490 : public LayerTreeHostTestLayersPushProperties {
3549 protected: 3491 protected:
3550 void BeginTest() override { 3492 void BeginTest() override {
3551 expected_push_properties_root_impl_ = 0; 3493 expected_push_properties_root_impl_ = 0;
3552 expected_push_properties_child_impl_ = 0; 3494 expected_push_properties_child_impl_ = 0;
3553 expected_push_properties_grandchild_impl_ = 0; 3495 expected_push_properties_grandchild_impl_ = 0;
3554 expected_push_properties_child2_impl_ = 0; 3496 expected_push_properties_child2_impl_ = 0;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
3731 leaf_always_pushing_layer_impl_->push_properties_count()); 3673 leaf_always_pushing_layer_impl_->push_properties_count());
3732 } 3674 }
3733 3675
3734 size_t expected_push_properties_root_impl_; 3676 size_t expected_push_properties_root_impl_;
3735 size_t expected_push_properties_child_impl_; 3677 size_t expected_push_properties_child_impl_;
3736 size_t expected_push_properties_child2_impl_; 3678 size_t expected_push_properties_child2_impl_;
3737 size_t expected_push_properties_grandchild_impl_; 3679 size_t expected_push_properties_grandchild_impl_;
3738 size_t expected_push_properties_grandchild2_impl_; 3680 size_t expected_push_properties_grandchild2_impl_;
3739 }; 3681 };
3740 3682
3741 // In single thread there's no pending tree to push properties from. 3683 // No remote test because LTH remote does not build property trees, so layers
3684 // to push properties are different between engine and client.
3685 // See crbug/655795.
3742 MULTI_THREAD_TEST_F(LayerTreeHostTestImplLayersPushProperties); 3686 MULTI_THREAD_TEST_F(LayerTreeHostTestImplLayersPushProperties);
3743 3687
3744 class LayerTreeHostTestPropertyChangesDuringUpdateArePushed 3688 class LayerTreeHostTestPropertyChangesDuringUpdateArePushed
3745 : public LayerTreeHostTest { 3689 : public LayerTreeHostTest {
3746 protected: 3690 protected:
3747 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 3691 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
3748 3692
3749 void SetupTree() override { 3693 void SetupTree() override {
3750 root_ = Layer::Create(); 3694 root_ = Layer::Create();
3751 root_->SetBounds(gfx::Size(1, 1)); 3695 root_->SetBounds(gfx::Size(1, 1));
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
3789 break; 3733 break;
3790 } 3734 }
3791 } 3735 }
3792 3736
3793 void AfterTest() override {} 3737 void AfterTest() override {}
3794 3738
3795 scoped_refptr<Layer> root_; 3739 scoped_refptr<Layer> root_;
3796 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer_; 3740 scoped_refptr<FakePaintedScrollbarLayer> scrollbar_layer_;
3797 }; 3741 };
3798 3742
3743 // No remote test since remote LTH does not support PaintedScrollbarLayer.
3799 MULTI_THREAD_TEST_F(LayerTreeHostTestPropertyChangesDuringUpdateArePushed); 3744 MULTI_THREAD_TEST_F(LayerTreeHostTestPropertyChangesDuringUpdateArePushed);
3800 3745
3801 class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest { 3746 class LayerTreeHostTestSetDrawableCausesCommit : public LayerTreeHostTest {
3802 protected: 3747 protected:
3803 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 3748 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
3804 3749
3805 void SetupTree() override { 3750 void SetupTree() override {
3806 root_ = PushPropertiesCountingLayer::Create(); 3751 root_ = PushPropertiesCountingLayer::Create();
3807 child_ = PushPropertiesCountingLayer::Create(); 3752 child_ = PushPropertiesCountingLayer::Create();
3808 root_->AddChild(child_); 3753 root_->AddChild(child_);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
3849 break; 3794 break;
3850 } 3795 }
3851 } 3796 }
3852 3797
3853 void AfterTest() override {} 3798 void AfterTest() override {}
3854 3799
3855 scoped_refptr<PushPropertiesCountingLayer> root_; 3800 scoped_refptr<PushPropertiesCountingLayer> root_;
3856 scoped_refptr<PushPropertiesCountingLayer> child_; 3801 scoped_refptr<PushPropertiesCountingLayer> child_;
3857 }; 3802 };
3858 3803
3859 MULTI_THREAD_TEST_F(LayerTreeHostTestSetDrawableCausesCommit); 3804 REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSetDrawableCausesCommit);
3860 3805
3861 class LayerTreeHostTestCasePushPropertiesThreeGrandChildren 3806 class LayerTreeHostTestCasePushPropertiesThreeGrandChildren
3862 : public LayerTreeHostTest { 3807 : public LayerTreeHostTest {
3863 protected: 3808 protected:
3864 void BeginTest() override { 3809 void BeginTest() override {
3865 expected_push_properties_root_ = 0; 3810 expected_push_properties_root_ = 0;
3866 expected_push_properties_child_ = 0; 3811 expected_push_properties_child_ = 0;
3867 expected_push_properties_grandchild1_ = 0; 3812 expected_push_properties_grandchild1_ = 0;
3868 expected_push_properties_grandchild2_ = 0; 3813 expected_push_properties_grandchild2_ = 0;
3869 expected_push_properties_grandchild3_ = 0; 3814 expected_push_properties_grandchild3_ = 0;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
3922 EXPECT_TRUE(layer_tree()->LayerNeedsPushPropertiesForTesting( 3867 EXPECT_TRUE(layer_tree()->LayerNeedsPushPropertiesForTesting(
3923 grandchild3_.get())); 3868 grandchild3_.get()));
3924 break; 3869 break;
3925 case 1: 3870 case 1:
3926 EndTest(); 3871 EndTest();
3927 break; 3872 break;
3928 } 3873 }
3929 } 3874 }
3930 }; 3875 };
3931 3876
3932 MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush); 3877 REMOTE_AND_MULTI_THREAD_TEST_F(
3878 LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush);
3933 3879
3934 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion 3880 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion
3935 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { 3881 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
3936 protected: 3882 protected:
3937 void DidCommitAndDrawFrame() override { 3883 void DidCommitAndDrawFrame() override {
3938 int last_source_frame_number = layer_tree_host()->SourceFrameNumber() - 1; 3884 int last_source_frame_number = layer_tree_host()->SourceFrameNumber() - 1;
3939 switch (last_source_frame_number) { 3885 switch (last_source_frame_number) {
3940 case 0: 3886 case 0:
3941 layer_tree()->SetRootLayer(root_); 3887 layer_tree()->SetRootLayer(root_);
3942 break; 3888 break;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
4005 EXPECT_FALSE( 3951 EXPECT_FALSE(
4006 layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get())); 3952 layer_tree()->LayerNeedsPushPropertiesForTesting(root_.get()));
4007 EXPECT_FALSE( 3953 EXPECT_FALSE(
4008 layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get())); 3954 layer_tree()->LayerNeedsPushPropertiesForTesting(child_.get()));
4009 EndTest(); 3955 EndTest();
4010 break; 3956 break;
4011 } 3957 }
4012 } 3958 }
4013 }; 3959 };
4014 3960
4015 MULTI_THREAD_TEST_F(LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion); 3961 REMOTE_AND_MULTI_THREAD_TEST_F(
3962 LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion);
4016 3963
4017 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence 3964 class LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence
4018 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { 3965 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
4019 protected: 3966 protected:
4020 void DidCommitAndDrawFrame() override { 3967 void DidCommitAndDrawFrame() override {
4021 LayerTree* layer_tree = layer_tree_host()->GetLayerTree(); 3968 LayerTree* layer_tree = layer_tree_host()->GetLayerTree();
4022 int last_source_frame_number = layer_tree_host()->SourceFrameNumber() - 1; 3969 int last_source_frame_number = layer_tree_host()->SourceFrameNumber() - 1;
4023 switch (last_source_frame_number) { 3970 switch (last_source_frame_number) {
4024 case 0: 3971 case 0:
4025 layer_tree->SetRootLayer(root_); 3972 layer_tree->SetRootLayer(root_);
(...skipping 27 matching lines...) Expand all
4053 EXPECT_FALSE( 4000 EXPECT_FALSE(
4054 layer_tree->LayerNeedsPushPropertiesForTesting(root_.get())); 4001 layer_tree->LayerNeedsPushPropertiesForTesting(root_.get()));
4055 EXPECT_FALSE( 4002 EXPECT_FALSE(
4056 layer_tree->LayerNeedsPushPropertiesForTesting(child_.get())); 4003 layer_tree->LayerNeedsPushPropertiesForTesting(child_.get()));
4057 EndTest(); 4004 EndTest();
4058 break; 4005 break;
4059 } 4006 }
4060 } 4007 }
4061 }; 4008 };
4062 4009
4063 MULTI_THREAD_TEST_F( 4010 REMOTE_AND_MULTI_THREAD_TEST_F(
4064 LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence); 4011 LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence);
4065 4012
4066 class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree 4013 class LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree
4067 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { 4014 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
4068 protected: 4015 protected:
4069 void DidCommitAndDrawFrame() override { 4016 void DidCommitAndDrawFrame() override {
4070 LayerTree* layer_tree = layer_tree_host()->GetLayerTree(); 4017 LayerTree* layer_tree = layer_tree_host()->GetLayerTree();
4071 int last_source_frame_number = layer_tree_host()->SourceFrameNumber() - 1; 4018 int last_source_frame_number = layer_tree_host()->SourceFrameNumber() - 1;
4072 switch (last_source_frame_number) { 4019 switch (last_source_frame_number) {
4073 case 0: 4020 case 0:
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
4122 layer_tree->LayerNeedsPushPropertiesForTesting(root_.get())); 4069 layer_tree->LayerNeedsPushPropertiesForTesting(root_.get()));
4123 EXPECT_TRUE( 4070 EXPECT_TRUE(
4124 layer_tree->LayerNeedsPushPropertiesForTesting(child_.get())); 4071 layer_tree->LayerNeedsPushPropertiesForTesting(child_.get()));
4125 4072
4126 EndTest(); 4073 EndTest();
4127 break; 4074 break;
4128 } 4075 }
4129 } 4076 }
4130 }; 4077 };
4131 4078
4132 MULTI_THREAD_TEST_F( 4079 REMOTE_AND_MULTI_THREAD_TEST_F(
4133 LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree); 4080 LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree);
4134 4081
4135 class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild 4082 class LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild
4136 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { 4083 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
4137 protected: 4084 protected:
4138 void DidCommitAndDrawFrame() override { 4085 void DidCommitAndDrawFrame() override {
4139 LayerTree* layer_tree = layer_tree_host()->GetLayerTree(); 4086 LayerTree* layer_tree = layer_tree_host()->GetLayerTree();
4140 int last_source_frame_number = layer_tree_host()->SourceFrameNumber() - 1; 4087 int last_source_frame_number = layer_tree_host()->SourceFrameNumber() - 1;
4141 switch (last_source_frame_number) { 4088 switch (last_source_frame_number) {
4142 case 0: 4089 case 0:
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
4187 4134
4188 EXPECT_FALSE( 4135 EXPECT_FALSE(
4189 layer_tree->LayerNeedsPushPropertiesForTesting(root_.get())); 4136 layer_tree->LayerNeedsPushPropertiesForTesting(root_.get()));
4190 4137
4191 EndTest(); 4138 EndTest();
4192 break; 4139 break;
4193 } 4140 }
4194 } 4141 }
4195 }; 4142 };
4196 4143
4197 MULTI_THREAD_TEST_F( 4144 REMOTE_AND_MULTI_THREAD_TEST_F(
4198 LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild); 4145 LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild);
4199 4146
4200 class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent 4147 class LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent
4201 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren { 4148 : public LayerTreeHostTestCasePushPropertiesThreeGrandChildren {
4202 protected: 4149 protected:
4203 void DidCommitAndDrawFrame() override { 4150 void DidCommitAndDrawFrame() override {
4204 LayerTree* layer_tree = layer_tree_host()->GetLayerTree(); 4151 LayerTree* layer_tree = layer_tree_host()->GetLayerTree();
4205 int last_source_frame_number = layer_tree_host()->SourceFrameNumber() - 1; 4152 int last_source_frame_number = layer_tree_host()->SourceFrameNumber() - 1;
4206 switch (last_source_frame_number) { 4153 switch (last_source_frame_number) {
4207 case 0: 4154 case 0:
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
4252 4199
4253 EXPECT_FALSE( 4200 EXPECT_FALSE(
4254 layer_tree->LayerNeedsPushPropertiesForTesting(root_.get())); 4201 layer_tree->LayerNeedsPushPropertiesForTesting(root_.get()));
4255 4202
4256 EndTest(); 4203 EndTest();
4257 break; 4204 break;
4258 } 4205 }
4259 } 4206 }
4260 }; 4207 };
4261 4208
4262 MULTI_THREAD_TEST_F( 4209 REMOTE_AND_MULTI_THREAD_TEST_F(
4263 LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent); 4210 LayerTreeHostTestPushPropertiesSetPropertyInChildThenParent);
4264 4211
4265 // This test verifies that the tree activation callback is invoked correctly. 4212 // This test verifies that the tree activation callback is invoked correctly.
4266 class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest { 4213 class LayerTreeHostTestTreeActivationCallback : public LayerTreeHostTest {
4267 public: 4214 public:
4268 LayerTreeHostTestTreeActivationCallback() 4215 LayerTreeHostTestTreeActivationCallback()
4269 : num_commits_(0), callback_count_(0) {} 4216 : num_commits_(0), callback_count_(0) {}
4270 4217
4271 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 4218 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
4272 4219
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
4311 base::Unretained(this)) 4258 base::Unretained(this))
4312 : base::Closure()); 4259 : base::Closure());
4313 } 4260 }
4314 4261
4315 void ActivationCallback() { ++callback_count_; } 4262 void ActivationCallback() { ++callback_count_; }
4316 4263
4317 int num_commits_; 4264 int num_commits_;
4318 int callback_count_; 4265 int callback_count_;
4319 }; 4266 };
4320 4267
4321 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestTreeActivationCallback); 4268 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestTreeActivationCallback);
4322 4269
4323 class LayerInvalidateCausesDraw : public LayerTreeHostTest { 4270 class LayerInvalidateCausesDraw : public LayerTreeHostTest {
4324 public: 4271 public:
4325 LayerInvalidateCausesDraw() : num_commits_(0), num_draws_(0) {} 4272 LayerInvalidateCausesDraw() : num_commits_(0), num_draws_(0) {}
4326 4273
4327 void BeginTest() override { 4274 void BeginTest() override {
4328 ASSERT_TRUE(invalidate_layer_) 4275 ASSERT_TRUE(invalidate_layer_)
4329 << "Derived tests must set this in SetupTree"; 4276 << "Derived tests must set this in SetupTree";
4330 4277
4331 // One initial commit. 4278 // One initial commit.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
4374 video_layer->SetIsDrawable(true); 4321 video_layer->SetIsDrawable(true);
4375 layer_tree()->root_layer()->AddChild(video_layer); 4322 layer_tree()->root_layer()->AddChild(video_layer);
4376 4323
4377 invalidate_layer_ = video_layer; 4324 invalidate_layer_ = video_layer;
4378 } 4325 }
4379 4326
4380 private: 4327 private:
4381 FakeVideoFrameProvider provider_; 4328 FakeVideoFrameProvider provider_;
4382 }; 4329 };
4383 4330
4331 // LTH remote does not support VideoLayer.
4384 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate); 4332 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestVideoLayerInvalidate);
4385 4333
4386 class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest { 4334 class LayerTreeHostTestPushHiddenLayer : public LayerTreeHostTest {
4387 protected: 4335 protected:
4388 void SetupTree() override { 4336 void SetupTree() override {
4389 root_layer_ = Layer::Create(); 4337 root_layer_ = Layer::Create();
4390 root_layer_->SetPosition(gfx::PointF()); 4338 root_layer_->SetPosition(gfx::PointF());
4391 root_layer_->SetBounds(gfx::Size(10, 10)); 4339 root_layer_->SetBounds(gfx::Size(10, 10));
4392 4340
4393 parent_layer_ = SolidColorLayer::Create(); 4341 parent_layer_ = SolidColorLayer::Create();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
4441 } 4389 }
4442 } 4390 }
4443 4391
4444 void AfterTest() override {} 4392 void AfterTest() override {}
4445 4393
4446 scoped_refptr<Layer> root_layer_; 4394 scoped_refptr<Layer> root_layer_;
4447 scoped_refptr<SolidColorLayer> parent_layer_; 4395 scoped_refptr<SolidColorLayer> parent_layer_;
4448 scoped_refptr<SolidColorLayer> child_layer_; 4396 scoped_refptr<SolidColorLayer> child_layer_;
4449 }; 4397 };
4450 4398
4451 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPushHiddenLayer); 4399 SINGLE_MULTI_AND_REMOTE_TEST_F(LayerTreeHostTestPushHiddenLayer);
4452 4400
4453 class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest { 4401 class LayerTreeHostTestUpdateLayerInEmptyViewport : public LayerTreeHostTest {
4454 protected: 4402 protected:
4455 void SetupTree() override { 4403 void SetupTree() override {
4456 root_layer_ = FakePictureLayer::Create(&client_); 4404 root_layer_ = FakePictureLayer::Create(&client_);
4457 root_layer_->SetBounds(gfx::Size(10, 10)); 4405 root_layer_->SetBounds(gfx::Size(10, 10));
4458 4406
4459 layer_tree()->SetRootLayer(root_layer_); 4407 layer_tree()->SetRootLayer(root_layer_);
4460 LayerTreeHostTest::SetupTree(); 4408 LayerTreeHostTest::SetupTree();
4461 client_.set_bounds(root_layer_->bounds()); 4409 client_.set_bounds(root_layer_->bounds());
(...skipping 12 matching lines...) Expand all
4474 EXPECT_GT(root_layer_->update_count(), 0); 4422 EXPECT_GT(root_layer_->update_count(), 0);
4475 EndTest(); 4423 EndTest();
4476 } 4424 }
4477 4425
4478 void AfterTest() override {} 4426 void AfterTest() override {}
4479 4427
4480 FakeContentLayerClient client_; 4428 FakeContentLayerClient client_;
4481 scoped_refptr<FakePictureLayer> root_layer_; 4429 scoped_refptr<FakePictureLayer> root_layer_;
4482 }; 4430 };
4483 4431
4484 MULTI_THREAD_TEST_F(LayerTreeHostTestUpdateLayerInEmptyViewport); 4432 REMOTE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestUpdateLayerInEmptyViewport);
4485 4433
4486 class LayerTreeHostTestElasticOverscroll : public LayerTreeHostTest { 4434 class LayerTreeHostTestElasticOverscroll : public LayerTreeHostTest {
4487 public: 4435 public:
4488 LayerTreeHostTestElasticOverscroll() 4436 LayerTreeHostTestElasticOverscroll()
4489 : scroll_elasticity_helper_(nullptr), num_draws_(0) {} 4437 : scroll_elasticity_helper_(nullptr), num_draws_(0) {}
4490 4438
4491 void InitializeSettings(LayerTreeSettings* settings) override { 4439 void InitializeSettings(LayerTreeSettings* settings) override {
4492 settings->enable_elastic_overscroll = true; 4440 settings->enable_elastic_overscroll = true;
4493 } 4441 }
4494 4442
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
4569 void AfterTest() override {} 4517 void AfterTest() override {}
4570 4518
4571 private: 4519 private:
4572 FakeContentLayerClient client_; 4520 FakeContentLayerClient client_;
4573 scoped_refptr<Layer> root_layer_; 4521 scoped_refptr<Layer> root_layer_;
4574 ScrollElasticityHelper* scroll_elasticity_helper_; 4522 ScrollElasticityHelper* scroll_elasticity_helper_;
4575 int content_layer_id_; 4523 int content_layer_id_;
4576 int num_draws_; 4524 int num_draws_;
4577 }; 4525 };
4578 4526
4527 // Remote test does not support enable_elastic_overscroll.
4579 MULTI_THREAD_TEST_F(LayerTreeHostTestElasticOverscroll); 4528 MULTI_THREAD_TEST_F(LayerTreeHostTestElasticOverscroll);
4580 4529
4581 struct TestSwapPromiseResult { 4530 struct TestSwapPromiseResult {
4582 TestSwapPromiseResult() 4531 TestSwapPromiseResult()
4583 : did_activate_called(false), 4532 : did_activate_called(false),
4584 did_swap_called(false), 4533 did_swap_called(false),
4585 did_not_swap_called(false), 4534 did_not_swap_called(false),
4586 dtor_called(false), 4535 dtor_called(false),
4587 reason(SwapPromise::COMMIT_FAILS) {} 4536 reason(SwapPromise::COMMIT_FAILS) {}
4588 4537
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
4673 // The pinned active swap promise should not activate, but should swap. 4622 // The pinned active swap promise should not activate, but should swap.
4674 EXPECT_FALSE(pinned_active_swap_promise_result_.did_activate_called); 4623 EXPECT_FALSE(pinned_active_swap_promise_result_.did_activate_called);
4675 EXPECT_TRUE(pinned_active_swap_promise_result_.did_swap_called); 4624 EXPECT_TRUE(pinned_active_swap_promise_result_.did_swap_called);
4676 } 4625 }
4677 4626
4678 TestSwapPromiseResult pending_swap_promise_result_; 4627 TestSwapPromiseResult pending_swap_promise_result_;
4679 TestSwapPromiseResult active_swap_promise_result_; 4628 TestSwapPromiseResult active_swap_promise_result_;
4680 TestSwapPromiseResult pinned_active_swap_promise_result_; 4629 TestSwapPromiseResult pinned_active_swap_promise_result_;
4681 }; 4630 };
4682 4631
4632 // No remote test because this test compares the swap promises result between
4633 // LTH in process and LTH impl. LTH remote runs its own swap promise, and we
4634 // don't send swap promises to the client.
4683 MULTI_THREAD_TEST_F(PinnedLayerTreeSwapPromise); 4635 MULTI_THREAD_TEST_F(PinnedLayerTreeSwapPromise);
4684 4636
4685 class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest { 4637 class LayerTreeHostTestBreakSwapPromise : public LayerTreeHostTest {
4686 protected: 4638 protected:
4687 LayerTreeHostTestBreakSwapPromise() 4639 LayerTreeHostTestBreakSwapPromise()
4688 : commit_count_(0), commit_complete_count_(0) {} 4640 : commit_count_(0), commit_complete_count_(0) {}
4689 4641
4690 void WillBeginMainFrame() override { 4642 void WillBeginMainFrame() override {
4691 ASSERT_LE(commit_count_, 2); 4643 ASSERT_LE(commit_count_, 2);
4692 std::unique_ptr<SwapPromise> swap_promise( 4644 std::unique_ptr<SwapPromise> swap_promise(
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
4770 EXPECT_EQ(SwapPromise::SWAP_FAILS, swap_promise_result_[2].reason); 4722 EXPECT_EQ(SwapPromise::SWAP_FAILS, swap_promise_result_[2].reason);
4771 EXPECT_TRUE(swap_promise_result_[2].dtor_called); 4723 EXPECT_TRUE(swap_promise_result_[2].dtor_called);
4772 } 4724 }
4773 } 4725 }
4774 4726
4775 int commit_count_; 4727 int commit_count_;
4776 int commit_complete_count_; 4728 int commit_complete_count_;
4777 TestSwapPromiseResult swap_promise_result_[3]; 4729 TestSwapPromiseResult swap_promise_result_[3];
4778 }; 4730 };
4779 4731
4732 // No remote test because LTH remote runs its own swap promises, and we
4733 // don't send swap promises to the LTH in process on the client side.
4780 MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise); 4734 MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromise);
4781 4735
4782 class LayerTreeHostTestKeepSwapPromise : public LayerTreeHostTest { 4736 class LayerTreeHostTestKeepSwapPromise : public LayerTreeHostTest {
4783 public: 4737 public:
4784 LayerTreeHostTestKeepSwapPromise() {} 4738 LayerTreeHostTestKeepSwapPromise() {}
4785 4739
4786 void BeginTest() override { 4740 void BeginTest() override {
4787 layer_ = SolidColorLayer::Create(); 4741 layer_ = SolidColorLayer::Create();
4788 layer_->SetIsDrawable(true); 4742 layer_->SetIsDrawable(true);
4789 layer_->SetBounds(gfx::Size(10, 10)); 4743 layer_->SetBounds(gfx::Size(10, 10));
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
4861 } 4815 }
4862 4816
4863 void AfterTest() override {} 4817 void AfterTest() override {}
4864 4818
4865 private: 4819 private:
4866 int num_swaps_ = 0; 4820 int num_swaps_ = 0;
4867 scoped_refptr<Layer> layer_; 4821 scoped_refptr<Layer> layer_;
4868 TestSwapPromiseResult swap_promise_result_; 4822 TestSwapPromiseResult swap_promise_result_;
4869 }; 4823 };
4870 4824
4825 // No remote test because LTH remote runs its own swap promises, and we
4826 // don't send swap promises to the LTH in process on the client side.
4871 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestKeepSwapPromise); 4827 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestKeepSwapPromise);
4872 4828
4873 class LayerTreeHostTestKeepSwapPromiseMFBA : public LayerTreeHostTest { 4829 class LayerTreeHostTestKeepSwapPromiseMFBA : public LayerTreeHostTest {
4874 public: 4830 public:
4875 LayerTreeHostTestKeepSwapPromiseMFBA() {} 4831 LayerTreeHostTestKeepSwapPromiseMFBA() {}
4876 4832
4877 void InitializeSettings(LayerTreeSettings* settings) override { 4833 void InitializeSettings(LayerTreeSettings* settings) override {
4878 settings->main_frame_before_activation_enabled = true; 4834 settings->main_frame_before_activation_enabled = true;
4879 } 4835 }
4880 4836
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
4975 } 4931 }
4976 4932
4977 void AfterTest() override { EXPECT_EQ(1, num_swaps_); } 4933 void AfterTest() override { EXPECT_EQ(1, num_swaps_); }
4978 4934
4979 private: 4935 private:
4980 int num_swaps_ = 0; 4936 int num_swaps_ = 0;
4981 scoped_refptr<Layer> layer_; 4937 scoped_refptr<Layer> layer_;
4982 TestSwapPromiseResult swap_promise_result_; 4938 TestSwapPromiseResult swap_promise_result_;
4983 }; 4939 };
4984 4940
4941 // No remote test because LTH remote runs its own swap promises, and we
4942 // don't send swap promises to the LTH in process on the client side.
4985 MULTI_THREAD_TEST_F(LayerTreeHostTestKeepSwapPromiseMFBA); 4943 MULTI_THREAD_TEST_F(LayerTreeHostTestKeepSwapPromiseMFBA);
4986 4944
4987 class LayerTreeHostTestBreakSwapPromiseForVisibility 4945 class LayerTreeHostTestBreakSwapPromiseForVisibility
4988 : public LayerTreeHostTest { 4946 : public LayerTreeHostTest {
4989 protected: 4947 protected:
4990 void BeginTest() override { PostSetNeedsCommitToMainThread(); } 4948 void BeginTest() override { PostSetNeedsCommitToMainThread(); }
4991 4949
4992 void SetVisibleFalseAndQueueSwapPromise() { 4950 void SetVisibleFalseAndQueueSwapPromise() {
4993 layer_tree_host()->SetVisible(false); 4951 layer_tree_host()->SetVisible(false);
4994 std::unique_ptr<SwapPromise> swap_promise( 4952 std::unique_ptr<SwapPromise> swap_promise(
(...skipping 22 matching lines...) Expand all
5017 EXPECT_FALSE(swap_promise_result_.did_swap_called); 4975 EXPECT_FALSE(swap_promise_result_.did_swap_called);
5018 EXPECT_TRUE(swap_promise_result_.did_not_swap_called); 4976 EXPECT_TRUE(swap_promise_result_.did_not_swap_called);
5019 EXPECT_EQ(SwapPromise::COMMIT_FAILS, swap_promise_result_.reason); 4977 EXPECT_EQ(SwapPromise::COMMIT_FAILS, swap_promise_result_.reason);
5020 EXPECT_TRUE(swap_promise_result_.dtor_called); 4978 EXPECT_TRUE(swap_promise_result_.dtor_called);
5021 } 4979 }
5022 } 4980 }
5023 4981
5024 TestSwapPromiseResult swap_promise_result_; 4982 TestSwapPromiseResult swap_promise_result_;
5025 }; 4983 };
5026 4984
4985 // No remote test because LTH remote runs its own swap promises, and we
4986 // don't send swap promises to the LTH in process on the client side.
5027 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromiseForVisibility); 4987 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestBreakSwapPromiseForVisibility);
5028 4988
5029 class SimpleSwapPromiseMonitor : public SwapPromiseMonitor { 4989 class SimpleSwapPromiseMonitor : public SwapPromiseMonitor {
5030 public: 4990 public:
5031 SimpleSwapPromiseMonitor(LayerTreeHost* layer_tree_host, 4991 SimpleSwapPromiseMonitor(LayerTreeHost* layer_tree_host,
5032 LayerTreeHostImpl* layer_tree_host_impl, 4992 LayerTreeHostImpl* layer_tree_host_impl,
5033 int* set_needs_commit_count, 4993 int* set_needs_commit_count,
5034 int* set_needs_redraw_count) 4994 int* set_needs_redraw_count)
5035 : SwapPromiseMonitor( 4995 : SwapPromiseMonitor(
5036 (layer_tree_host ? layer_tree_host->GetSwapPromiseManager() 4996 (layer_tree_host ? layer_tree_host->GetSwapPromiseManager()
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
5100 EXPECT_EQ(3, set_needs_commit_count); 5060 EXPECT_EQ(3, set_needs_commit_count);
5101 EXPECT_EQ(0, set_needs_redraw_count); 5061 EXPECT_EQ(0, set_needs_redraw_count);
5102 } 5062 }
5103 5063
5104 EndTest(); 5064 EndTest();
5105 } 5065 }
5106 5066
5107 void AfterTest() override {} 5067 void AfterTest() override {}
5108 }; 5068 };
5109 5069
5070 // No remote test because LTH remote runs its own swap promises, and we
5071 // don't send swap promises to the LTH in process on the client side.
5110 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); 5072 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor);
5111 5073
5112 class LayerTreeHostTestHighResRequiredAfterEvictingUIResources 5074 class LayerTreeHostTestHighResRequiredAfterEvictingUIResources
5113 : public LayerTreeHostTest { 5075 : public LayerTreeHostTest {
5114 protected: 5076 protected:
5115 void SetupTree() override { 5077 void SetupTree() override {
5116 LayerTreeHostTest::SetupTree(); 5078 LayerTreeHostTest::SetupTree();
5117 ui_resource_ = 5079 ui_resource_ =
5118 FakeScopedUIResource::Create(layer_tree_host()->GetUIResourceManager()); 5080 FakeScopedUIResource::Create(layer_tree_host()->GetUIResourceManager());
5119 client_.set_bounds(layer_tree()->root_layer()->bounds()); 5081 client_.set_bounds(layer_tree()->root_layer()->bounds());
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
5321 EndTest(); 5283 EndTest();
5322 } 5284 }
5323 5285
5324 void AfterTest() override {} 5286 void AfterTest() override {}
5325 5287
5326 FakeContentLayerClient layer_client_; 5288 FakeContentLayerClient layer_client_;
5327 FakePictureLayer* layer_; 5289 FakePictureLayer* layer_;
5328 FakeRecordingSource* recording_source_; 5290 FakeRecordingSource* recording_source_;
5329 }; 5291 };
5330 5292
5293 // No remote test since we does not send gpu rasterization flag to the client.
5294 // See crbug/650431.
5331 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationEnabled); 5295 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationEnabled);
5332 5296
5333 class LayerTreeHostTestGpuRasterizationReenabled : public LayerTreeHostTest { 5297 class LayerTreeHostTestGpuRasterizationReenabled : public LayerTreeHostTest {
5334 protected: 5298 protected:
5335 void InitializeSettings(LayerTreeSettings* settings) override { 5299 void InitializeSettings(LayerTreeSettings* settings) override {
5336 EXPECT_FALSE(settings->gpu_rasterization_enabled); 5300 EXPECT_FALSE(settings->gpu_rasterization_enabled);
5337 settings->gpu_rasterization_enabled = true; 5301 settings->gpu_rasterization_enabled = true;
5338 } 5302 }
5339 5303
5340 void SetupTree() override { 5304 void SetupTree() override {
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after
7036 EndTest(); 7000 EndTest();
7037 } 7001 }
7038 7002
7039 void AfterTest() override {} 7003 void AfterTest() override {}
7040 }; 7004 };
7041 7005
7042 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources); 7006 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources);
7043 7007
7044 } // namespace 7008 } // namespace
7045 } // namespace cc 7009 } // namespace cc
OLDNEW
« cc/blimp/layer_tree_host_remote.cc ('K') | « cc/test/remote_client_layer_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698