| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 { | 49 { |
| 50 document = Document::create(); | 50 document = Document::create(); |
| 51 document->animationClock().resetTimeForTesting(); | 51 document->animationClock().resetTimeForTesting(); |
| 52 timeline = DocumentTimeline::create(document.get()); | 52 timeline = DocumentTimeline::create(document.get()); |
| 53 player = Player::create(*timeline, 0); | 53 player = Player::create(*timeline, 0); |
| 54 timeline->setZeroTime(0); | 54 timeline->setZeroTime(0); |
| 55 } | 55 } |
| 56 | 56 |
| 57 bool updateTimeline(double time, double* timeToEffectChange = 0) | 57 bool updateTimeline(double time, double* timeToEffectChange = 0) |
| 58 { | 58 { |
| 59 timeline->serviceAnimations(time); | 59 document->animationClock().updateTime(time); |
| 60 // The timeline does not know about our player, so we have to explicitly
call update(). | 60 // The timeline does not know about our player, so we have to explicitly
call update(). |
| 61 return player->update(timeToEffectChange); | 61 return player->update(timeToEffectChange); |
| 62 } | 62 } |
| 63 | 63 |
| 64 RefPtr<Document> document; | 64 RefPtr<Document> document; |
| 65 RefPtr<DocumentTimeline> timeline; | 65 RefPtr<DocumentTimeline> timeline; |
| 66 RefPtr<Player> player; | 66 RefPtr<Player> player; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 TEST_F(CoreAnimationPlayerTest, InitialState) | 69 TEST_F(CoreAnimationPlayerTest, InitialState) |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 EXPECT_EQ(0, timeToNextEffect); | 295 EXPECT_EQ(0, timeToNextEffect); |
| 296 | 296 |
| 297 updateTimeline(2, &timeToNextEffect); | 297 updateTimeline(2, &timeToNextEffect); |
| 298 EXPECT_EQ(std::numeric_limits<double>::infinity(), timeToNextEffect); | 298 EXPECT_EQ(std::numeric_limits<double>::infinity(), timeToNextEffect); |
| 299 | 299 |
| 300 updateTimeline(3, &timeToNextEffect); | 300 updateTimeline(3, &timeToNextEffect); |
| 301 EXPECT_EQ(std::numeric_limits<double>::infinity(), timeToNextEffect); | 301 EXPECT_EQ(std::numeric_limits<double>::infinity(), timeToNextEffect); |
| 302 } | 302 } |
| 303 | 303 |
| 304 } | 304 } |
| OLD | NEW |