mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1178186 part 2 - Add tests for CSSAnimation and CSSTransition interfaces; r=jwatt
--HG-- extra : source : 1027311cd1bb6889104339dd87116036beb3421f
This commit is contained in:
parent
cc59f02cc9
commit
dd122c2a3d
@ -27,6 +27,8 @@ test(function(t) {
|
||||
async_test(function(t) {
|
||||
var div = addDiv(t);
|
||||
|
||||
// FIXME: This test does too many things. It should be split up.
|
||||
|
||||
// Add an animation
|
||||
div.style.animation = 'anim1 100s';
|
||||
var animations = div.getAnimations();
|
||||
@ -60,6 +62,12 @@ async_test(function(t) {
|
||||
}));
|
||||
}, 'getAnimations for CSS Animations');
|
||||
|
||||
test(function(t) {
|
||||
var div = addDiv(t, { style: 'animation: anim1 100s' });
|
||||
assert_class_string(div.getAnimations()[0], 'CSSAnimation',
|
||||
'Interface of returned animation is CSSAnimation');
|
||||
}, 'getAnimations returns CSSAnimation objects for CSS Animations');
|
||||
|
||||
test(function(t) {
|
||||
var div = addDiv(t);
|
||||
|
||||
@ -88,14 +96,13 @@ async_test(function(t) {
|
||||
assert_equals(animations.length, 2,
|
||||
'getAnimations returns Animations for both animations and'
|
||||
+ ' transitions that run simultaneously');
|
||||
return waitForAllAnimations(animations);
|
||||
})).then(t.step_func(function() {
|
||||
assert_true(animations[0].startTime > animations[1].startTime,
|
||||
'Animations for transitions appear before animations even if they'
|
||||
+ ' start later');
|
||||
assert_class_string(animations[0], 'CSSTransition',
|
||||
'First-returned animation is the CSS Transition');
|
||||
assert_class_string(animations[1], 'CSSAnimation',
|
||||
'Second-returned animation is the CSS Animation');
|
||||
t.done();
|
||||
}));
|
||||
}, 'getAnimations for both CSS Animations and Transitions at once');
|
||||
}, 'getAnimations for both CSS Animations and CSS Transitions at once');
|
||||
|
||||
async_test(function(t) {
|
||||
var div = addDiv(t);
|
||||
|
@ -8,6 +8,8 @@
|
||||
async_test(function(t) {
|
||||
var div = addDiv(t);
|
||||
|
||||
// FIXME: This test does too many things. It should be split up.
|
||||
|
||||
// Add a couple of transitions
|
||||
div.style.left = '0px';
|
||||
div.style.top = '0px';
|
||||
@ -42,6 +44,16 @@ async_test(function(t) {
|
||||
}));
|
||||
}, 'getAnimations for CSS Transitions');
|
||||
|
||||
test(function(t) {
|
||||
var div = addDiv(t, { style: 'left: 0px; transition: all 100s' });
|
||||
|
||||
flushComputedStyle(div);
|
||||
div.style.left = '100px';
|
||||
|
||||
assert_class_string(div.getAnimations()[0], 'CSSTransition',
|
||||
'Interface of returned animation is CSSTransition');
|
||||
}, 'getAnimations returns CSSTransition objects for CSS Transitions');
|
||||
|
||||
async_test(function(t) {
|
||||
var div = addDiv(t);
|
||||
|
||||
|
@ -80,7 +80,7 @@ function flushComputedStyle(elem) {
|
||||
for (var funcName of ["async_test", "assert_not_equals", "assert_equals",
|
||||
"assert_approx_equals", "assert_less_than_equal",
|
||||
"assert_between_inclusive", "assert_true", "assert_false",
|
||||
"assert_throws", "test"]) {
|
||||
"assert_class_string", "assert_throws", "test"]) {
|
||||
window[funcName] = opener[funcName].bind(opener);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user