| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/svg/graphics/SVGImage.h" | 5 #include "core/svg/graphics/SVGImage.h" |
| 6 | 6 |
| 7 #include "core/svg/graphics/SVGImageChromeClient.h" | 7 #include "core/svg/graphics/SVGImageChromeClient.h" |
| 8 #include "platform/SharedBuffer.h" | 8 #include "platform/SharedBuffer.h" |
| 9 #include "platform/Timer.h" | 9 #include "platform/Timer.h" |
| 10 #include "platform/geometry/FloatRect.h" | 10 #include "platform/geometry/FloatRect.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 { | 36 { |
| 37 if (m_currentTask) | 37 if (m_currentTask) |
| 38 delete m_currentTask; | 38 delete m_currentTask; |
| 39 m_currentTask = task; | 39 m_currentTask = task; |
| 40 | 40 |
| 41 } | 41 } |
| 42 bool runsTasksOnCurrentThread() override { return true; } | 42 bool runsTasksOnCurrentThread() override { return true; } |
| 43 std::unique_ptr<WebTaskRunner> clone() override { return nullptr; } | 43 std::unique_ptr<WebTaskRunner> clone() override { return nullptr; } |
| 44 double virtualTimeSeconds() const override { return 0.0; } | 44 double virtualTimeSeconds() const override { return 0.0; } |
| 45 double monotonicallyIncreasingVirtualTimeSeconds() const override { return m
_time; } | 45 double monotonicallyIncreasingVirtualTimeSeconds() const override { return m
_time; } |
| 46 SingleThreadTaskRunner* taskRunner() override { return nullptr; } |
| 46 | 47 |
| 47 double m_time; | 48 double m_time; |
| 48 Task* m_currentTask; | 49 Task* m_currentTask; |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 class MockTimer : public TaskRunnerTimer<SVGImageChromeClient> { | 52 class MockTimer : public TaskRunnerTimer<SVGImageChromeClient> { |
| 52 public: | 53 public: |
| 53 using TimerFiredFunction = typename TaskRunnerTimer<SVGImageChromeClient>::T
imerFiredFunction; | 54 using TimerFiredFunction = typename TaskRunnerTimer<SVGImageChromeClient>::T
imerFiredFunction; |
| 54 | 55 |
| 55 MockTimer(SVGImageChromeClient* o, TimerFiredFunction f) | 56 MockTimer(SVGImageChromeClient* o, TimerFiredFunction f) |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 EXPECT_TRUE(chromeClient.isSuspended()); | 189 EXPECT_TRUE(chromeClient.isSuspended()); |
| 189 EXPECT_FALSE(timer->isActive()); | 190 EXPECT_FALSE(timer->isActive()); |
| 190 | 191 |
| 191 // Simulate a draw. This should resume the animation again. | 192 // Simulate a draw. This should resume the animation again. |
| 192 pumpFrame(); | 193 pumpFrame(); |
| 193 EXPECT_FALSE(chromeClient.isSuspended()); | 194 EXPECT_FALSE(chromeClient.isSuspended()); |
| 194 EXPECT_TRUE(timer->isActive()); | 195 EXPECT_TRUE(timer->isActive()); |
| 195 } | 196 } |
| 196 | 197 |
| 197 } // namespace blink | 198 } // namespace blink |
| OLD | NEW |