| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } | 207 } |
| 208 | 208 |
| 209 TEST_F(AnimationAnimationPlayerTest, SetCurrentTimeMax) | 209 TEST_F(AnimationAnimationPlayerTest, SetCurrentTimeMax) |
| 210 { | 210 { |
| 211 player->setCurrentTimeInternal(std::numeric_limits<double>::max()); | 211 player->setCurrentTimeInternal(std::numeric_limits<double>::max()); |
| 212 EXPECT_EQ(std::numeric_limits<double>::max(), player->currentTimeInternal())
; | 212 EXPECT_EQ(std::numeric_limits<double>::max(), player->currentTimeInternal())
; |
| 213 simulateFrame(100); | 213 simulateFrame(100); |
| 214 EXPECT_EQ(std::numeric_limits<double>::max(), player->currentTimeInternal())
; | 214 EXPECT_EQ(std::numeric_limits<double>::max(), player->currentTimeInternal())
; |
| 215 } | 215 } |
| 216 | 216 |
| 217 TEST_F(AnimationAnimationPlayerTest, SetCurrentTimeUnrestrictedDouble) | |
| 218 { | |
| 219 simulateFrame(10); | |
| 220 player->setCurrentTime(nullValue()); | |
| 221 EXPECT_EQ(10, player->currentTimeInternal()); | |
| 222 player->setCurrentTime(std::numeric_limits<double>::infinity()); | |
| 223 EXPECT_EQ(10, player->currentTimeInternal()); | |
| 224 player->setCurrentTime(-std::numeric_limits<double>::infinity()); | |
| 225 EXPECT_EQ(10, player->currentTimeInternal()); | |
| 226 } | |
| 227 | |
| 228 | |
| 229 TEST_F(AnimationAnimationPlayerTest, SetCurrentTimeSetsStartTime) | 217 TEST_F(AnimationAnimationPlayerTest, SetCurrentTimeSetsStartTime) |
| 230 { | 218 { |
| 231 EXPECT_EQ(0, player->startTime()); | 219 EXPECT_EQ(0, player->startTime()); |
| 232 player->setCurrentTime(1000); | 220 player->setCurrentTime(1000); |
| 233 EXPECT_EQ(-1000, player->startTime()); | 221 EXPECT_EQ(-1000, player->startTime()); |
| 234 simulateFrame(1); | 222 simulateFrame(1); |
| 235 EXPECT_EQ(-1000, player->startTime()); | 223 EXPECT_EQ(-1000, player->startTime()); |
| 236 EXPECT_EQ(2000, player->currentTime()); | 224 EXPECT_EQ(2000, player->currentTime()); |
| 237 } | 225 } |
| 238 | 226 |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 EXPECT_EQ(AnimationPlayer::Idle, player->playStateInternal()); | 871 EXPECT_EQ(AnimationPlayer::Idle, player->playStateInternal()); |
| 884 EXPECT_TRUE(std::isnan(player->currentTime())); | 872 EXPECT_TRUE(std::isnan(player->currentTime())); |
| 885 EXPECT_TRUE(std::isnan(player->startTime())); | 873 EXPECT_TRUE(std::isnan(player->startTime())); |
| 886 player->pause(); | 874 player->pause(); |
| 887 EXPECT_EQ(AnimationPlayer::Idle, player->playStateInternal()); | 875 EXPECT_EQ(AnimationPlayer::Idle, player->playStateInternal()); |
| 888 EXPECT_TRUE(std::isnan(player->currentTime())); | 876 EXPECT_TRUE(std::isnan(player->currentTime())); |
| 889 EXPECT_TRUE(std::isnan(player->startTime())); | 877 EXPECT_TRUE(std::isnan(player->startTime())); |
| 890 } | 878 } |
| 891 | 879 |
| 892 } | 880 } |
| OLD | NEW |