| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 EXPECT_TRUE(test_controller.animator()->is_animating()); | 343 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 344 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), start_opacity); | 344 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), start_opacity); |
| 345 | 345 |
| 346 base::TimeTicks start_time = test_controller.animator()->last_step_time(); | 346 base::TimeTicks start_time = test_controller.animator()->last_step_time(); |
| 347 base::TimeTicks effective_start = start_time + delta; | 347 base::TimeTicks effective_start = start_time + delta; |
| 348 | 348 |
| 349 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 349 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 350 cc::AnimationEvent::Started, | 350 cc::AnimationEvent::Started, |
| 351 0, | 351 0, |
| 352 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 352 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 353 animation_group_id(), | 353 ->animation_group_id(), |
| 354 cc::Animation::Opacity, | 354 cc::Animation::Opacity, |
| 355 (effective_start - base::TimeTicks()).InSecondsF())); | 355 effective_start)); |
| 356 | 356 |
| 357 element->Step(effective_start + delta/2); | 357 element->Step(effective_start + delta/2); |
| 358 | 358 |
| 359 EXPECT_TRUE(test_controller.animator()->is_animating()); | 359 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 360 EXPECT_NEAR( | 360 EXPECT_NEAR( |
| 361 0.5, | 361 0.5, |
| 362 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 362 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> |
| 363 last_progressed_fraction(), | 363 last_progressed_fraction(), |
| 364 epsilon); | 364 epsilon); |
| 365 | 365 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 EXPECT_TRUE(test_controller.animator()->is_animating()); | 458 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 459 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), start_opacity); | 459 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), start_opacity); |
| 460 CheckApproximatelyEqual(delegate.GetBoundsForAnimation(), start_bounds); | 460 CheckApproximatelyEqual(delegate.GetBoundsForAnimation(), start_bounds); |
| 461 | 461 |
| 462 base::TimeTicks start_time = test_controller.animator()->last_step_time(); | 462 base::TimeTicks start_time = test_controller.animator()->last_step_time(); |
| 463 base::TimeTicks effective_start = start_time + delta; | 463 base::TimeTicks effective_start = start_time + delta; |
| 464 | 464 |
| 465 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 465 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 466 cc::AnimationEvent::Started, | 466 cc::AnimationEvent::Started, |
| 467 0, | 467 0, |
| 468 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 468 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 469 animation_group_id(), | 469 ->animation_group_id(), |
| 470 cc::Animation::Opacity, | 470 cc::Animation::Opacity, |
| 471 (effective_start - base::TimeTicks()).InSecondsF())); | 471 effective_start)); |
| 472 | 472 |
| 473 element->Step(effective_start + delta/2); | 473 element->Step(effective_start + delta/2); |
| 474 | 474 |
| 475 EXPECT_TRUE(test_controller.animator()->is_animating()); | 475 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 476 EXPECT_NEAR( | 476 EXPECT_NEAR( |
| 477 0.5, | 477 0.5, |
| 478 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 478 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> |
| 479 last_progressed_fraction(), | 479 last_progressed_fraction(), |
| 480 epsilon); | 480 epsilon); |
| 481 CheckApproximatelyEqual(delegate.GetBoundsForAnimation(), middle_bounds); | 481 CheckApproximatelyEqual(delegate.GetBoundsForAnimation(), middle_bounds); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 | 736 |
| 737 EXPECT_TRUE(test_controller.animator()->is_animating()); | 737 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 738 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), start_opacity); | 738 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), start_opacity); |
| 739 | 739 |
| 740 base::TimeTicks start_time = test_controller.animator()->last_step_time(); | 740 base::TimeTicks start_time = test_controller.animator()->last_step_time(); |
| 741 base::TimeTicks effective_start = start_time + delta; | 741 base::TimeTicks effective_start = start_time + delta; |
| 742 | 742 |
| 743 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 743 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 744 cc::AnimationEvent::Started, | 744 cc::AnimationEvent::Started, |
| 745 0, | 745 0, |
| 746 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 746 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 747 animation_group_id(), | 747 ->animation_group_id(), |
| 748 cc::Animation::Opacity, | 748 cc::Animation::Opacity, |
| 749 (effective_start - base::TimeTicks()).InSecondsF())); | 749 effective_start)); |
| 750 | 750 |
| 751 element->Step(effective_start + delta/2); | 751 element->Step(effective_start + delta/2); |
| 752 | 752 |
| 753 EXPECT_TRUE(test_controller.animator()->is_animating()); | 753 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 754 EXPECT_NEAR( | 754 EXPECT_NEAR( |
| 755 0.5, | 755 0.5, |
| 756 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 756 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> |
| 757 last_progressed_fraction(), | 757 last_progressed_fraction(), |
| 758 epsilon); | 758 epsilon); |
| 759 | 759 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 test_controller.animator()->StartAnimation( | 869 test_controller.animator()->StartAnimation( |
| 870 new LayerAnimationSequence( | 870 new LayerAnimationSequence( |
| 871 LayerAnimationElement::CreateOpacityElement(target_opacity, delta))); | 871 LayerAnimationElement::CreateOpacityElement(target_opacity, delta))); |
| 872 | 872 |
| 873 base::TimeTicks start_time = test_controller.animator()->last_step_time(); | 873 base::TimeTicks start_time = test_controller.animator()->last_step_time(); |
| 874 base::TimeTicks effective_start = start_time + delta; | 874 base::TimeTicks effective_start = start_time + delta; |
| 875 | 875 |
| 876 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 876 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 877 cc::AnimationEvent::Started, | 877 cc::AnimationEvent::Started, |
| 878 0, | 878 0, |
| 879 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 879 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 880 animation_group_id(), | 880 ->animation_group_id(), |
| 881 cc::Animation::Opacity, | 881 cc::Animation::Opacity, |
| 882 (effective_start - base::TimeTicks()).InSecondsF())); | 882 effective_start)); |
| 883 | 883 |
| 884 element->Step(effective_start + delta/2); | 884 element->Step(effective_start + delta/2); |
| 885 | 885 |
| 886 test_controller.animator()->StartAnimation( | 886 test_controller.animator()->StartAnimation( |
| 887 new LayerAnimationSequence( | 887 new LayerAnimationSequence( |
| 888 LayerAnimationElement::CreateOpacityElement(start_opacity, delta))); | 888 LayerAnimationElement::CreateOpacityElement(start_opacity, delta))); |
| 889 | 889 |
| 890 EXPECT_TRUE(test_controller.animator()->is_animating()); | 890 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 891 EXPECT_NEAR(delegate.GetOpacityForAnimation(), middle_opacity, epsilon); | 891 EXPECT_NEAR(delegate.GetOpacityForAnimation(), middle_opacity, epsilon); |
| 892 | 892 |
| 893 test_controller.animator()->StartAnimation( | 893 test_controller.animator()->StartAnimation( |
| 894 new LayerAnimationSequence( | 894 new LayerAnimationSequence( |
| 895 LayerAnimationElement::CreateOpacityElement(start_opacity, delta))); | 895 LayerAnimationElement::CreateOpacityElement(start_opacity, delta))); |
| 896 | 896 |
| 897 EXPECT_TRUE(test_controller.animator()->is_animating()); | 897 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 898 | 898 |
| 899 base::TimeTicks second_effective_start = effective_start + delta; | 899 base::TimeTicks second_effective_start = effective_start + delta; |
| 900 | 900 |
| 901 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 901 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 902 cc::AnimationEvent::Started, | 902 cc::AnimationEvent::Started, |
| 903 0, | 903 0, |
| 904 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 904 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 905 animation_group_id(), | 905 ->animation_group_id(), |
| 906 cc::Animation::Opacity, | 906 cc::Animation::Opacity, |
| 907 (second_effective_start - base::TimeTicks()).InSecondsF())); | 907 second_effective_start)); |
| 908 | 908 |
| 909 element->Step(second_effective_start + delta/2); | 909 element->Step(second_effective_start + delta/2); |
| 910 | 910 |
| 911 EXPECT_TRUE(test_controller.animator()->is_animating()); | 911 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 912 EXPECT_NEAR( | 912 EXPECT_NEAR( |
| 913 0.5, | 913 0.5, |
| 914 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 914 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> |
| 915 last_progressed_fraction(), | 915 last_progressed_fraction(), |
| 916 epsilon); | 916 epsilon); |
| 917 | 917 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 LayerAnimationElement::CreateBrightnessElement(target_brightness, | 1211 LayerAnimationElement::CreateBrightnessElement(target_brightness, |
| 1212 delta) | 1212 delta) |
| 1213 )); | 1213 )); |
| 1214 | 1214 |
| 1215 base::TimeTicks start_time = test_controller.animator()->last_step_time(); | 1215 base::TimeTicks start_time = test_controller.animator()->last_step_time(); |
| 1216 base::TimeTicks effective_start = start_time + delta; | 1216 base::TimeTicks effective_start = start_time + delta; |
| 1217 | 1217 |
| 1218 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 1218 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 1219 cc::AnimationEvent::Started, | 1219 cc::AnimationEvent::Started, |
| 1220 0, | 1220 0, |
| 1221 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 1221 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 1222 animation_group_id(), | 1222 ->animation_group_id(), |
| 1223 cc::Animation::Opacity, | 1223 cc::Animation::Opacity, |
| 1224 (effective_start - base::TimeTicks()).InSecondsF())); | 1224 effective_start)); |
| 1225 | 1225 |
| 1226 element->Step(effective_start + delta/2); | 1226 element->Step(effective_start + delta/2); |
| 1227 | 1227 |
| 1228 test_controller.animator()->StartTogether( | 1228 test_controller.animator()->StartTogether( |
| 1229 CreateMultiSequence( | 1229 CreateMultiSequence( |
| 1230 LayerAnimationElement::CreateOpacityElement(start_opacity, delta), | 1230 LayerAnimationElement::CreateOpacityElement(start_opacity, delta), |
| 1231 LayerAnimationElement::CreateBrightnessElement(start_brightness, | 1231 LayerAnimationElement::CreateBrightnessElement(start_brightness, |
| 1232 delta))); | 1232 delta))); |
| 1233 | 1233 |
| 1234 EXPECT_TRUE(test_controller.animator()->is_animating()); | 1234 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 1235 EXPECT_NEAR(delegate.GetOpacityForAnimation(), middle_opacity, epsilon); | 1235 EXPECT_NEAR(delegate.GetOpacityForAnimation(), middle_opacity, epsilon); |
| 1236 EXPECT_NEAR(delegate.GetBrightnessForAnimation(), middle_brightness, epsilon); | 1236 EXPECT_NEAR(delegate.GetBrightnessForAnimation(), middle_brightness, epsilon); |
| 1237 | 1237 |
| 1238 test_controller.animator()->StartTogether( | 1238 test_controller.animator()->StartTogether( |
| 1239 CreateMultiSequence( | 1239 CreateMultiSequence( |
| 1240 LayerAnimationElement::CreateOpacityElement(start_opacity, delta), | 1240 LayerAnimationElement::CreateOpacityElement(start_opacity, delta), |
| 1241 LayerAnimationElement::CreateBrightnessElement(start_brightness, | 1241 LayerAnimationElement::CreateBrightnessElement(start_brightness, |
| 1242 delta))); | 1242 delta))); |
| 1243 | 1243 |
| 1244 EXPECT_TRUE(test_controller.animator()->is_animating()); | 1244 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 1245 | 1245 |
| 1246 base::TimeTicks second_effective_start = effective_start + delta; | 1246 base::TimeTicks second_effective_start = effective_start + delta; |
| 1247 | 1247 |
| 1248 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 1248 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 1249 cc::AnimationEvent::Started, | 1249 cc::AnimationEvent::Started, |
| 1250 0, | 1250 0, |
| 1251 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 1251 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 1252 animation_group_id(), | 1252 ->animation_group_id(), |
| 1253 cc::Animation::Opacity, | 1253 cc::Animation::Opacity, |
| 1254 (second_effective_start - base::TimeTicks()).InSecondsF())); | 1254 second_effective_start)); |
| 1255 | 1255 |
| 1256 element->Step(second_effective_start + delta/2); | 1256 element->Step(second_effective_start + delta/2); |
| 1257 | 1257 |
| 1258 EXPECT_TRUE(test_controller.animator()->is_animating()); | 1258 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 1259 EXPECT_NEAR( | 1259 EXPECT_NEAR( |
| 1260 0.5, | 1260 0.5, |
| 1261 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 1261 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> |
| 1262 last_progressed_fraction(), | 1262 last_progressed_fraction(), |
| 1263 epsilon); | 1263 epsilon); |
| 1264 EXPECT_NEAR(delegate.GetBrightnessForAnimation(), | 1264 EXPECT_NEAR(delegate.GetBrightnessForAnimation(), |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 sequence->set_is_cyclic(true); | 1498 sequence->set_is_cyclic(true); |
| 1499 | 1499 |
| 1500 test_controller.animator()->StartAnimation(sequence.release()); | 1500 test_controller.animator()->StartAnimation(sequence.release()); |
| 1501 | 1501 |
| 1502 base::TimeTicks start_time = test_controller.animator()->last_step_time(); | 1502 base::TimeTicks start_time = test_controller.animator()->last_step_time(); |
| 1503 base::TimeTicks effective_start = start_time + delta; | 1503 base::TimeTicks effective_start = start_time + delta; |
| 1504 | 1504 |
| 1505 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 1505 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 1506 cc::AnimationEvent::Started, | 1506 cc::AnimationEvent::Started, |
| 1507 0, | 1507 0, |
| 1508 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 1508 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 1509 animation_group_id(), | 1509 ->animation_group_id(), |
| 1510 cc::Animation::Opacity, | 1510 cc::Animation::Opacity, |
| 1511 (effective_start - base::TimeTicks()).InSecondsF())); | 1511 effective_start)); |
| 1512 | 1512 |
| 1513 element->Step(effective_start + delta); | 1513 element->Step(effective_start + delta); |
| 1514 EXPECT_TRUE(test_controller.animator()->is_animating()); | 1514 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 1515 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), target_opacity); | 1515 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), target_opacity); |
| 1516 | 1516 |
| 1517 base::TimeTicks second_effective_start = effective_start + 2 * delta; | 1517 base::TimeTicks second_effective_start = effective_start + 2 * delta; |
| 1518 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 1518 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 1519 cc::AnimationEvent::Started, | 1519 cc::AnimationEvent::Started, |
| 1520 0, | 1520 0, |
| 1521 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 1521 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 1522 animation_group_id(), | 1522 ->animation_group_id(), |
| 1523 cc::Animation::Opacity, | 1523 cc::Animation::Opacity, |
| 1524 (second_effective_start - base::TimeTicks()).InSecondsF())); | 1524 second_effective_start)); |
| 1525 | 1525 |
| 1526 element->Step(second_effective_start + delta); | 1526 element->Step(second_effective_start + delta); |
| 1527 | 1527 |
| 1528 EXPECT_TRUE(test_controller.animator()->is_animating()); | 1528 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 1529 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), start_opacity); | 1529 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), start_opacity); |
| 1530 | 1530 |
| 1531 base::TimeTicks third_effective_start = second_effective_start + 2 * delta; | 1531 base::TimeTicks third_effective_start = second_effective_start + 2 * delta; |
| 1532 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 1532 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 1533 cc::AnimationEvent::Started, | 1533 cc::AnimationEvent::Started, |
| 1534 0, | 1534 0, |
| 1535 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 1535 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 1536 animation_group_id(), | 1536 ->animation_group_id(), |
| 1537 cc::Animation::Opacity, | 1537 cc::Animation::Opacity, |
| 1538 (third_effective_start - base::TimeTicks()).InSecondsF())); | 1538 third_effective_start)); |
| 1539 | 1539 |
| 1540 element->Step(third_effective_start + delta); | 1540 element->Step(third_effective_start + delta); |
| 1541 EXPECT_TRUE(test_controller.animator()->is_animating()); | 1541 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 1542 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), target_opacity); | 1542 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), target_opacity); |
| 1543 | 1543 |
| 1544 base::TimeTicks fourth_effective_start = third_effective_start + 2 * delta; | 1544 base::TimeTicks fourth_effective_start = third_effective_start + 2 * delta; |
| 1545 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 1545 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 1546 cc::AnimationEvent::Started, | 1546 cc::AnimationEvent::Started, |
| 1547 0, | 1547 0, |
| 1548 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 1548 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 1549 animation_group_id(), | 1549 ->animation_group_id(), |
| 1550 cc::Animation::Opacity, | 1550 cc::Animation::Opacity, |
| 1551 (fourth_effective_start - base::TimeTicks()).InSecondsF())); | 1551 fourth_effective_start)); |
| 1552 | 1552 |
| 1553 // Skip ahead by a lot. | 1553 // Skip ahead by a lot. |
| 1554 element->Step(fourth_effective_start + 1000 * delta); | 1554 element->Step(fourth_effective_start + 1000 * delta); |
| 1555 | 1555 |
| 1556 EXPECT_TRUE(test_controller.animator()->is_animating()); | 1556 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 1557 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), target_opacity); | 1557 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), target_opacity); |
| 1558 | 1558 |
| 1559 base::TimeTicks fifth_effective_start = fourth_effective_start + 1001 * delta; | 1559 base::TimeTicks fifth_effective_start = fourth_effective_start + 1001 * delta; |
| 1560 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( | 1560 test_controller.animator()->OnThreadedAnimationStarted(cc::AnimationEvent( |
| 1561 cc::AnimationEvent::Started, | 1561 cc::AnimationEvent::Started, |
| 1562 0, | 1562 0, |
| 1563 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY)-> | 1563 test_controller.GetRunningSequence(LayerAnimationElement::OPACITY) |
| 1564 animation_group_id(), | 1564 ->animation_group_id(), |
| 1565 cc::Animation::Opacity, | 1565 cc::Animation::Opacity, |
| 1566 (fifth_effective_start - base::TimeTicks()).InSecondsF())); | 1566 fifth_effective_start)); |
| 1567 | 1567 |
| 1568 // Skip ahead by a lot. | 1568 // Skip ahead by a lot. |
| 1569 element->Step(fifth_effective_start + 999 * delta); | 1569 element->Step(fifth_effective_start + 999 * delta); |
| 1570 | 1570 |
| 1571 EXPECT_TRUE(test_controller.animator()->is_animating()); | 1571 EXPECT_TRUE(test_controller.animator()->is_animating()); |
| 1572 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), start_opacity); | 1572 EXPECT_FLOAT_EQ(delegate.GetOpacityForAnimation(), start_opacity); |
| 1573 | 1573 |
| 1574 test_controller.animator()->StopAnimatingProperty( | 1574 test_controller.animator()->StopAnimatingProperty( |
| 1575 LayerAnimationElement::OPACITY); | 1575 LayerAnimationElement::OPACITY); |
| 1576 | 1576 |
| (...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 | 2519 |
| 2520 parent.SetTransform(parent_end); | 2520 parent.SetTransform(parent_end); |
| 2521 | 2521 |
| 2522 EXPECT_TRUE(child.GetAnimator()->is_animating()); | 2522 EXPECT_TRUE(child.GetAnimator()->is_animating()); |
| 2523 EXPECT_TRUE(child.GetTargetTransform().IsIdentity()) | 2523 EXPECT_TRUE(child.GetTargetTransform().IsIdentity()) |
| 2524 << child.GetTargetTransform().ToString(); | 2524 << child.GetTargetTransform().ToString(); |
| 2525 | 2525 |
| 2526 } | 2526 } |
| 2527 | 2527 |
| 2528 } // namespace ui | 2528 } // namespace ui |
| OLD | NEW |