From 8a6f50496f965bba8cec7923423c58d6d931eb92 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 17 Dec 2007 06:20:10 +0000 Subject: [PATCH] fix more tests in Opera by adding map.destroy() calls. git-svn-id: http://svn.openlayers.org/trunk/openlayers@5461 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Control/test_MousePosition.html | 3 +++ tests/Handler/test_Path.html | 3 +++ tests/Handler/test_Polygon.html | 3 +++ tests/Layer/test_WFS.html | 2 ++ 4 files changed, 11 insertions(+) diff --git a/tests/Control/test_MousePosition.html b/tests/Control/test_MousePosition.html index 98575dd4e5..300c3884e8 100644 --- a/tests/Control/test_MousePosition.html +++ b/tests/Control/test_MousePosition.html @@ -22,6 +22,7 @@ control.destroy(); t.eq(map.events.listeners.mousemove.length, listeners - 1, "mousemove event is unregistered"); + map.destroy(); } function test_MousePosition_addControl(t) { @@ -35,6 +36,7 @@ t.ok(map.controls[map.controls.length - 1] === control, "map.controls contains control"); t.eq(parseInt(control.div.style.zIndex), map.Z_INDEX_BASE['Control'] + 5, "Control div zIndexed properly" ); t.eq(parseInt(map.viewPortDiv.lastChild.style.zIndex), map.Z_INDEX_BASE['Control'] + 5, "Viewport div contains control div"); + map.destroy(); } function test_02_Control_MousePosition_redraw_noLayer_displayProjection(t) { @@ -52,6 +54,7 @@ control.redraw({'xy': new OpenLayers.Pixel(10,10)}); control.redraw({'xy': new OpenLayers.Pixel(12,12)}); t.eq(control.div.innerHTML, "-175.78125, 85.78125", "innerHTML set correctly when triggered."); + map.destroy(); } diff --git a/tests/Handler/test_Path.html b/tests/Handler/test_Path.html index 8f3c7a9562..bac0b6c28d 100644 --- a/tests/Handler/test_Path.html +++ b/tests/Handler/test_Path.html @@ -41,6 +41,7 @@ activated = handler.deactivate(); t.ok(activated, "deactivate returns true if the handler was active already"); + map.destroy(); } function test_Handler_Path_bounds(t) { @@ -64,6 +65,7 @@ var evt = {xy: new OpenLayers.Pixel(125, 100), which: 1}; handler.mousemove(evt); t.ok(!handler.line.geometry.getBounds().equals(new OpenLayers.Bounds(0,-35.15625,35.15625,0)), "Correct bounds after dragging without letting go. (Came out as "+handler.line.geometry.getBounds().toBBOX() + ".)"); + map.destroy(); } function test_Handler_Path_destroy(t) { @@ -92,6 +94,7 @@ "handler.point is null after destroy"); t.eq(handler.line, null, "handler.line is null after destroy"); + map.destroy(); } diff --git a/tests/Handler/test_Polygon.html b/tests/Handler/test_Polygon.html index 133e2980a0..4330655666 100644 --- a/tests/Handler/test_Polygon.html +++ b/tests/Handler/test_Polygon.html @@ -41,6 +41,7 @@ activated = handler.deactivate(); t.ok(activated, "deactivate returns true if the handler was active already"); + map.destroy(); } function test_Handler_Polygon_bounds(t) { @@ -66,6 +67,7 @@ handler.mousemove(evt); t.ok(!handler.polygon.geometry.getBounds().equals(new OpenLayers.Bounds(0,-35.15625,35.15625,0)), "Correct bounds after dragging without letting go. (Came out as "+handler.line.geometry.getBounds().toBBOX() + ".)"); + map.destroy(); } function test_Handler_Polygon_destroy(t) { @@ -98,6 +100,7 @@ "handler.line is null after destroy"); t.eq(handler.polygon, null, "handler.polygon is null after destroy"); + map.destroy(); } diff --git a/tests/Layer/test_WFS.html b/tests/Layer/test_WFS.html index b4b34e3e73..67b685d23f 100644 --- a/tests/Layer/test_WFS.html +++ b/tests/Layer/test_WFS.html @@ -26,6 +26,7 @@ layer.renderer.setSize = function() { setSize = true; } layer.onMapResize(); t.eq(setSize, true, "Renderer resize called on map size change."); + map.destroy(); } function test_Layer_WFS_drawmap(t) { @@ -63,6 +64,7 @@ } catch (Exception) { } t.eq(layer.tile.url, "http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?typename=OWLS&maxfeatures=10&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&SRS=EPSG%3A4326&BBOX=-187.890625%2C-36.679687%2C-12.109375%2C156.679688", "Tile URL is set correctly when not encoded"); + map.destroy(); }