Update animation tests to run in a popup.
As an optimization, certain browsers (e.g. Firefox) may not execute functions sent to `requestAnimationFrame` while the window is not visible. Because our tests run in an iframe, the tests fail unless we open a popup to run the animation methods.
This commit is contained in:
+14
-8
@@ -14,8 +14,17 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
function test_requestFrame(t) {
|
function test_all(t) {
|
||||||
t.plan(2);
|
t.plan(7);
|
||||||
|
t.open_window("Animation.html", function(win) {
|
||||||
|
win.requestFrame(t);
|
||||||
|
win.start(t);
|
||||||
|
win.startDuration(t);
|
||||||
|
win.stop(t);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function requestFrame(t) {
|
||||||
|
|
||||||
t.eq(typeof OpenLayers.Animation.requestFrame, "function", "requestFrame is a function");
|
t.eq(typeof OpenLayers.Animation.requestFrame, "function", "requestFrame is a function");
|
||||||
|
|
||||||
@@ -28,8 +37,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_start(t) {
|
function start(t) {
|
||||||
t.plan(1);
|
|
||||||
|
|
||||||
var calls = 0;
|
var calls = 0;
|
||||||
var id = OpenLayers.Animation.start(function() {
|
var id = OpenLayers.Animation.start(function() {
|
||||||
@@ -41,8 +49,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_start_duration(t) {
|
function startDuration(t) {
|
||||||
t.plan(2);
|
|
||||||
|
|
||||||
var calls = 0;
|
var calls = 0;
|
||||||
var id = OpenLayers.Animation.start(function() {
|
var id = OpenLayers.Animation.start(function() {
|
||||||
@@ -58,8 +65,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_stop(t) {
|
function stop(t) {
|
||||||
t.plan(2);
|
|
||||||
|
|
||||||
var calls = 0;
|
var calls = 0;
|
||||||
var id = OpenLayers.Animation.start(function() {
|
var id = OpenLayers.Animation.start(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user