| 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 27 matching lines...) Expand all Loading... |
| 38 #include <gtest/gtest.h> | 38 #include <gtest/gtest.h> |
| 39 | 39 |
| 40 using namespace WebCore; | 40 using namespace WebCore; |
| 41 | 41 |
| 42 namespace { | 42 namespace { |
| 43 | 43 |
| 44 class PlayerTest : public ::testing::Test { | 44 class PlayerTest : public ::testing::Test { |
| 45 protected: | 45 protected: |
| 46 virtual void SetUp() | 46 virtual void SetUp() |
| 47 { | 47 { |
| 48 document = Document::create(0, KURL()); | 48 document = Document::create(); |
| 49 timeline = DocumentTimeline::create(document.get()); | 49 timeline = DocumentTimeline::create(document.get()); |
| 50 player = Player::create(timeline.get(), 0); | 50 player = Player::create(timeline.get(), 0); |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool updateTimeline(double time) | 53 bool updateTimeline(double time) |
| 54 { | 54 { |
| 55 timeline->serviceAnimations(time); | 55 timeline->serviceAnimations(time); |
| 56 // The timeline does not know about our player, so we have to explicitly
call update(). | 56 // The timeline does not know about our player, so we have to explicitly
call update(). |
| 57 return player->update(); | 57 return player->update(); |
| 58 } | 58 } |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 player->setCurrentTime(std::numeric_limits<double>::max()); | 251 player->setCurrentTime(std::numeric_limits<double>::max()); |
| 252 EXPECT_EQ(std::numeric_limits<double>::max(), player->currentTime()); | 252 EXPECT_EQ(std::numeric_limits<double>::max(), player->currentTime()); |
| 253 EXPECT_EQ(-std::numeric_limits<double>::max(), player->timeDrift()); | 253 EXPECT_EQ(-std::numeric_limits<double>::max(), player->timeDrift()); |
| 254 | 254 |
| 255 updateTimeline(100); | 255 updateTimeline(100); |
| 256 EXPECT_EQ(std::numeric_limits<double>::max(), player->currentTime()); | 256 EXPECT_EQ(std::numeric_limits<double>::max(), player->currentTime()); |
| 257 EXPECT_EQ(-std::numeric_limits<double>::max(), player->timeDrift()); | 257 EXPECT_EQ(-std::numeric_limits<double>::max(), player->timeDrift()); |
| 258 } | 258 } |
| 259 | 259 |
| 260 } | 260 } |
| OLD | NEW |