diff options
author | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-21 03:56:55 +0000 |
---|---|---|
committer | jbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-21 03:56:55 +0000 |
commit | cf2d38822a0633972caf9c6f6d41e31a908d0c6e (patch) | |
tree | 151e174545b4fc9b1ce2813008ffae3a0a3f4771 /cc | |
parent | e769ed8814307038b06ab32dda76caeafc213a40 (diff) | |
download | chromium_src-cf2d38822a0633972caf9c6f6d41e31a908d0c6e.zip chromium_src-cf2d38822a0633972caf9c6f6d41e31a908d0c6e.tar.gz chromium_src-cf2d38822a0633972caf9c6f6d41e31a908d0c6e.tar.bz2 |
Fix LayerTreeHostDamageTestScrollbarDoesDamage.
Test that not changing the scrollbar doesn't do damage before we test that changing it does, because otherwise the commit from the previous test could come in and cause damage.
BUG=274116
Review URL: https://chromiumcodereview.appspot.com/22853008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218628 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/trees/layer_tree_host_unittest_damage.cc | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/cc/trees/layer_tree_host_unittest_damage.cc b/cc/trees/layer_tree_host_unittest_damage.cc index 9a5f3d2..3eee02c 100644 --- a/cc/trees/layer_tree_host_unittest_damage.cc +++ b/cc/trees/layer_tree_host_unittest_damage.cc @@ -334,16 +334,16 @@ class LayerTreeHostDamageTestScrollbarDoesDamage // The first frame has damage, so we should draw and swap. break; case 1: - // The second frame should damage the scrollbars. - EXPECT_TRUE(root_damage.Contains(gfx::Rect(300, 300, 10, 100))); + // The second frame should not damage the scrollbars. + EXPECT_FALSE(root_damage.Intersects(gfx::Rect(300, 300, 10, 100))); break; case 2: // The third frame should damage the scrollbars. EXPECT_TRUE(root_damage.Contains(gfx::Rect(300, 300, 10, 100))); break; case 3: - // The fourth frame should not damage the scrollbars. - EXPECT_FALSE(root_damage.Intersects(gfx::Rect(300, 300, 10, 100))); + // The fourth frame should damage the scrollbars. + EXPECT_TRUE(root_damage.Contains(gfx::Rect(300, 300, 10, 100))); EndTest(); break; } @@ -358,19 +358,21 @@ class LayerTreeHostDamageTestScrollbarDoesDamage LayerImpl* scroll_layer = root->children()[0]; switch (did_swaps_) { case 1: + // Test that modifying the position of the content layer (not + // scrolling) won't damage the scrollbar. Do this before the other + // tests, as they can cause commits that will later damage the + // scrollbar. http://crbug.com/276657 + scroll_layer->SetPosition(gfx::Point(1,1)); + scroll_layer->SetScrollOffset(scroll_layer->scroll_offset()); + host_impl->SetNeedsRedraw(); + break; + case 2: host_impl->ScrollBegin(gfx::Point(1,1), InputHandler::Wheel); EXPECT_TRUE(host_impl->ScrollBy(gfx::Point(), gfx::Vector2dF(10.0, 10.0))); break; - case 2: - scroll_layer->SetMaxScrollOffset(gfx::Vector2d(60, 100)); - host_impl->SetNeedsRedraw(); - break; case 3: - // Test that modifying the position of the content layer (not - // scrolling) won't damage the scrollbar. - scroll_layer->SetPosition(gfx::Point(1,1)); - scroll_layer->SetScrollOffset(scroll_layer->scroll_offset()); + scroll_layer->SetMaxScrollOffset(gfx::Vector2d(60, 100)); host_impl->SetNeedsRedraw(); break; } @@ -385,12 +387,7 @@ class LayerTreeHostDamageTestScrollbarDoesDamage int did_swaps_; }; -// Flaky on win. http://crbug.com/274116 -// Can't specify the normal DISABLED_ since we don't have access to the test -// names through this macro. Just ifdef it out completely. -#if !defined(OS_WIN) MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarDoesDamage); -#endif } // namespace } // namespace cc |