diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/animation/test/css-transitions/file_animation-pausing.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/animation/test/css-transitions/file_animation-pausing.html')
-rw-r--r-- | dom/animation/test/css-transitions/file_animation-pausing.html | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/dom/animation/test/css-transitions/file_animation-pausing.html b/dom/animation/test/css-transitions/file_animation-pausing.html new file mode 100644 index 000000000..b2f2d4618 --- /dev/null +++ b/dom/animation/test/css-transitions/file_animation-pausing.html @@ -0,0 +1,50 @@ +<!doctype html> +<meta charset=utf-8> +<script src="../testcommon.js"></script> +<body> +<script> +'use strict'; + +function getMarginLeft(cs) { + return parseFloat(cs.marginLeft); +} + +async_test(function(t) { + var div = addDiv(t); + var cs = window.getComputedStyle(div); + + div.style.marginLeft = '0px'; + cs.marginLeft; // Flush style to set up transition start point + div.style.transition = 'margin-left 100s'; + div.style.marginLeft = '10000px'; + cs.marginLeft; + + var animation = div.getAnimations()[0]; + assert_equals(getMarginLeft(cs), 0, + 'Initial value of margin-left is zero'); + var previousAnimVal = getMarginLeft(cs); + + animation.ready.then(waitForFrame).then(t.step_func(function() { + assert_true(getMarginLeft(cs) > previousAnimVal, + 'margin-left is initially increasing'); + animation.pause(); + return animation.ready; + })).then(t.step_func(function() { + previousAnimVal = getMarginLeft(cs); + return waitForFrame(); + })).then(t.step_func(function() { + assert_equals(getMarginLeft(cs), previousAnimVal, + 'margin-left does not increase after calling pause()'); + previousAnimVal = getMarginLeft(cs); + animation.play(); + return animation.ready.then(waitForFrame); + })).then(t.step_func(function() { + assert_true(getMarginLeft(cs) > previousAnimVal, + 'margin-left increases after calling play()'); + t.done(); + })); +}, 'pause() and play() a transition'); + +done(); +</script> +</body> |