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

Unified Diff: cc/trees/layer_tree_host_unittest_scroll.cc

Issue 307653005: Update source frame number even when commits abort (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« cc/trees/layer_tree_host.cc ('K') | « cc/trees/layer_tree_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest_scroll.cc
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc
index 626c67dc240e3aee9ff51ac14cb5e9f30e948f97..6d4fb52832f0ec07692485c7af10b5ecb890f6a3 100644
--- a/cc/trees/layer_tree_host_unittest_scroll.cc
+++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -241,7 +241,8 @@ class LayerTreeHostScrollTestScrollAbortedCommit
case 3:
// This commit will not be aborted because of the scroll change.
EXPECT_EQ(2, num_impl_scrolls_);
- EXPECT_EQ(1, layer_tree_host()->source_frame_number());
+ // The source frame number still increases even with the abort.
enne (OOO) 2014/05/29 19:29:58 Hey look, we already had tests, and I just had to
+ EXPECT_EQ(2, layer_tree_host()->source_frame_number());
EXPECT_VECTOR_EQ(root_scroll_layer->scroll_offset(),
initial_scroll_ + impl_scroll_ + impl_scroll_);
EXPECT_EQ(impl_scale_ * impl_scale_,
@@ -252,7 +253,7 @@ class LayerTreeHostScrollTestScrollAbortedCommit
case 4:
// This commit will also be aborted.
EXPECT_EQ(3, num_impl_scrolls_);
- EXPECT_EQ(2, layer_tree_host()->source_frame_number());
+ EXPECT_EQ(3, layer_tree_host()->source_frame_number());
EXPECT_VECTOR_EQ(root_scroll_layer->scroll_offset(),
initial_scroll_ + impl_scroll_ + impl_scroll_ +
impl_scroll_ + second_main_scroll_);
@@ -311,7 +312,10 @@ class LayerTreeHostScrollTestScrollAbortedCommit
impl->active_tree()->total_page_scale_factor());
impl->SetNeedsCommit();
- } else if (impl->active_tree()->source_frame_number() == 1 &&
+ } else if (impl->active_tree()->source_frame_number() == 1) {
+ // Commit for source frame 1 is aborted.
+ NOTREACHED();
+ } else if (impl->active_tree()->source_frame_number() == 2 &&
impl->SourceAnimationFrameNumber() == 3) {
// Third draw after the second full commit.
EXPECT_EQ(root_scroll_layer->ScrollDelta(), gfx::Vector2d());
@@ -321,7 +325,7 @@ class LayerTreeHostScrollTestScrollAbortedCommit
EXPECT_VECTOR_EQ(
root_scroll_layer->scroll_offset(),
initial_scroll_ + impl_scroll_ + impl_scroll_ + second_main_scroll_);
- } else if (impl->active_tree()->source_frame_number() == 1 &&
+ } else if (impl->active_tree()->source_frame_number() == 2 &&
impl->SourceAnimationFrameNumber() == 4) {
// Final draw after the second aborted commit.
EXPECT_VECTOR_EQ(root_scroll_layer->ScrollDelta(), gfx::Vector2d());
@@ -329,6 +333,9 @@ class LayerTreeHostScrollTestScrollAbortedCommit
initial_scroll_ + impl_scroll_ + impl_scroll_ +
impl_scroll_ + second_main_scroll_);
EndTest();
+ } else {
+ // Commit for source frame 3 is aborted.
+ NOTREACHED();
}
}
« cc/trees/layer_tree_host.cc ('K') | « cc/trees/layer_tree_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698