Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More build fixes Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp
index 8e9fc134c752b472402b12dae52a0e4b1d77bfa9..465a93207d64c87de9bfa0e33af1e1e0febc9c83 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp
@@ -11,6 +11,7 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/utils/SkNullCanvas.h"
+#include "wtf/PtrUtil.h"
namespace blink {
namespace {
@@ -47,17 +48,18 @@ private:
Task* m_currentTask;
};
-class MockTimer : public Timer<SVGImageChromeClient> {
- typedef void (SVGImageChromeClient::*TimerFiredFunction)(Timer*);
+class MockTimer : public TaskRunnerTimer<SVGImageChromeClient> {
public:
+ using TimerFiredFunction = typename TaskRunnerTimer<SVGImageChromeClient>::TimerFiredFunction;
+
MockTimer(SVGImageChromeClient* o, TimerFiredFunction f)
- : Timer<SVGImageChromeClient>(o, f, &m_taskRunner)
+ : TaskRunnerTimer(&m_taskRunner, o, f)
{
}
void fire()
{
- this->Timer<SVGImageChromeClient>::fired();
+ fired();
stop();
}
@@ -141,7 +143,7 @@ TEST_F(SVGImageTest, TimelineSuspendAndResume)
load(kAnimatedDocument, shouldPause);
SVGImageChromeClient& chromeClient = image().chromeClientForTesting();
MockTimer* timer = new MockTimer(&chromeClient, &SVGImageChromeClient::animationTimerFired);
- chromeClient.setTimer(timer);
+ chromeClient.setTimer(wrapUnique(timer));
// Simulate a draw. Cause a frame (timer) to be scheduled.
pumpFrame();
@@ -167,7 +169,7 @@ TEST_F(SVGImageTest, ResetAnimation)
load(kAnimatedDocument, shouldPause);
SVGImageChromeClient& chromeClient = image().chromeClientForTesting();
MockTimer* timer = new MockTimer(&chromeClient, &SVGImageChromeClient::animationTimerFired);
- chromeClient.setTimer(timer);
+ chromeClient.setTimer(wrapUnique(timer));
// Simulate a draw. Cause a frame (timer) to be scheduled.
pumpFrame();

Powered by Google App Engine
This is Rietveld 408576698