| 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 16 matching lines...) Expand all Loading... |
| 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/AnimationClock.h" | 32 #include "core/animation/AnimationClock.h" |
| 33 | 33 |
| 34 #include "wtf/OwnPtr.h" | 34 #include "wtf/OwnPtr.h" |
| 35 #include <gtest/gtest.h> | 35 #include <gtest/gtest.h> |
| 36 | 36 |
| 37 using namespace blink; | 37 namespace blink { |
| 38 | |
| 39 namespace { | |
| 40 | 38 |
| 41 class AnimationAnimationClockTest : public ::testing::Test { | 39 class AnimationAnimationClockTest : public ::testing::Test { |
| 42 public: | 40 public: |
| 43 AnimationAnimationClockTest() | 41 AnimationAnimationClockTest() |
| 44 : animationClock(mockTimeFunction) | 42 : animationClock(mockTimeFunction) |
| 45 { } | 43 { } |
| 44 |
| 46 protected: | 45 protected: |
| 47 virtual void SetUp() | 46 void SetUp() override |
| 48 { | 47 { |
| 49 mockTime = 0; | 48 mockTime = 0; |
| 50 animationClock.resetTimeForTesting(); | 49 animationClock.resetTimeForTesting(); |
| 51 } | 50 } |
| 52 | 51 |
| 53 static double mockTimeFunction() | 52 static double mockTimeFunction() |
| 54 { | 53 { |
| 55 return mockTime; | 54 return mockTime; |
| 56 } | 55 } |
| 57 | 56 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 EXPECT_EQ(100, animationClock.currentTime()); | 132 EXPECT_EQ(100, animationClock.currentTime()); |
| 134 | 133 |
| 135 mockTime = 100; | 134 mockTime = 100; |
| 136 AnimationClock::notifyTaskStart(); | 135 AnimationClock::notifyTaskStart(); |
| 137 EXPECT_EQ(100, animationClock.currentTime()); | 136 EXPECT_EQ(100, animationClock.currentTime()); |
| 138 | 137 |
| 139 mockTime = 150; | 138 mockTime = 150; |
| 140 EXPECT_EQ(100, animationClock.currentTime()); | 139 EXPECT_EQ(100, animationClock.currentTime()); |
| 141 } | 140 } |
| 142 | 141 |
| 143 } | 142 } // namespace blink |
| OLD | NEW |