Chromium Code Reviews| 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(); |
| } |
| } |