Synchronous image loading for opacity and backbuffer tests

This commit is contained in:
ahocevar
2012-11-05 10:40:50 +01:00
parent ebeb49b5e7
commit 796a349c61
+9 -1
View File
@@ -770,7 +770,9 @@
} }
function test_setOpacity(t) { function test_setOpacity(t) {
var origRequestFrame = OpenLayers.Animation.requestFrame;
OpenLayers.Animation.requestFrame = function(fn) { fn(); };
t.plan(5); t.plan(5);
var map = new OpenLayers.Map('map'); var map = new OpenLayers.Map('map');
@@ -799,6 +801,8 @@
t.eq(parseFloat(tile.imgDiv.style.opacity), 0.2, "tile opacity is correc"); t.eq(parseFloat(tile.imgDiv.style.opacity), 0.2, "tile opacity is correc");
map.destroy(); map.destroy();
OpenLayers.Animation.requestFrame = origRequestFrame
} }
function test_getServerResolution(t) { function test_getServerResolution(t) {
@@ -1309,6 +1313,8 @@
} }
function test_delayed_back_buffer_removal(t) { function test_delayed_back_buffer_removal(t) {
var origRequestFrame = OpenLayers.Animation.requestFrame;
OpenLayers.Animation.requestFrame = function(fn) { fn(); };
// //
// Test that the delaying of the back buffer removal behaves // Test that the delaying of the back buffer removal behaves
@@ -1353,6 +1359,8 @@
// tear down // tear down
map.destroy(); map.destroy();
OpenLayers.Animation.requestFrame = origRequestFrame;
} }
function test_getGridData(t) { function test_getGridData(t) {