Skip to content

Commit 796a349

Browse files
committed
Synchronous image loading for opacity and backbuffer tests
1 parent ebeb49b commit 796a349

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/Layer/Grid.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,9 @@
770770
}
771771

772772
function test_setOpacity(t) {
773-
773+
var origRequestFrame = OpenLayers.Animation.requestFrame;
774+
OpenLayers.Animation.requestFrame = function(fn) { fn(); };
775+
774776
t.plan(5);
775777

776778
var map = new OpenLayers.Map('map');
@@ -799,6 +801,8 @@
799801
t.eq(parseFloat(tile.imgDiv.style.opacity), 0.2, "tile opacity is correc");
800802

801803
map.destroy();
804+
805+
OpenLayers.Animation.requestFrame = origRequestFrame
802806
}
803807

804808
function test_getServerResolution(t) {
@@ -1309,6 +1313,8 @@
13091313
}
13101314

13111315
function test_delayed_back_buffer_removal(t) {
1316+
var origRequestFrame = OpenLayers.Animation.requestFrame;
1317+
OpenLayers.Animation.requestFrame = function(fn) { fn(); };
13121318

13131319
//
13141320
// Test that the delaying of the back buffer removal behaves
@@ -1353,6 +1359,8 @@
13531359
// tear down
13541360

13551361
map.destroy();
1362+
1363+
OpenLayers.Animation.requestFrame = origRequestFrame;
13561364
}
13571365

13581366
function test_getGridData(t) {

0 commit comments

Comments
 (0)