Skip to content

Commit

Permalink
Fix -webkit prefix issue in mm-spinner tests for safari
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuwen Qian committed Sep 18, 2015
1 parent 76a24b6 commit f8fe724
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/mm-spinner.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,20 @@

it("should animate", function() {
var spinner = document.querySelector('#spinner'),
spinnerStyle = getComputedStyle(spinner.$.spinner);
should.equal(parseFloat(spinnerStyle.animationDuration).toPrecision(5), (1/spinner.speed).toPrecision(5));
should.equal(spinnerStyle.animationTimingFunction, 'steps('+spinner.numTicks+', end)');
spinnerStyle = getComputedStyle(spinner.$.spinner),
animationDuration = spinnerStyle.animationDuration || spinnerStyle['-webkit-animation-duration'],
animationTimingFunction = spinnerStyle.animationTimingFunction || spinnerStyle['-webkit-animation-timing-function'];
should.equal(parseFloat(animationDuration).toPrecision(5), (1/spinner.speed).toPrecision(5));
should.equal(animationTimingFunction, 'steps('+spinner.numTicks+', end)');
});

it("should stop the animation", function(done) {
var spinner = document.querySelector('#spinner'),
spinnerStyle = function() { return getComputedStyle(spinner.$.spinner); }
spinner.stop();
flush(function() {
spinnerStyle().animationPlayState.should.equal('paused');
var animationPlayState = spinnerStyle().animationPlayState || spinnerStyle()['-webkit-animation-play-state'];
animationPlayState.should.equal('paused');
done();
});
});
Expand All @@ -52,7 +55,8 @@
spinnerStyle = function() { return getComputedStyle(spinner.$.spinner); }
spinner.start();
flush(function() {
spinnerStyle().animationPlayState.should.equal('running');
var animationPlayState = spinnerStyle().animationPlayState || spinnerStyle()['-webkit-animation-play-state'];
animationPlayState.should.equal('running');
done();
});
});
Expand Down

0 comments on commit f8fe724

Please sign in to comment.