diff options
Diffstat (limited to 'cc/trees/layer_tree_host_unittest_animation.cc')
-rw-r--r-- | cc/trees/layer_tree_host_unittest_animation.cc | 226 |
1 files changed, 113 insertions, 113 deletions
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index da4acb9..593c5c7 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -21,7 +21,7 @@ namespace { class LayerTreeHostAnimationTest : public LayerTreeTest { public: - virtual void SetupTree() OVERRIDE { + virtual void SetupTree() override { LayerTreeTest::SetupTree(); layer_tree_host()->root_layer()->set_layer_animation_delegate(this); } @@ -35,11 +35,11 @@ class LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested() : num_commits_(0) {} - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE { + virtual void BeginMainFrame(const BeginFrameArgs& args) override { // We skip the first commit because its the commit that populates the // impl thread with a tree. After the second commit, the test is done. if (num_commits_ != 1) @@ -52,7 +52,7 @@ class LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested // verify that CommitRequested has gone back to false. } - virtual void DidCommit() OVERRIDE { + virtual void DidCommit() override { if (!num_commits_) { EXPECT_FALSE(layer_tree_host()->CommitRequested()); layer_tree_host()->SetNeedsAnimate(); @@ -66,7 +66,7 @@ class LayerTreeHostAnimationTestSetNeedsAnimateShouldNotSetCommitRequested num_commits_++; } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: int num_commits_; @@ -86,11 +86,11 @@ class LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback() : num_begin_frames_(0) {} - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE { + virtual void BeginMainFrame(const BeginFrameArgs& args) override { if (!num_begin_frames_) { layer_tree_host()->SetNeedsAnimate(); num_begin_frames_++; @@ -99,7 +99,7 @@ class LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback EndTest(); } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: int num_begin_frames_; @@ -117,13 +117,13 @@ class LayerTreeHostAnimationTestAddAnimation LayerTreeHostAnimationTestAddAnimation() : num_begin_frames_(0), received_animation_started_notification_(false) {} - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddInstantAnimationToMainThread(layer_tree_host()->root_layer()); } virtual void UpdateAnimationState( LayerTreeHostImpl* host_impl, - bool has_unfinished_animation) OVERRIDE { + bool has_unfinished_animation) override { if (!num_begin_frames_) { // The animation had zero duration so LayerTreeHostImpl should no // longer need to animate its layers. @@ -148,7 +148,7 @@ class LayerTreeHostAnimationTestAddAnimation virtual void NotifyAnimationStarted( base::TimeTicks monotonic_time, - Animation::TargetProperty target_property) OVERRIDE { + Animation::TargetProperty target_property) override { received_animation_started_notification_ = true; start_time_ = monotonic_time; if (num_begin_frames_) { @@ -165,7 +165,7 @@ class LayerTreeHostAnimationTestAddAnimation } } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: int num_begin_frames_; @@ -183,17 +183,17 @@ class LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws() : started_animating_(false) {} - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddAnimationToMainThread(layer_tree_host()->root_layer()); } virtual void AnimateLayers( LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) OVERRIDE { + base::TimeTicks monotonic_time) override { started_animating_ = true; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { + virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) override { if (started_animating_) EndTest(); } @@ -201,11 +201,11 @@ class LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws virtual DrawResult PrepareToDrawOnThread( LayerTreeHostImpl* host_impl, LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) OVERRIDE { + DrawResult draw_result) override { return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; } - virtual void AfterTest() OVERRIDE { } + virtual void AfterTest() override { } private: bool started_animating_; @@ -221,13 +221,13 @@ class LayerTreeHostAnimationTestAnimationsGetDeleted LayerTreeHostAnimationTestAnimationsGetDeleted() : started_animating_(false) {} - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddAnimationToMainThread(layer_tree_host()->root_layer()); } virtual void AnimateLayers( LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) OVERRIDE { + base::TimeTicks monotonic_time) override { bool have_animations = !host_impl->animation_registrar()-> active_animation_controllers().empty(); if (!started_animating_ && have_animations) { @@ -241,13 +241,13 @@ class LayerTreeHostAnimationTestAnimationsGetDeleted virtual void NotifyAnimationFinished( base::TimeTicks monotonic_time, - Animation::TargetProperty target_property) OVERRIDE { + Animation::TargetProperty target_property) override { // Animations on the impl-side controller only get deleted during a commit, // so we need to schedule a commit. layer_tree_host()->SetNeedsCommit(); } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: bool started_animating_; @@ -262,7 +262,7 @@ class LayerTreeHostAnimationTestTickAnimationWhileBackgrounded LayerTreeHostAnimationTestTickAnimationWhileBackgrounded() : num_begin_frames_(0) {} - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddLongAnimationToMainThread(layer_tree_host()->root_layer()); } @@ -271,7 +271,7 @@ class LayerTreeHostAnimationTestTickAnimationWhileBackgrounded // mode. virtual void WillAnimateLayers( LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) OVERRIDE { + base::TimeTicks monotonic_time) override { // Verify that the host can draw, it's just not visible. EXPECT_TRUE(host_impl->CanDraw()); if (num_begin_frames_ < 2) { @@ -286,7 +286,7 @@ class LayerTreeHostAnimationTestTickAnimationWhileBackgrounded EndTest(); } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: int num_begin_frames_; @@ -304,18 +304,18 @@ class LayerTreeHostAnimationTestAnimationTickTimeIsMonotonic LayerTreeHostAnimationTestAnimationTickTimeIsMonotonic() : has_background_ticked_(false), num_foreground_animates_(0) {} - virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { + virtual void InitializeSettings(LayerTreeSettings* settings) override { // Make sure that drawing many times doesn't cause a checkerboarded // animation to start so we avoid flake in this test. settings->timeout_and_draw_when_animation_checkerboards = false; } - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddLongAnimationToMainThread(layer_tree_host()->root_layer()); } virtual void AnimateLayers(LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) OVERRIDE { + base::TimeTicks monotonic_time) override { EXPECT_GE(monotonic_time, last_tick_time_); last_tick_time_ = monotonic_time; if (host_impl->visible()) { @@ -333,13 +333,13 @@ class LayerTreeHostAnimationTestAnimationTickTimeIsMonotonic virtual DrawResult PrepareToDrawOnThread( LayerTreeHostImpl* host_impl, LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) OVERRIDE { + DrawResult draw_result) override { if (TestEnded()) return draw_result; return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: bool has_background_ticked_; @@ -358,22 +358,22 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree() : active_tree_was_animated_(false) {} - virtual base::TimeDelta LowFrequencyAnimationInterval() const OVERRIDE { + virtual base::TimeDelta LowFrequencyAnimationInterval() const override { return base::TimeDelta::FromMilliseconds(4); } - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddAnimationToMainThread(layer_tree_host()->root_layer()); } virtual void NotifyAnimationFinished( base::TimeTicks monotonic_time, - Animation::TargetProperty target_property) OVERRIDE { + Animation::TargetProperty target_property) override { // Replace animated commits with an empty tree. layer_tree_host()->SetRootLayer(make_scoped_refptr<Layer>(NULL)); } - virtual void DidCommit() OVERRIDE { + virtual void DidCommit() override { // This alternates setting an empty tree and a non-empty tree with an // animation. switch (layer_tree_host()->source_frame_number()) { @@ -394,14 +394,14 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree } } - virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { + virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { // At the start of every commit, block activations and make sure // we are backgrounded. host_impl->BlockNotifyReadyToActivateForTesting(true); PostSetVisibleToMainThread(false); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { + virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { if (!host_impl->settings().impl_side_painting) { // There are no activations to block if we're not impl-side-painting, // so just advance the test immediately. @@ -429,7 +429,7 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree host_impl->BlockNotifyReadyToActivateForTesting(false); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { + virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { active_tree_was_animated_ = false; // Verify that commits are actually alternating with empty / non-empty @@ -463,7 +463,7 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree } virtual void WillAnimateLayers(LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) OVERRIDE { + base::TimeTicks monotonic_time) override { EXPECT_TRUE(host_impl->active_tree()->root_layer()); active_tree_was_animated_ = true; } @@ -477,7 +477,7 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree PostSetVisibleToMainThread(true); } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} bool active_tree_was_animated_; }; @@ -491,20 +491,20 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction public: LayerTreeHostAnimationTestAddAnimationWithTimingFunction() {} - virtual void SetupTree() OVERRIDE { + virtual void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); layer_tree_host()->root_layer()->AddChild(content_); } - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddAnimationToMainThread(content_.get()); } virtual void AnimateLayers( LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) OVERRIDE { + base::TimeTicks monotonic_time) override { LayerAnimationController* controller_impl = host_impl->active_tree()->root_layer()->children()[0]-> layer_animation_controller(); @@ -528,7 +528,7 @@ class LayerTreeHostAnimationTestAddAnimationWithTimingFunction EndTest(); } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} FakeContentLayerClient client_; scoped_refptr<FakeContentLayer> content_; @@ -546,7 +546,7 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes : main_start_time_(-1.0), impl_start_time_(-1.0) {} - virtual void SetupTree() OVERRIDE { + virtual void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); @@ -554,13 +554,13 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes layer_tree_host()->root_layer()->AddChild(content_); } - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddAnimationToMainThread(content_.get()); } virtual void NotifyAnimationStarted( base::TimeTicks monotonic_time, - Animation::TargetProperty target_property) OVERRIDE { + Animation::TargetProperty target_property) override { LayerAnimationController* controller = layer_tree_host()->root_layer()->children()[0]-> layer_animation_controller(); @@ -576,7 +576,7 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes virtual void UpdateAnimationState( LayerTreeHostImpl* impl_host, - bool has_unfinished_animation) OVERRIDE { + bool has_unfinished_animation) override { LayerAnimationController* controller = impl_host->active_tree()->root_layer()->children()[0]-> layer_animation_controller(); @@ -593,7 +593,7 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes EndTest(); } - virtual void AfterTest() OVERRIDE { + virtual void AfterTest() override { EXPECT_FLOAT_EQ(impl_start_time_, main_start_time_); } @@ -613,13 +613,13 @@ class LayerTreeHostAnimationTestAnimationFinishedEvents public: LayerTreeHostAnimationTestAnimationFinishedEvents() {} - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddInstantAnimationToMainThread(layer_tree_host()->root_layer()); } virtual void NotifyAnimationFinished( base::TimeTicks monotonic_time, - Animation::TargetProperty target_property) OVERRIDE { + Animation::TargetProperty target_property) override { LayerAnimationController* controller = layer_tree_host()->root_layer()->layer_animation_controller(); Animation* animation = @@ -629,7 +629,7 @@ class LayerTreeHostAnimationTestAnimationFinishedEvents EndTest(); } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} }; SINGLE_AND_MULTI_THREAD_TEST_F( @@ -644,17 +644,17 @@ class LayerTreeHostAnimationTestDoNotSkipLayersWithAnimatedOpacity : update_check_layer_(FakeContentLayer::Create(&client_)) { } - virtual void SetupTree() OVERRIDE { + virtual void SetupTree() override { update_check_layer_->SetOpacity(0.f); layer_tree_host()->SetRootLayer(update_check_layer_); LayerTreeHostAnimationTest::SetupTree(); } - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddAnimationToMainThread(update_check_layer_.get()); } - virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { + virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) override { LayerAnimationController* controller_impl = host_impl->active_tree()->root_layer()->layer_animation_controller(); Animation* animation_impl = @@ -663,7 +663,7 @@ class LayerTreeHostAnimationTestDoNotSkipLayersWithAnimatedOpacity EndTest(); } - virtual void AfterTest() OVERRIDE { + virtual void AfterTest() override { // Update() should have been called once, proving that the layer was not // skipped. EXPECT_EQ(1u, update_check_layer_->update_count()); @@ -687,11 +687,11 @@ class LayerTreeHostAnimationTestLayerAddedWithAnimation public: LayerTreeHostAnimationTestLayerAddedWithAnimation() {} - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() OVERRIDE { + virtual void DidCommit() override { if (layer_tree_host()->source_frame_number() == 1) { scoped_refptr<Layer> layer = Layer::Create(); layer->set_layer_animation_delegate(this); @@ -710,11 +710,11 @@ class LayerTreeHostAnimationTestLayerAddedWithAnimation virtual void AnimateLayers( LayerTreeHostImpl* impl_host, - base::TimeTicks monotonic_time) OVERRIDE { + base::TimeTicks monotonic_time) override { EndTest(); } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} }; SINGLE_AND_MULTI_THREAD_TEST_F( @@ -726,9 +726,9 @@ class LayerTreeHostAnimationTestCancelAnimateCommit LayerTreeHostAnimationTestCancelAnimateCommit() : num_begin_frames_(0), num_commit_calls_(0), num_draw_calls_(0) {} - virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } + virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE { + virtual void BeginMainFrame(const BeginFrameArgs& args) override { num_begin_frames_++; // No-op animate will cancel the commit. if (layer_tree_host()->source_frame_number() == 1) { @@ -738,19 +738,19 @@ class LayerTreeHostAnimationTestCancelAnimateCommit layer_tree_host()->SetNeedsAnimate(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { + virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { num_commit_calls_++; if (impl->active_tree()->source_frame_number() > 1) FAIL() << "Commit should have been canceled."; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { + virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { num_draw_calls_++; if (impl->active_tree()->source_frame_number() > 1) FAIL() << "Draw should have been canceled."; } - virtual void AfterTest() OVERRIDE { + virtual void AfterTest() override { EXPECT_EQ(2, num_begin_frames_); EXPECT_EQ(1, num_commit_calls_); EXPECT_EQ(1, num_draw_calls_); @@ -772,23 +772,23 @@ class LayerTreeHostAnimationTestForceRedraw LayerTreeHostAnimationTestForceRedraw() : num_animate_(0), num_draw_layers_(0) {} - virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } + virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE { + virtual void BeginMainFrame(const BeginFrameArgs& args) override { if (++num_animate_ < 2) layer_tree_host()->SetNeedsAnimate(); } - virtual void Layout() OVERRIDE { + virtual void Layout() override { layer_tree_host()->SetNextCommitForcesRedraw(); } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { + virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { if (++num_draw_layers_ == 2) EndTest(); } - virtual void AfterTest() OVERRIDE { + virtual void AfterTest() override { // The first commit will always draw; make sure the second draw triggered // by the animation was not cancelled. EXPECT_EQ(2, num_draw_layers_); @@ -808,21 +808,21 @@ class LayerTreeHostAnimationTestAnimateAfterSetNeedsCommit LayerTreeHostAnimationTestAnimateAfterSetNeedsCommit() : num_animate_(0), num_draw_layers_(0) {} - virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } + virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE { + virtual void BeginMainFrame(const BeginFrameArgs& args) override { if (++num_animate_ <= 2) { layer_tree_host()->SetNeedsCommit(); layer_tree_host()->SetNeedsAnimate(); } } - virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { + virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) override { if (++num_draw_layers_ == 2) EndTest(); } - virtual void AfterTest() OVERRIDE { + virtual void AfterTest() override { // The first commit will always draw; make sure the second draw triggered // by the SetNeedsCommit was not cancelled. EXPECT_EQ(2, num_draw_layers_); @@ -843,7 +843,7 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw public: LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw() : started_times_(0) {} - virtual void SetupTree() OVERRIDE { + virtual void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); @@ -851,24 +851,24 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw layer_tree_host()->root_layer()->AddChild(content_); } - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { layer_tree_host()->SetViewportSize(gfx::Size()); PostAddAnimationToMainThread(content_.get()); } virtual void NotifyAnimationStarted( base::TimeTicks monotonic_time, - Animation::TargetProperty target_property) OVERRIDE { + Animation::TargetProperty target_property) override { started_times_++; } virtual void NotifyAnimationFinished( base::TimeTicks monotonic_time, - Animation::TargetProperty target_property) OVERRIDE { + Animation::TargetProperty target_property) override { EndTest(); } - virtual void AfterTest() OVERRIDE { + virtual void AfterTest() override { EXPECT_EQ(1, started_times_); } @@ -888,7 +888,7 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotVisible public: LayerTreeHostAnimationTestRunAnimationWhenNotVisible() : started_times_(0) {} - virtual void SetupTree() OVERRIDE { + virtual void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); @@ -896,32 +896,32 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotVisible layer_tree_host()->root_layer()->AddChild(content_); } - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { visible_ = true; PostAddAnimationToMainThread(content_.get()); } - virtual void DidCommit() OVERRIDE { + virtual void DidCommit() override { visible_ = false; layer_tree_host()->SetVisible(false); } virtual void NotifyAnimationStarted( base::TimeTicks monotonic_time, - Animation::TargetProperty target_property) OVERRIDE { + Animation::TargetProperty target_property) override { EXPECT_FALSE(visible_); started_times_++; } virtual void NotifyAnimationFinished( base::TimeTicks monotonic_time, - Animation::TargetProperty target_property) OVERRIDE { + Animation::TargetProperty target_property) override { EXPECT_FALSE(visible_); EXPECT_EQ(1, started_times_); EndTest(); } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: bool visible_; @@ -937,7 +937,7 @@ SINGLE_AND_MULTI_THREAD_TEST_F( // checkerboard. class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations : public LayerTreeHostAnimationTest { - virtual void SetupTree() OVERRIDE { + virtual void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = FakeContentLayer::Create(&client_); content_->SetBounds(gfx::Size(4, 4)); @@ -945,13 +945,13 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations layer_tree_host()->root_layer()->AddChild(content_); } - virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { + virtual void InitializeSettings(LayerTreeSettings* settings) override { // Make sure that drawing many times doesn't cause a checkerboarded // animation to start so we avoid flake in this test. settings->timeout_and_draw_when_animation_checkerboards = false; } - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { prevented_draw_ = 0; added_animations_ = 0; started_times_ = 0; @@ -962,7 +962,7 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations virtual DrawResult PrepareToDrawOnThread( LayerTreeHostImpl* host_impl, LayerTreeHostImpl::FrameData* frame_data, - DrawResult draw_result) OVERRIDE { + DrawResult draw_result) override { if (added_animations_ < 2) return draw_result; if (TestEnded()) @@ -974,7 +974,7 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; } - virtual void DidCommitAndDrawFrame() OVERRIDE { + virtual void DidCommitAndDrawFrame() override { switch (layer_tree_host()->source_frame_number()) { case 1: // The animation is longer than 1 BeginFrame interval. @@ -991,13 +991,13 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations virtual void NotifyAnimationStarted( base::TimeTicks monotonic_time, - Animation::TargetProperty target_property) OVERRIDE { + Animation::TargetProperty target_property) override { if (TestEnded()) return; started_times_++; } - virtual void AfterTest() OVERRIDE { + virtual void AfterTest() override { // Make sure we tried to draw the second animation but failed. EXPECT_LT(0, prevented_draw_); // The first animation should be started, but the second should not because @@ -1023,7 +1023,7 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated public: LayerTreeHostAnimationTestScrollOffsetChangesArePropagated() {} - virtual void SetupTree() OVERRIDE { + virtual void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); scroll_layer_ = FakeContentLayer::Create(&client_); @@ -1033,11 +1033,11 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated layer_tree_host()->root_layer()->AddChild(scroll_layer_); } - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() OVERRIDE { + virtual void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 1: { scoped_ptr<ScrollOffsetAnimationCurve> curve( @@ -1062,7 +1062,7 @@ class LayerTreeHostAnimationTestScrollOffsetChangesArePropagated } } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: FakeContentLayerClient client_; @@ -1080,22 +1080,22 @@ class LayerTreeHostAnimationTestFrozenAnimationTickTime LayerTreeHostAnimationTestFrozenAnimationTickTime() : started_animating_(false), num_commits_(0), num_draw_attempts_(2) {} - virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { + virtual void InitializeSettings(LayerTreeSettings* settings) override { // Make sure that drawing many times doesn't cause a checkerboarded // animation to start so we avoid flake in this test. settings->timeout_and_draw_when_animation_checkerboards = false; } - virtual void BeginTest() OVERRIDE { + virtual void BeginTest() override { PostAddAnimationToMainThread(layer_tree_host()->root_layer()); } - virtual void BeginMainFrame(const BeginFrameArgs& args) OVERRIDE { + virtual void BeginMainFrame(const BeginFrameArgs& args) override { last_main_thread_tick_time_ = args.frame_time; } virtual void AnimateLayers(LayerTreeHostImpl* host_impl, - base::TimeTicks monotonic_time) OVERRIDE { + base::TimeTicks monotonic_time) override { if (TestEnded()) return; if (!started_animating_) { @@ -1110,7 +1110,7 @@ class LayerTreeHostAnimationTestFrozenAnimationTickTime virtual DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, LayerTreeHostImpl::FrameData* frame, - DrawResult draw_result) OVERRIDE { + DrawResult draw_result) override { if (TestEnded()) return draw_result; num_draw_attempts_++; @@ -1121,7 +1121,7 @@ class LayerTreeHostAnimationTestFrozenAnimationTickTime return DRAW_ABORTED_CHECKERBOARD_ANIMATIONS; } - virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { + virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { if (!started_animating_) return; expected_impl_tick_time_ = @@ -1129,7 +1129,7 @@ class LayerTreeHostAnimationTestFrozenAnimationTickTime num_commits_++; } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: bool started_animating_; @@ -1151,9 +1151,9 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers() : frame_count_with_pending_tree_(0) {} - virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } + virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() OVERRIDE { + virtual void DidCommit() override { if (layer_tree_host()->source_frame_number() == 1) { AddAnimatedTransformToLayer(layer_tree_host()->root_layer(), 4, 1, 1); } else if (layer_tree_host()->source_frame_number() == 2) { @@ -1168,11 +1168,11 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers } } - virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { + virtual void BeginCommitOnThread(LayerTreeHostImpl* host_impl) override { host_impl->BlockNotifyReadyToActivateForTesting(true); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { + virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { // For the commit that added animations to new and existing layers, keep // blocking activation. We want to verify that even with activation blocked, // the animation on the layer that's already in the active tree won't get a @@ -1183,7 +1183,7 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers } virtual void WillBeginImplFrameOnThread(LayerTreeHostImpl* host_impl, - const BeginFrameArgs& args) OVERRIDE { + const BeginFrameArgs& args) override { if (!host_impl->pending_tree() || host_impl->pending_tree()->source_frame_number() != 2) return; @@ -1194,7 +1194,7 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers } virtual void UpdateAnimationState(LayerTreeHostImpl* host_impl, - bool has_unfinished_animation) OVERRIDE { + bool has_unfinished_animation) override { LayerAnimationController* root_controller_impl = host_impl->active_tree()->root_layer()->layer_animation_controller(); Animation* root_animation = @@ -1215,7 +1215,7 @@ class LayerTreeHostAnimationTestAnimationsAddedToNewAndExistingLayers EndTest(); } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: int frame_count_with_pending_tree_; @@ -1230,16 +1230,16 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating LayerTreeHostAnimationTestAddAnimationAfterAnimating() : num_swap_buffers_(0) {} - virtual void SetupTree() OVERRIDE { + virtual void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); content_ = Layer::Create(); content_->SetBounds(gfx::Size(4, 4)); layer_tree_host()->root_layer()->AddChild(content_); } - virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } + virtual void BeginTest() override { PostSetNeedsCommitToMainThread(); } - virtual void DidCommit() OVERRIDE { + virtual void DidCommit() override { switch (layer_tree_host()->source_frame_number()) { case 1: // First frame: add an animation to the root layer. @@ -1254,7 +1254,7 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating } virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, - bool result) OVERRIDE { + bool result) override { // After both animations have started, verify that they have valid // start times. num_swap_buffers_++; @@ -1279,7 +1279,7 @@ class LayerTreeHostAnimationTestAddAnimationAfterAnimating } } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() override {} private: scoped_refptr<Layer> content_; |