bring back r6710 now that popup changes are in

git-svn-id: http://svn.openlayers.org/trunk/openlayers@6719 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-03-31 05:03:49 +00:00
parent 463dc45fbb
commit 0244858054
116 changed files with 36 additions and 39 deletions

View File

@@ -5,20 +5,15 @@
var name = "GML Layer";
// The actual path these files are read from differs:
// some browsers treat relative paths from within an iframe
// as relative to the parent, some treat them as relative to the child
// At this time:
// * IE6 + IE7
// * Firefox 2.0.0.13+
// read them from relative to the iframe contents, rather than parent,
// so these files are in *two* places: one in the "Layer/" subdirectory,
// and one in the root. This majorly sucks, but it's a way to keep it
// working without hardcoding a version number into the tests.
var gml = "./owls.xml";
var gml2 = "./mice.xml";
// if this test is running online, different rules apply
var isMSIE = (navigator.userAgent.indexOf("MSIE") > -1);
if (isMSIE) {
gml = "." + gml;
gml2 = "." + gml2;
}
function test_01_Layer_GML_constructor(t) {
t.plan(3);

View File

@@ -8,17 +8,12 @@
var georss_txt = "./georss.txt";
var atom_xml = "./atom-1.0.xml";
// The actual path these files are read from differs:
// some browsers treat relative paths from within an iframe
// as relative to the parent, some treat them as relative to the child
// At this time:
// * IE6 + IE7
// * Firefox 2.0.0.13+
// read them from relative to the iframe contents, rather than parent,
// so these files are in *two* places: one in the "Layer/" subdirectory,
// and one in the root. This majorly sucks, but it's a way to keep it
// working without hardcoding a version number into the tests.
// if this test is running online, different rules apply
if (isMSIE) {
georss_txt = "." + georss_txt;
atom_xml = "." + atom_xml;
}
function test_01_Layer_GeoRSS_constructor (t) {
t.plan( 5 );
@@ -97,7 +92,7 @@
});
}
function test_Layer_GeoRSS_popups (t) {
t.plan( 4 );
t.plan( 8 );
layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt);
var map = new OpenLayers.Map('map');
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
@@ -112,14 +107,18 @@
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( 4 );
t.plan( 8 );
var map = new OpenLayers.Map('map');
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
"http://octo.metacarta.com/cgi-bin/mapserv?",
@@ -133,9 +132,13 @@
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");
});
}

View File

@@ -6,20 +6,17 @@
var isMSIE = (navigator.userAgent.indexOf("MSIE") > -1);
var layer;
// The actual path these files are read from differs:
// some browsers treat relative paths from within an iframe
// as relative to the parent, some treat them as relative to the child
// At this time:
// * IE6 + IE7
// * Firefox 2.0.0.13+
// read them from relative to the iframe contents, rather than parent,
// so these files are in *two* places: one in the "Layer/" subdirectory,
// and one in the root. This majorly sucks, but it's a way to keep it
// working without hardcoding a version number into the tests.
var datafile = "./data_Layer_Text_textfile.txt";
var datafile2 = "./data_Layer_Text_textfile_2.txt";
var datafile_overflow = "./data_Layer_Text_textfile_overflow.txt";
// if this test is running in IE, different rules apply
if (isMSIE) {
datafile = "." + datafile;
datafile2 = "." + datafile2;
datafile_overflow = "." + datafile_overflow;
}
function test_01_Layer_Text_constructor (t) {
t.plan( 5 );

View File

@@ -84,10 +84,9 @@
popup.lonlat = true;
popup.updatePosition();
t.ok(true, "update position doesn't fail when getLayerPxFromLonLat fails.");
map.destroy();
}
function test_03_Popup_draw(t) {
t.plan( 13 );
t.plan( 17 );
var id = "chicken";
var x = 50;
@@ -99,28 +98,31 @@
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);
map1.addPopup(popup);
popup.moveTo(new OpenLayers.Pixel(x, y));
popup.draw(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], "", "correct content div overflow");
t.eq(contentDiv.style[prop], "hidden", "correct content div overflow");
t.eq(contentDiv.innerHTML, content, "correct content div content");
var bColor = popup.div.style.backgroundColor;

Some files were not shown because too many files have changed in this diff Show More