Attempt to deflake svg/custom/animate-initial-pause-unpause.html (issue 2009263002 by fs@opera.com)

1 view
Skip to first unread message

f...@opera.com

unread,
May 26, 2016, 3:40:11 AM5/26/16
to da...@opera.com, alexis...@intel.com, blink-...@chromium.org, blink-revie...@chromium.org, chromium...@chromium.org, ericwi...@chromium.org, rjwr...@chromium.org, sh...@chromium.org
Reviewers: David Vest
CL: https://codereview.chromium.org/2009263002/

Description:
Attempt to deflake svg/custom/animate-initial-pause-unpause.html

The timeout could race with load and that animation timeline start.
Happened at least once in 1000 runs.

Make sure to wait for an animation frame before setting the timer (the
animation timeline has its zero at the time of 'load'.) Also, rewrite
the test to use testharness.js. No failures in 1000 runs.

BUG=350828

Base URL: https://chromium.googlesource.com/chromium/src.git@master

Affected files (+24, -31 lines):
M third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause.html
D third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause-expected.txt


Index: third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause-expected.txt
diff --git a/third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause-expected.txt b/third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause-expected.txt
deleted file mode 100644
index db9481e6dbd5e6198ec7cbad4a17539d04996f38..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause-expected.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-CONSOLE WARNING: SVG's SMIL animations (<animate>, <set>, etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.
-PASS
Index: third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause.html
diff --git a/third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause.html b/third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause.html
index f975c3e5ec8fe6254a4882b91d39740a899f7cf5..15b77a07d4620a2083f724b05036b2b8c448838d 100644
--- a/third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause.html
+++ b/third_party/WebKit/LayoutTests/svg/custom/animate-initial-pause-unpause.html
@@ -1,36 +1,31 @@
<!DOCTYPE HTML>
-<html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
<!--
Test for WK89943: pausing and unpausing an animation before it starts should have no effect.
-->
-<body>
- <svg id="svg" width="400" height="400">
- <rect x="0" y="0" width="100" height="100" fill="red"/>
- <rect id="rect" x="100" y="0" width="100" height="100" fill="green">
- <set attributeName="x" to="0" begin="0.01s" fill="freeze"/>
- </rect>
- </svg>
- <script>
- if (window.testRunner) {
- testRunner.waitUntilDone();
- testRunner.dumpAsText();
- }
+<svg id="svg" width="400" height="400">
+ <rect x="0" y="0" width="100" height="100" fill="red"/>
+ <rect id="rect" x="100" y="0" width="100" height="100" fill="green">
+ <set attributeName="x" to="0" begin="0.01s" fill="freeze"/>
+ </rect>
+</svg>
+<script>
+async_test(function(t) {
+ var svg = document.getElementById("svg");

- var svg = document.getElementById("svg");
- var rect = document.getElementById("rect");
+ svg.pauseAnimations();
+ svg.unpauseAnimations();

- svg.pauseAnimations();
- svg.unpauseAnimations();
+ var endStep = t.step_func_done(function() {
+ var rect = document.getElementById("rect");
+ assert_equals(rect.x.animVal.value, 0, "<set> is applied");
+ });

- setTimeout(function() {
- if (rect.x.animVal.value == 0)
- document.body.innerHTML = "PASS";
- else
- document.body.innerHTML = "FAIL : rect.x.animVal.value was " + rect.x.animVal.value + " but we expected 0.";
-
- if (window.testRunner)
- testRunner.notifyDone();
- }, 50);
- </script>
-</body>
-</html>
+ window.onload = function() {
+ requestAnimationFrame(function() {
+ setTimeout(endStep, 50);
+ });
+ };
+}, "Pausing and unpausing an animation before it starts should have no effect");
+</script>


da...@opera.com

unread,
May 26, 2016, 4:17:44 AM5/26/16
to f...@opera.com, alexis...@intel.com, blink-...@chromium.org, blink-revie...@chromium.org, chromium...@chromium.org, ericwi...@chromium.org, rjwr...@chromium.org, sh...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
May 26, 2016, 4:19:13 AM5/26/16
to f...@opera.com, da...@opera.com, commi...@chromium.org, alexis...@intel.com, blink-...@chromium.org, blink-revie...@chromium.org, chromium...@chromium.org, ericwi...@chromium.org, rjwr...@chromium.org, sh...@chromium.org

commit-bot@chromium.org via codereview.chromium.org

unread,
May 26, 2016, 4:22:53 AM5/26/16
to f...@opera.com, da...@opera.com, commi...@chromium.org, alexis...@intel.com, blink-...@chromium.org, blink-revie...@chromium.org, chromium...@chromium.org, ericwi...@chromium.org, rjwr...@chromium.org, sh...@chromium.org
Committed patchset #1 (id:1)

https://codereview.chromium.org/2009263002/

commit-bot@chromium.org via codereview.chromium.org

unread,
May 26, 2016, 4:24:05 AM5/26/16
to f...@opera.com, da...@opera.com, commi...@chromium.org, alexis...@intel.com, blink-...@chromium.org, blink-revie...@chromium.org, chromium...@chromium.org, ericwi...@chromium.org, rjwr...@chromium.org, sh...@chromium.org
Patchset 1 (id:??) landed as
https://crrev.com/45ca0a5d79d8cbc9faf8470c30fc5cb02e1bbe1f
Cr-Commit-Position: refs/heads/master@{#396147}

https://codereview.chromium.org/2009263002/
Reply all
Reply to author
Forward
0 new messages