| 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 23 matching lines...) Expand all Loading... |
| 34 void postDelayedTask(const WebTraceLocation&, Task* task, double) override | 34 void postDelayedTask(const WebTraceLocation&, Task* task, double) override |
| 35 { | 35 { |
| 36 if (m_currentTask) | 36 if (m_currentTask) |
| 37 delete m_currentTask; | 37 delete m_currentTask; |
| 38 m_currentTask = task; | 38 m_currentTask = task; |
| 39 | 39 |
| 40 } | 40 } |
| 41 WebTaskRunner* clone() override { return nullptr; } | 41 WebTaskRunner* clone() override { return nullptr; } |
| 42 double virtualTimeSeconds() const override { return 0.0; } | 42 double virtualTimeSeconds() const override { return 0.0; } |
| 43 double monotonicallyIncreasingVirtualTimeSeconds() const override { return m
_time; } | 43 double monotonicallyIncreasingVirtualTimeSeconds() const override { return m
_time; } |
| 44 scoped_refptr<base::SingleThreadTaskRunner> taskRunner() override { return n
ullptr; } |
| 44 | 45 |
| 45 double m_time; | 46 double m_time; |
| 46 Task* m_currentTask; | 47 Task* m_currentTask; |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 class MockTimer : public Timer<SVGImageChromeClient> { | 50 class MockTimer : public Timer<SVGImageChromeClient> { |
| 50 typedef void (SVGImageChromeClient::*TimerFiredFunction)(Timer*); | 51 typedef void (SVGImageChromeClient::*TimerFiredFunction)(Timer*); |
| 51 public: | 52 public: |
| 52 MockTimer(SVGImageChromeClient* o, TimerFiredFunction f) | 53 MockTimer(SVGImageChromeClient* o, TimerFiredFunction f) |
| 53 : Timer<SVGImageChromeClient>(o, f, &m_taskRunner) | 54 : Timer<SVGImageChromeClient>(o, f, &m_taskRunner) |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 EXPECT_TRUE(chromeClient.isSuspended()); | 186 EXPECT_TRUE(chromeClient.isSuspended()); |
| 186 EXPECT_FALSE(timer->isActive()); | 187 EXPECT_FALSE(timer->isActive()); |
| 187 | 188 |
| 188 // Simulate a draw. This should resume the animation again. | 189 // Simulate a draw. This should resume the animation again. |
| 189 pumpFrame(); | 190 pumpFrame(); |
| 190 EXPECT_FALSE(chromeClient.isSuspended()); | 191 EXPECT_FALSE(chromeClient.isSuspended()); |
| 191 EXPECT_TRUE(timer->isActive()); | 192 EXPECT_TRUE(timer->isActive()); |
| 192 } | 193 } |
| 193 | 194 |
| 194 } // namespace blink | 195 } // namespace blink |
| OLD | NEW |