Commit 88390020 authored by Hajime Hoshi's avatar Hajime Hoshi Committed by Commit Bot

svg: Replace Timer usages with TaskRunnerTimer in SVGImageTest

This is part of efforts to replace default timer task runners with
other appropriate task runners in the renderer.

Bug: 624694, 804694
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I16585f0cf479191f33fdac9a7afc924cd077b908
Reviewed-on: https://chromium-review.googlesource.com/897318
Commit-Queue: Hajime Hoshi <hajimehoshi@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533992}
parent f55c1c3b
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "platform/graphics/paint/PaintFlags.h" #include "platform/graphics/paint/PaintFlags.h"
#include "platform/testing/UnitTestHelpers.h" #include "platform/testing/UnitTestHelpers.h"
#include "platform/wtf/PtrUtil.h" #include "platform/wtf/PtrUtil.h"
#include "public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/utils/SkNullCanvas.h" #include "third_party/skia/include/utils/SkNullCanvas.h"
...@@ -93,8 +94,10 @@ TEST_F(SVGImageTest, TimelineSuspendAndResume) { ...@@ -93,8 +94,10 @@ TEST_F(SVGImageTest, TimelineSuspendAndResume) {
const bool kShouldPause = true; const bool kShouldPause = true;
Load(kAnimatedDocument, kShouldPause); Load(kAnimatedDocument, kShouldPause);
SVGImageChromeClient& chrome_client = GetImage().ChromeClientForTesting(); SVGImageChromeClient& chrome_client = GetImage().ChromeClientForTesting();
Timer<SVGImageChromeClient>* timer = new Timer<SVGImageChromeClient>( TaskRunnerTimer<SVGImageChromeClient>* timer =
&chrome_client, &SVGImageChromeClient::AnimationTimerFired); new TaskRunnerTimer<SVGImageChromeClient>(
scheduler::GetSingleThreadTaskRunnerForTesting(), &chrome_client,
&SVGImageChromeClient::AnimationTimerFired);
chrome_client.SetTimer(WTF::WrapUnique(timer)); chrome_client.SetTimer(WTF::WrapUnique(timer));
// Simulate a draw. Cause a frame (timer) to be scheduled. // Simulate a draw. Cause a frame (timer) to be scheduled.
...@@ -120,8 +123,10 @@ TEST_F(SVGImageTest, ResetAnimation) { ...@@ -120,8 +123,10 @@ TEST_F(SVGImageTest, ResetAnimation) {
const bool kShouldPause = false; const bool kShouldPause = false;
Load(kAnimatedDocument, kShouldPause); Load(kAnimatedDocument, kShouldPause);
SVGImageChromeClient& chrome_client = GetImage().ChromeClientForTesting(); SVGImageChromeClient& chrome_client = GetImage().ChromeClientForTesting();
Timer<SVGImageChromeClient>* timer = new Timer<SVGImageChromeClient>( TaskRunnerTimer<SVGImageChromeClient>* timer =
&chrome_client, &SVGImageChromeClient::AnimationTimerFired); new TaskRunnerTimer<SVGImageChromeClient>(
scheduler::GetSingleThreadTaskRunnerForTesting(), &chrome_client,
&SVGImageChromeClient::AnimationTimerFired);
chrome_client.SetTimer(WTF::WrapUnique(timer)); chrome_client.SetTimer(WTF::WrapUnique(timer));
// Simulate a draw. Cause a frame (timer) to be scheduled. // Simulate a draw. Cause a frame (timer) to be scheduled.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment