diff options
author | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-08-05 14:40:36 -0700 |
---|---|---|
committer | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-08-05 16:03:52 -0700 |
commit | a3d1457809f76355764a43f6f36f10ddd9ff0948 (patch) | |
tree | a6263d961bef978f627c26789402c41e0de82d0d | |
parent | 0e3d4ab4079878dbb96f14f23d5b189eaa1fca42 (diff) | |
download | servo-a3d1457809f76355764a43f6f36f10ddd9ff0948.tar.gz servo-a3d1457809f76355764a43f6f36f10ddd9ff0948.zip |
Add test for #12749
-rw-r--r-- | tests/wpt/mozilla/meta/MANIFEST.json | 6 | ||||
-rw-r--r-- | tests/wpt/mozilla/tests/css/animations/transition-raf.html | 40 |
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/wpt/mozilla/meta/MANIFEST.json b/tests/wpt/mozilla/meta/MANIFEST.json index 4d0e9b89ac2..d9d08e602d6 100644 --- a/tests/wpt/mozilla/meta/MANIFEST.json +++ b/tests/wpt/mozilla/meta/MANIFEST.json @@ -6168,6 +6168,12 @@ "url": "/_mozilla/css/animations/basic-transition.html" } ], + "css/animations/transition-raf.html": [ + { + "path": "css/animations/transition-raf.html", + "url": "/_mozilla/css/animations/transition-raf.html" + } + ], "css/empty-keyframes.html": [ { "path": "css/empty-keyframes.html", diff --git a/tests/wpt/mozilla/tests/css/animations/transition-raf.html b/tests/wpt/mozilla/tests/css/animations/transition-raf.html new file mode 100644 index 00000000000..6159bb9ab33 --- /dev/null +++ b/tests/wpt/mozilla/tests/css/animations/transition-raf.html @@ -0,0 +1,40 @@ +<!doctype html> +<meta charset="utf-8"> +<title></title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> +#box { + width: 100px; + height: 200px; + background: red; + transition: width 1s linear; +} + +#box.expose { + width: 200px; +} +</style> +<div id="box"></div> +<script> +var box = document.getElementById('box'); +var test = new window.TestBinding(); +async_test(function(t) { + // Dummy RAF loop. + (function onFrame() { + var style = getComputedStyle(box).getPropertyValue('width'); + if (style === '150px') { + t.done(); + } else { + window.requestAnimationFrame(onFrame); + } + }()); + + window.addEventListener('load', function() { + assert_equals(getComputedStyle(box).getPropertyValue('width'), '100px'); + box.className = "expose"; + // Let the first restyle run at zero, then advance the clock. + setTimeout(function() { test.advanceClock(500, false) }, 0); + }); +}, "Transitions should work during RAF loop") +</script> |