From e6c3d695adb9bf704cf530688501263caa8ce193 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Mon, 31 Mar 2008 05:32:56 +0000 Subject: [PATCH] bring back changes from r6718 that i accidentally blew away git-svn-id: http://svn.openlayers.org/trunk/openlayers@6725 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/Layer/GeoRSS.html | 12 ++---------- tests/Popup.html | 14 ++++++-------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/tests/Layer/GeoRSS.html b/tests/Layer/GeoRSS.html index c63e8b2347..99937ba9fc 100644 --- a/tests/Layer/GeoRSS.html +++ b/tests/Layer/GeoRSS.html @@ -92,7 +92,7 @@ }); } function test_Layer_GeoRSS_popups (t) { - t.plan( 8 ); + t.plan( 4 ); layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt); var map = new OpenLayers.Map('map'); var baseLayer = new OpenLayers.Layer.WMS("Test Layer", @@ -107,18 +107,14 @@ t.eq(layer.markers[0].events.listeners['click'].length, 1, "Marker events has one object"); layer.markers[0].events.triggerEvent('click', event); t.eq(map.popups.length, 1, "Popup opened correctly"); - t.eq(map.popups[0].size.w, 250, "Popup sized correctly x"); - t.eq(map.popups[0].size.h, 120, "Popup sized correctly y"); layer.markers[1].events.triggerEvent('click', event); t.eq(map.popups.length, 1, "1st popup gone, 2nd Popup opened correctly"); - t.eq(map.popups[0].size.w, 250, "Popup sized correctly x"); - t.eq(map.popups[0].size.h, 120, "Popup sized correctly y"); }); } function test_Layer_GeoRSS_resizedPopups(t) { layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt, {'popupSize': new OpenLayers.Size(200,100)}); - t.plan( 8 ); + t.plan( 4 ); var map = new OpenLayers.Map('map'); var baseLayer = new OpenLayers.Layer.WMS("Test Layer", "http://octo.metacarta.com/cgi-bin/mapserv?", @@ -132,13 +128,9 @@ t.eq(layer.markers[0].events.listeners['click'].length, 1, "Marker events has one object"); layer.markers[0].events.triggerEvent('click', event); t.eq(map.popups.length, 1, "Popup opened correctly"); - t.eq(map.popups[0].size.w, 200, "Popup sized correctly x"); - t.eq(map.popups[0].size.h, 100, "Popup sized correctly y"); map.popups[0].size.w=300; layer.markers[1].events.triggerEvent('click', event); t.eq(map.popups.length, 1, "1st popup gone, 2nd Popup opened correctly"); - t.eq(map.popups[0].size.w, 200, "Popup sized correctly x"); - t.eq(map.popups[0].size.h, 100, "Popup sized correctly y"); }); } diff --git a/tests/Popup.html b/tests/Popup.html index 32930afffe..8f24b4715f 100644 --- a/tests/Popup.html +++ b/tests/Popup.html @@ -84,9 +84,10 @@ popup.lonlat = true; popup.updatePosition(); t.ok(true, "update position doesn't fail when getLayerPxFromLonLat fails."); + map.destroy(); } function test_Popup_draw(t) { - t.plan( 17 ); + t.plan( 13 ); var id = "chicken"; var x = 50; @@ -98,31 +99,28 @@ var hexColor = "#ff0000"; var opacity = 0.5; var border = "1px solid"; - + map1 = new OpenLayers.Map("map"); popup = new OpenLayers.Popup(id); popup.setSize(new OpenLayers.Size(w, h)); popup.setContentHTML(content); popup.setBackgroundColor(color); popup.setOpacity(opacity); popup.setBorder(border); - popup.draw(new OpenLayers.Pixel(x, y)); + map1.addPopup(popup); + popup.moveTo(new OpenLayers.Pixel(x, y)); t.eq(popup.div.id, id, "popup.div.id set correctly"); t.eq(popup.div.style.left, x + "px", "left position of popup.div set correctly"); t.eq(popup.div.style.top, y + "px", "top position of popup.div set correctly"); - t.eq(popup.div.style.width, w + "px", "width position of popup.div set correctly"); - t.eq(popup.div.style.height, h + "px", "heightposition of popup.div set correctly"); var contentDiv = popup.div.childNodes[0].childNodes[0]; t.eq(contentDiv.className, "olPopupContent", "correct content div className"); t.eq(contentDiv.id, "chicken_contentDiv", "correct content div id"); - t.eq(contentDiv.style.width, "500px", "correct content div width"); - t.eq(contentDiv.style.height, "400px", "correct content div height"); t.eq(contentDiv.style.position, "relative", "correct content div position"); //Safari 3 separates style overflow into overflow-x and overflow-y var prop = (OpenLayers.Util.getBrowserName() == 'safari') ? 'overflowX' : 'overflow'; - t.eq(contentDiv.style[prop], "hidden", "correct content div overflow"); + t.eq(contentDiv.style[prop], "", "correct content div overflow"); t.eq(contentDiv.innerHTML, content, "correct content div content"); var bColor = popup.div.style.backgroundColor;