| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 EXPECT_EQ(0, animation->currentTimeInternal()); | 564 EXPECT_EQ(0, animation->currentTimeInternal()); |
| 565 simulateFrame(1); | 565 simulateFrame(1); |
| 566 EXPECT_EQ(30, animation->currentTimeInternal()); | 566 EXPECT_EQ(30, animation->currentTimeInternal()); |
| 567 } | 567 } |
| 568 | 568 |
| 569 | 569 |
| 570 TEST_F(AnimationAnimationTest, SetEffect) | 570 TEST_F(AnimationAnimationTest, SetEffect) |
| 571 { | 571 { |
| 572 animation = timeline->play(0); | 572 animation = timeline->play(0); |
| 573 animation->setStartTime(0); | 573 animation->setStartTime(0); |
| 574 AnimationEffect* effect1 = makeAnimation(); | 574 AnimationEffectReadOnly* effect1 = makeAnimation(); |
| 575 AnimationEffect* effect2 = makeAnimation(); | 575 AnimationEffectReadOnly* effect2 = makeAnimation(); |
| 576 animation->setEffect(effect1); | 576 animation->setEffect(effect1); |
| 577 EXPECT_EQ(effect1, animation->effect()); | 577 EXPECT_EQ(effect1, animation->effect()); |
| 578 EXPECT_EQ(0, animation->currentTimeInternal()); | 578 EXPECT_EQ(0, animation->currentTimeInternal()); |
| 579 animation->setCurrentTimeInternal(15); | 579 animation->setCurrentTimeInternal(15); |
| 580 animation->setEffect(effect2); | 580 animation->setEffect(effect2); |
| 581 EXPECT_EQ(15, animation->currentTimeInternal()); | 581 EXPECT_EQ(15, animation->currentTimeInternal()); |
| 582 EXPECT_EQ(0, effect1->animation()); | 582 EXPECT_EQ(0, effect1->animation()); |
| 583 EXPECT_EQ(animation, effect2->animation()); | 583 EXPECT_EQ(animation, effect2->animation()); |
| 584 EXPECT_EQ(effect2, animation->effect()); | 584 EXPECT_EQ(effect2, animation->effect()); |
| 585 } | 585 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 610 animation = timeline->play(0); | 610 animation = timeline->play(0); |
| 611 animation->update(TimingUpdateOnDemand); | 611 animation->update(TimingUpdateOnDemand); |
| 612 EXPECT_EQ(std::numeric_limits<double>::infinity(), animation->timeToEffectCh
ange()); | 612 EXPECT_EQ(std::numeric_limits<double>::infinity(), animation->timeToEffectCh
ange()); |
| 613 | 613 |
| 614 simulateFrame(1234); | 614 simulateFrame(1234); |
| 615 EXPECT_EQ(std::numeric_limits<double>::infinity(), animation->timeToEffectCh
ange()); | 615 EXPECT_EQ(std::numeric_limits<double>::infinity(), animation->timeToEffectCh
ange()); |
| 616 } | 616 } |
| 617 | 617 |
| 618 TEST_F(AnimationAnimationTest, AnimationsDisassociateFromEffect) | 618 TEST_F(AnimationAnimationTest, AnimationsDisassociateFromEffect) |
| 619 { | 619 { |
| 620 AnimationEffect* animationNode = animation->effect(); | 620 AnimationEffectReadOnly* animationNode = animation->effect(); |
| 621 Animation* animation2 = timeline->play(animationNode); | 621 Animation* animation2 = timeline->play(animationNode); |
| 622 EXPECT_EQ(0, animation->effect()); | 622 EXPECT_EQ(0, animation->effect()); |
| 623 animation->setEffect(animationNode); | 623 animation->setEffect(animationNode); |
| 624 EXPECT_EQ(0, animation2->effect()); | 624 EXPECT_EQ(0, animation2->effect()); |
| 625 } | 625 } |
| 626 | 626 |
| 627 TEST_F(AnimationAnimationTest, AnimationsReturnTimeToNextEffect) | 627 TEST_F(AnimationAnimationTest, AnimationsReturnTimeToNextEffect) |
| 628 { | 628 { |
| 629 Timing timing; | 629 Timing timing; |
| 630 timing.startDelay = 1; | 630 timing.startDelay = 1; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 EXPECT_EQ(Animation::Idle, animation->playStateInternal()); | 817 EXPECT_EQ(Animation::Idle, animation->playStateInternal()); |
| 818 EXPECT_TRUE(std::isnan(animation->currentTime())); | 818 EXPECT_TRUE(std::isnan(animation->currentTime())); |
| 819 EXPECT_TRUE(std::isnan(animation->startTime())); | 819 EXPECT_TRUE(std::isnan(animation->startTime())); |
| 820 animation->pause(); | 820 animation->pause(); |
| 821 EXPECT_EQ(Animation::Pending, animation->playStateInternal()); | 821 EXPECT_EQ(Animation::Pending, animation->playStateInternal()); |
| 822 EXPECT_EQ(0, animation->currentTime()); | 822 EXPECT_EQ(0, animation->currentTime()); |
| 823 EXPECT_TRUE(std::isnan(animation->startTime())); | 823 EXPECT_TRUE(std::isnan(animation->startTime())); |
| 824 } | 824 } |
| 825 | 825 |
| 826 } // namespace blink | 826 } // namespace blink |
| OLD | NEW |