Add test for #12749

This commit is contained in:
Emilio Cobos Álvarez 2016-08-05 14:40:36 -07:00
parent 0e3d4ab407
commit a3d1457809
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 46 additions and 0 deletions

View file

@ -6168,6 +6168,12 @@
"url": "/_mozilla/css/animations/basic-transition.html" "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": [ "css/empty-keyframes.html": [
{ {
"path": "css/empty-keyframes.html", "path": "css/empty-keyframes.html",

View file

@ -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>