OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/compositor/layer_animator.h" | 5 #include "ui/compositor/layer_animator.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2445 collection->OnAnimationStep(null); | 2445 collection->OnAnimationStep(null); |
2446 EXPECT_TRUE(collection->last_tick_time().is_null()); | 2446 EXPECT_TRUE(collection->last_tick_time().is_null()); |
2447 | 2447 |
2448 // Adding an animator to the collection should update the last tick time. | 2448 // Adding an animator to the collection should update the last tick time. |
2449 collection->StartAnimator(layer.GetAnimator()); | 2449 collection->StartAnimator(layer.GetAnimator()); |
2450 EXPECT_TRUE(collection->HasActiveAnimators()); | 2450 EXPECT_TRUE(collection->HasActiveAnimators()); |
2451 EXPECT_FALSE(collection->last_tick_time().is_null()); | 2451 EXPECT_FALSE(collection->last_tick_time().is_null()); |
2452 | 2452 |
2453 collection->StopAnimator(layer.GetAnimator()); | 2453 collection->StopAnimator(layer.GetAnimator()); |
2454 EXPECT_FALSE(collection->HasActiveAnimators()); | 2454 EXPECT_FALSE(collection->HasActiveAnimators()); |
| 2455 |
| 2456 animator->SetDelegate(nullptr); |
2455 } | 2457 } |
2456 | 2458 |
2457 TEST(LayerAnimatorTest, AnimatorStartedCorrectly) { | 2459 TEST(LayerAnimatorTest, AnimatorStartedCorrectly) { |
2458 Layer layer; | 2460 Layer layer; |
2459 LayerAnimatorTestController test_controller(layer.GetAnimator()); | 2461 LayerAnimatorTestController test_controller(layer.GetAnimator()); |
2460 LayerAnimator* animator = test_controller.animator(); | 2462 LayerAnimator* animator = test_controller.animator(); |
2461 ASSERT_FALSE(animator->is_started_); | 2463 ASSERT_FALSE(animator->is_started_); |
2462 | 2464 |
2463 TestLayerAnimationDelegate test_delegate; | 2465 TestLayerAnimationDelegate test_delegate; |
2464 animator->SetDelegate(&test_delegate); | 2466 animator->SetDelegate(&test_delegate); |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2795 EXPECT_EQ(observer.last_ended_sequence(), nullptr); | 2797 EXPECT_EQ(observer.last_ended_sequence(), nullptr); |
2796 EXPECT_EQ(observer.last_detached_sequence(), first_sequence); | 2798 EXPECT_EQ(observer.last_detached_sequence(), first_sequence); |
2797 | 2799 |
2798 EXPECT_TRUE(observer.AbortedEpochIsBeforeDetachedEpoch()); | 2800 EXPECT_TRUE(observer.AbortedEpochIsBeforeDetachedEpoch()); |
2799 EXPECT_TRUE(observer.AbortedEpochIsBeforeStartedEpoch()); | 2801 EXPECT_TRUE(observer.AbortedEpochIsBeforeStartedEpoch()); |
2800 EXPECT_TRUE(observer.AttachedEpochIsBeforeScheduledEpoch()); | 2802 EXPECT_TRUE(observer.AttachedEpochIsBeforeScheduledEpoch()); |
2801 EXPECT_TRUE(observer.ScheduledEpochIsBeforeStartedEpoch()); | 2803 EXPECT_TRUE(observer.ScheduledEpochIsBeforeStartedEpoch()); |
2802 } | 2804 } |
2803 | 2805 |
2804 } // namespace ui | 2806 } // namespace ui |
OLD | NEW |