Index: cc/trees/layer_tree_host_impl_unittest.cc |
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc |
index c540c24de2a5a51b6985f274081519c80cf8a109..73ae4ca1193336b524212b74b8c3d17ea6da2fa5 100644 |
--- a/cc/trees/layer_tree_host_impl_unittest.cc |
+++ b/cc/trees/layer_tree_host_impl_unittest.cc |
@@ -207,7 +207,7 @@ class LayerTreeHostImplTest : public testing::Test, |
host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 1.f, 1.f); |
// Set the BeginFrameArgs so that methods which use it are able to. |
host_impl_->WillBeginImplFrame(CreateBeginFrameArgsForTesting( |
- BEGINFRAME_FROM_HERE, |
+ BEGINFRAME_FROM_HERE, 0, 1, |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(1))); |
host_impl_->DidFinishImplFrame(); |
@@ -489,6 +489,7 @@ class LayerTreeHostImplTest : public testing::Test, |
void BeginImplFrameAndAnimate(BeginFrameArgs begin_frame_args, |
base::TimeTicks frame_time) { |
begin_frame_args.frame_time = frame_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -1345,7 +1346,7 @@ TEST_F(LayerTreeHostImplTest, AnimationSchedulingActiveTree) { |
base::TimeTicks now = base::TimeTicks::Now(); |
host_impl_->WillBeginImplFrame( |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, now)); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2, now)); |
// TODO(crbug.com/551134): We always request a new frame and a draw for |
// animations that are on the pending tree, but we don't need to do that |
@@ -1457,7 +1458,7 @@ TEST_F(LayerTreeHostImplTest, AnimationSchedulingOnLayerDestruction) { |
base::TimeTicks now = base::TimeTicks::Now(); |
host_impl_->WillBeginImplFrame( |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, now)); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2, now)); |
EXPECT_TRUE(did_request_next_frame_); |
did_request_next_frame_ = false; |
@@ -1537,7 +1538,7 @@ TEST_F(LayerTreeHostImplTest, AnimationMarksLayerNotReady) { |
base::TimeTicks now = base::TimeTicks::Now(); |
host_impl_->WillBeginImplFrame( |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, now)); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2, now)); |
host_impl_->ActivateAnimations(); |
host_impl_->Animate(); |
@@ -2343,7 +2344,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimation) { |
base::TimeTicks end_time = start_time + duration; |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
// Non-anchor zoom-in |
{ |
@@ -2367,6 +2368,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimation) { |
did_request_redraw_ = false; |
did_request_next_frame_ = false; |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_redraw_); |
@@ -2376,6 +2378,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimation) { |
did_request_redraw_ = false; |
did_request_next_frame_ = false; |
begin_frame_args.frame_time = halfway_through_animation; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_redraw_); |
@@ -2386,6 +2389,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimation) { |
did_request_next_frame_ = false; |
did_request_commit_ = false; |
begin_frame_args.frame_time = end_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_commit_); |
@@ -2425,6 +2429,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimation) { |
did_request_redraw_ = false; |
did_request_next_frame_ = false; |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_redraw_); |
@@ -2435,6 +2440,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimation) { |
did_request_commit_ = false; |
did_request_next_frame_ = false; |
begin_frame_args.frame_time = end_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_redraw_); |
@@ -2468,7 +2474,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationNoOp) { |
base::TimeTicks end_time = start_time + duration; |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
// Anchor zoom with unchanged page scale should not change scroll or scale. |
{ |
@@ -2485,17 +2491,20 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationNoOp) { |
duration))); |
host_impl_->ActivateSyncTree(); |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->DidFinishImplFrame(); |
begin_frame_args.frame_time = halfway_through_animation; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_redraw_); |
host_impl_->DidFinishImplFrame(); |
begin_frame_args.frame_time = end_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_commit_); |
@@ -2536,7 +2545,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationTransferedOnSyncTreeActivate) { |
float target_scale = 2.f; |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
scroll_layer->layer_tree_impl() |
->property_trees() |
@@ -2562,6 +2571,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationTransferedOnSyncTreeActivate) { |
std::unique_ptr<PendingPageScaleAnimation>(new PendingPageScaleAnimation( |
gfx::Vector2d(), false, target_scale, duration))); |
begin_frame_args.frame_time = halfway_through_animation; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_FALSE(did_request_next_frame_); |
@@ -2585,6 +2595,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationTransferedOnSyncTreeActivate) { |
did_request_redraw_ = false; |
did_request_next_frame_ = false; |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_redraw_); |
@@ -2594,6 +2605,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationTransferedOnSyncTreeActivate) { |
did_request_redraw_ = false; |
did_request_next_frame_ = false; |
begin_frame_args.frame_time = third_through_animation; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_redraw_); |
@@ -2606,6 +2618,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationTransferedOnSyncTreeActivate) { |
did_request_redraw_ = false; |
did_request_next_frame_ = false; |
begin_frame_args.frame_time = halfway_through_animation; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_redraw_); |
@@ -2616,6 +2629,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationTransferedOnSyncTreeActivate) { |
did_request_next_frame_ = false; |
did_request_commit_ = false; |
begin_frame_args.frame_time = end_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_commit_); |
@@ -2644,7 +2658,7 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationCompletedNotification) { |
base::TimeTicks end_time = start_time + duration; |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
host_impl_->active_tree()->PushPageScaleFromMainThread(1.f, 0.5f, 4.f); |
scroll_layer->layer_tree_impl() |
@@ -2658,18 +2672,21 @@ TEST_F(LayerTreeHostImplTest, PageScaleAnimationCompletedNotification) { |
gfx::Vector2d(), false, 2.f, duration))); |
host_impl_->ActivateSyncTree(); |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_FALSE(did_complete_page_scale_animation_); |
host_impl_->DidFinishImplFrame(); |
begin_frame_args.frame_time = halfway_through_animation; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_FALSE(did_complete_page_scale_animation_); |
host_impl_->DidFinishImplFrame(); |
begin_frame_args.frame_time = end_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_complete_page_scale_animation_); |
@@ -2720,7 +2737,7 @@ class LayerTreeHostImplOverridePhysicalTime : public LayerTreeHostImpl { |
0) {} |
BeginFrameArgs CurrentBeginFrameArgs() const override { |
- return CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, |
+ return CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1, |
fake_current_physical_time_); |
} |
@@ -2807,7 +2824,7 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest { |
// Before the scrollbar animation exists, we should not get redraws. |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, fake_now); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2, fake_now); |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_FALSE(did_request_next_frame_); |
@@ -2844,7 +2861,7 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest { |
if (expecting_animations) { |
// Before the scrollbar animation begins, we should not get redraws. |
begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, fake_now); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 3, fake_now); |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_FALSE(did_request_next_frame_); |
@@ -2864,7 +2881,7 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest { |
// After the scrollbar animation begins, we should start getting redraws. |
begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, fake_now); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 4, fake_now); |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_TRUE(did_request_next_frame_); |
@@ -2902,7 +2919,7 @@ class LayerTreeHostImplTestScrollbarAnimation : public LayerTreeHostImplTest { |
// Scrolling should have stopped the animation, so we should not be |
// getting redraws. |
begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, fake_now); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 5, fake_now); |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_FALSE(did_request_next_frame_); |
@@ -4826,12 +4843,13 @@ TEST_F(LayerTreeHostImplBrowserControlsTest, |
BOTH, SHOWN, true); |
base::TimeTicks start_time = base::TimeTicks::Now(); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
// Pump an animation frame to put some delta in the browser controls. |
{ |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(50); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -4858,6 +4876,7 @@ TEST_F(LayerTreeHostImplBrowserControlsTest, |
{ |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(200); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -7583,7 +7602,7 @@ TEST_F(LayerTreeHostImplTest, PartialSwapReceivesDamageRect) { |
layer_tree_host_impl->SetVisible(true); |
layer_tree_host_impl->InitializeRenderer(compositor_frame_sink.get()); |
layer_tree_host_impl->WillBeginImplFrame( |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE)); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2)); |
layer_tree_host_impl->SetViewportSize(gfx::Size(500, 500)); |
std::unique_ptr<LayerImpl> root = |
@@ -7712,7 +7731,7 @@ static std::unique_ptr<LayerTreeHostImpl> SetupLayersForOpacity( |
my_host_impl->SetVisible(true); |
my_host_impl->InitializeRenderer(compositor_frame_sink); |
my_host_impl->WillBeginImplFrame( |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE)); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2)); |
my_host_impl->SetViewportSize(gfx::Size(100, 100)); |
/* |
@@ -8977,7 +8996,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest, NoIdleAnimations) { |
->scroll_tree.UpdateScrollOffsetBaseForTesting(scroll_layer->id(), |
gfx::ScrollOffset(0, 10)); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2); |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_FALSE(did_request_redraw_); |
@@ -9184,7 +9203,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest, |
// The browser controls should properly animate until finished, despite the |
// scroll offset being at the origin. |
BeginFrameArgs begin_frame_args = CreateBeginFrameArgsForTesting( |
- BEGINFRAME_FROM_HERE, base::TimeTicks::Now()); |
+ BEGINFRAME_FROM_HERE, 0, 1, base::TimeTicks::Now()); |
while (did_request_next_frame_) { |
did_request_redraw_ = false; |
did_request_next_frame_ = false; |
@@ -9194,6 +9213,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest, |
host_impl_->browser_controls_manager()->ControlsTopOffset(); |
begin_frame_args.frame_time += base::TimeDelta::FromMilliseconds(5); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
EXPECT_EQ(gfx::Vector2dF().ToString(), |
@@ -9267,7 +9287,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest, |
// Animate the browser controls to the limit. |
BeginFrameArgs begin_frame_args = CreateBeginFrameArgsForTesting( |
- BEGINFRAME_FROM_HERE, base::TimeTicks::Now()); |
+ BEGINFRAME_FROM_HERE, 0, 1, base::TimeTicks::Now()); |
while (did_request_next_frame_) { |
did_request_redraw_ = false; |
did_request_next_frame_ = false; |
@@ -9277,6 +9297,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest, |
host_impl_->browser_controls_manager()->ControlsTopOffset(); |
begin_frame_args.frame_time += base::TimeDelta::FromMilliseconds(5); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
@@ -9343,7 +9364,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest, |
// Animate the browser controls to the limit. |
BeginFrameArgs begin_frame_args = CreateBeginFrameArgsForTesting( |
- BEGINFRAME_FROM_HERE, base::TimeTicks::Now()); |
+ BEGINFRAME_FROM_HERE, 0, 1, base::TimeTicks::Now()); |
while (did_request_next_frame_) { |
did_request_redraw_ = false; |
did_request_next_frame_ = false; |
@@ -9353,6 +9374,7 @@ TEST_F(LayerTreeHostImplWithBrowserControlsTest, |
host_impl_->browser_controls_manager()->ControlsTopOffset(); |
begin_frame_args.frame_time += base::TimeDelta::FromMilliseconds(5); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
@@ -10290,7 +10312,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimated) { |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(100); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
EXPECT_EQ( |
InputHandler::SCROLL_ON_IMPL_THREAD, |
@@ -10300,6 +10322,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimated) { |
EXPECT_EQ(host_impl_->OuterViewportScrollLayer(), scrolling_layer); |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10309,6 +10332,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimated) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(50); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10324,6 +10348,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimated) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(200); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10335,6 +10360,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimated) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(250); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10371,8 +10397,9 @@ TEST_F(LayerTreeHostImplTest, AnimatedScrollUpdateTargetBeforeStarting) { |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(200); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->UpdateAnimationState(true); |
host_impl_->DidFinishImplFrame(); |
@@ -10389,6 +10416,7 @@ TEST_F(LayerTreeHostImplTest, AnimatedScrollUpdateTargetBeforeStarting) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(250); |
+ begin_frame_args.sequence_number++; |
// This is when the animation above gets promoted to STARTING. |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->UpdateAnimationState(true); |
@@ -10396,6 +10424,7 @@ TEST_F(LayerTreeHostImplTest, AnimatedScrollUpdateTargetBeforeStarting) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(300); |
+ begin_frame_args.sequence_number++; |
// This is when the animation above gets ticked. |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->UpdateAnimationState(true); |
@@ -10419,7 +10448,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimatedWithDelay) { |
base::TimeTicks start_time = |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(100); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
// Create animation with a 100ms delay. |
EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, |
@@ -10432,6 +10461,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimatedWithDelay) { |
// First tick, animation is started. |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->UpdateAnimationState(true); |
EXPECT_EQ(gfx::ScrollOffset(), scrolling_layer->CurrentScrollOffset()); |
@@ -10441,6 +10471,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimatedWithDelay) { |
// the duration due to delay is 100ms. |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(50); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->UpdateAnimationState(true); |
EXPECT_EQ(50, scrolling_layer->CurrentScrollOffset().y()); |
@@ -10457,6 +10488,7 @@ TEST_F(LayerTreeHostImplTest, ScrollAnimatedWithDelay) { |
// target was called with a large value of jank. |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(100); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->UpdateAnimationState(true); |
EXPECT_LT(100, scrolling_layer->CurrentScrollOffset().y()); |
@@ -10475,7 +10507,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedAborted) { |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(100); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
// Perform animated scroll. |
EXPECT_EQ( |
@@ -10485,6 +10517,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedAborted) { |
LayerImpl* scrolling_layer = host_impl_->CurrentlyScrollingLayer(); |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10497,6 +10530,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedAborted) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(50); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10546,7 +10580,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(100); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
// Perform animated scroll. |
EXPECT_EQ( |
@@ -10556,6 +10590,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, |
LayerImpl* scrolling_layer = host_impl_->CurrentlyScrollingLayer(); |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10568,6 +10603,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(50); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10600,7 +10636,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimated) { |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(100); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
EXPECT_EQ( |
InputHandler::SCROLL_ON_IMPL_THREAD, |
@@ -10608,6 +10644,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimated) { |
LayerImpl* scrolling_layer = host_impl_->CurrentlyScrollingLayer(); |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10617,6 +10654,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimated) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(50); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10632,6 +10670,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimated) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(200); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10643,6 +10682,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimated) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(250); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10676,7 +10716,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ImplPinchZoomScrollAnimated) { |
base::TimeTicks start_time = |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(250); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, |
host_impl_->ScrollAnimated(gfx::Point(), gfx::Vector2d(10.f, 20.f)) |
.thread); |
@@ -10764,7 +10804,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ImplPinchZoomScrollAnimatedUpdate) { |
base::TimeTicks start_time = |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(50); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
EXPECT_EQ( |
InputHandler::SCROLL_ON_IMPL_THREAD, |
host_impl_->ScrollAnimated(gfx::Point(), gfx::Vector2d(90, 90)).thread); |
@@ -10816,7 +10856,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedNotUserScrollable) { |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(100); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
EXPECT_EQ( |
InputHandler::SCROLL_ON_IMPL_THREAD, |
@@ -10824,6 +10864,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedNotUserScrollable) { |
LayerImpl* scrolling_layer = host_impl_->CurrentlyScrollingLayer(); |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10833,6 +10874,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedNotUserScrollable) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(50); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10850,6 +10892,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedNotUserScrollable) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(200); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10861,6 +10904,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedNotUserScrollable) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(250); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10885,12 +10929,13 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedChangingBounds) { |
base::TimeTicks start_time = |
base::TimeTicks() + base::TimeDelta::FromMilliseconds(100); |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 1); |
host_impl_->ScrollAnimated(gfx::Point(), gfx::Vector2d(500, 500)); |
LayerImpl* scrolling_layer = host_impl_->CurrentlyScrollingLayer(); |
begin_frame_args.frame_time = start_time; |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -10904,6 +10949,7 @@ TEST_F(LayerTreeHostImplTimelinesTest, ScrollAnimatedChangingBounds) { |
begin_frame_args.frame_time = |
start_time + base::TimeDelta::FromMilliseconds(200); |
+ begin_frame_args.sequence_number++; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
host_impl_->Animate(); |
host_impl_->UpdateAnimationState(true); |
@@ -11193,7 +11239,7 @@ class FakeVideoFrameController : public VideoFrameController { |
TEST_F(LayerTreeHostImplTest, AddVideoFrameControllerInsideFrame) { |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2); |
FakeVideoFrameController controller; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
@@ -11216,7 +11262,7 @@ TEST_F(LayerTreeHostImplTest, AddVideoFrameControllerInsideFrame) { |
TEST_F(LayerTreeHostImplTest, AddVideoFrameControllerOutsideFrame) { |
BeginFrameArgs begin_frame_args = |
- CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 2); |
FakeVideoFrameController controller; |
host_impl_->WillBeginImplFrame(begin_frame_args); |
@@ -11226,7 +11272,7 @@ TEST_F(LayerTreeHostImplTest, AddVideoFrameControllerOutsideFrame) { |
host_impl_->AddVideoFrameController(&controller); |
EXPECT_FALSE(controller.begin_frame_args().IsValid()); |
- begin_frame_args = CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE); |
+ begin_frame_args = CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, 0, 3); |
EXPECT_FALSE(controller.begin_frame_args().IsValid()); |
host_impl_->WillBeginImplFrame(begin_frame_args); |
EXPECT_TRUE(controller.begin_frame_args().IsValid()); |