| 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 15 matching lines...) Expand all Loading... |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/animation/TimingCalculations.h" | 32 #include "core/animation/TimingCalculations.h" |
| 33 | 33 |
| 34 #include <gtest/gtest.h> | 34 #include <gtest/gtest.h> |
| 35 | 35 |
| 36 using namespace blink; | 36 namespace blink { |
| 37 | |
| 38 namespace { | |
| 39 | 37 |
| 40 TEST(AnimationTimingCalculationsTest, ActiveTime) | 38 TEST(AnimationTimingCalculationsTest, ActiveTime) |
| 41 { | 39 { |
| 42 Timing timing; | 40 Timing timing; |
| 43 | 41 |
| 44 // calculateActiveTime(activeDuration, fillMode, localTime, parentPhase, pha
se, timing) | 42 // calculateActiveTime(activeDuration, fillMode, localTime, parentPhase, pha
se, timing) |
| 45 | 43 |
| 46 // Before Phase | 44 // Before Phase |
| 47 timing.startDelay = 10; | 45 timing.startDelay = 10; |
| 48 EXPECT_TRUE(isNull(calculateActiveTime(20, Timing::FillModeForwards, 0, Anim
ationEffect::PhaseActive, AnimationEffect::PhaseBefore, timing))); | 46 EXPECT_TRUE(isNull(calculateActiveTime(20, Timing::FillModeForwards, 0, Anim
ationEffect::PhaseActive, AnimationEffect::PhaseBefore, timing))); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 202 |
| 205 // Timing function when iterationDuration is infinity | 203 // Timing function when iterationDuration is infinity |
| 206 timing.direction = Timing::PlaybackDirectionNormal; | 204 timing.direction = Timing::PlaybackDirectionNormal; |
| 207 EXPECT_EQ(0, calculateTransformedTime(0, std::numeric_limits<double>::infini
ty(), 0, timing)); | 205 EXPECT_EQ(0, calculateTransformedTime(0, std::numeric_limits<double>::infini
ty(), 0, timing)); |
| 208 EXPECT_EQ(1, calculateTransformedTime(0, std::numeric_limits<double>::infini
ty(), 1, timing)); | 206 EXPECT_EQ(1, calculateTransformedTime(0, std::numeric_limits<double>::infini
ty(), 1, timing)); |
| 209 timing.direction = Timing::PlaybackDirectionReverse; | 207 timing.direction = Timing::PlaybackDirectionReverse; |
| 210 EXPECT_EQ(std::numeric_limits<double>::infinity(), calculateTransformedTime(
0, std::numeric_limits<double>::infinity(), 0, timing)); | 208 EXPECT_EQ(std::numeric_limits<double>::infinity(), calculateTransformedTime(
0, std::numeric_limits<double>::infinity(), 0, timing)); |
| 211 EXPECT_EQ(std::numeric_limits<double>::infinity(), calculateTransformedTime(
0, std::numeric_limits<double>::infinity(), 1, timing)); | 209 EXPECT_EQ(std::numeric_limits<double>::infinity(), calculateTransformedTime(
0, std::numeric_limits<double>::infinity(), 1, timing)); |
| 212 } | 210 } |
| 213 | 211 |
| 214 } | 212 } // namespace blink |
| OLD | NEW |