From 796a349c615787ee728cab9e270e61675e99081a Mon Sep 17 00:00:00 2001 From: ahocevar Date: Mon, 5 Nov 2012 10:40:50 +0100 Subject: [PATCH] Synchronous image loading for opacity and backbuffer tests --- tests/Layer/Grid.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/Layer/Grid.html b/tests/Layer/Grid.html index fdc3bf1c2a..49a6075e8d 100644 --- a/tests/Layer/Grid.html +++ b/tests/Layer/Grid.html @@ -770,7 +770,9 @@ } function test_setOpacity(t) { - + var origRequestFrame = OpenLayers.Animation.requestFrame; + OpenLayers.Animation.requestFrame = function(fn) { fn(); }; + t.plan(5); var map = new OpenLayers.Map('map'); @@ -799,6 +801,8 @@ t.eq(parseFloat(tile.imgDiv.style.opacity), 0.2, "tile opacity is correc"); map.destroy(); + + OpenLayers.Animation.requestFrame = origRequestFrame } function test_getServerResolution(t) { @@ -1309,6 +1313,8 @@ } 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 @@ -1353,6 +1359,8 @@ // tear down map.destroy(); + + OpenLayers.Animation.requestFrame = origRequestFrame; } function test_getGridData(t) {