Skip to content

Commit 1d43355

Browse files
committed
Tweak tests
1 parent c8e46f2 commit 1d43355

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/plot_api/plot_api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2576,7 +2576,7 @@ Plotly.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {
25762576

25772577
if(newFrame) {
25782578
trans._lastFrameAt = Date.now();
2579-
trans._timetonext = newFrame.frameOpts.duration;
2579+
trans._timeToNext = newFrame.frameOpts.duration;
25802580

25812581
Plots.transition(gd,
25822582
newFrame.frame.data,
@@ -2605,13 +2605,13 @@ Plotly.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {
26052605

26062606
// If no timer is running, then set last frame = long ago:
26072607
trans._lastFrameAt = -Infinity;
2608-
trans._timetonext = 0;
2608+
trans._timeToNext = 0;
26092609
trans._runningTransitions = 0;
26102610
trans._currentFrame = null;
26112611

26122612
var doFrame = function() {
26132613
// Check if we need to pop a frame:
2614-
if(Date.now() - trans._lastFrameAt > trans._timetonext) {
2614+
if(Date.now() - trans._lastFrameAt > trans._timeToNext) {
26152615
nextFrame();
26162616
}
26172617

src/plots/plots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ plots.purge = function(gd) {
901901
if(fullLayout._modeBar) fullLayout._modeBar.destroy();
902902

903903
if(gd._transitionData && gd._transitionData._animationRaf) {
904-
cancelAnimationFrame(gd._transitionData._animationRaf);
904+
window.cancelAnimationFrame(gd._transitionData._animationRaf);
905905
}
906906

907907
// data and layout

test/jasmine/tests/animate_test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ describe('Test animate API', function() {
5252
destroyGraphDiv();
5353
});
5454

55-
for(var i = 0; i < 2; i++) {
56-
// Run tests for 0ms and 30ms duration:
57-
runTests(30 * i);
58-
}
55+
runTests(30);
5956

6057
function runTests(duration) {
6158
describe('With duration = ' + duration, function() {

0 commit comments

Comments
 (0)