Changeset 315
- Timestamp:
- 05/24/06 01:46:54 (3 years ago)
- Files:
-
- trunk/openlayers/tests/run-tests.html (modified) (1 diff)
- trunk/openlayers/tests/test_Control_PanZoom.html (modified) (1 diff)
- trunk/openlayers/tests/test_Events.html (modified) (2 diffs)
- trunk/openlayers/tests/test_Feature.html (modified) (4 diffs)
- trunk/openlayers/tests/test_Layer_Text.html (modified) (2 diffs)
- trunk/openlayers/tests/test_Layer_WMS.html (modified) (2 diffs)
- trunk/openlayers/tests/test_Map.html (modified) (2 diffs)
- trunk/openlayers/tests/test_Tile_Image.html (modified) (2 diffs)
- trunk/openlayers/tests/test_Util.html (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/tests/run-tests.html
r10 r315 888 888 var fun_end=script_text.indexOf( '(' ); 889 889 var fun_name=script_text.substring( "function ".length, fun_end ); 890 var whitespace = fun_name.indexOf( ' ' ); 891 if (whitespace >= 0) 892 fun_name = fun_name.substring( 0, whitespace ); 890 893 test_page.test_objects.push( new Test.AnotherWay._test_object_t( fun_name ) ); 891 894 script_text=script_text.substring( fun_end, script_text.length ); trunk/openlayers/tests/test_Control_PanZoom.html
r269 r315 19 19 t.ok( control.map === map, "Control.map is set to the map object" ); 20 20 t.ok( map.controls[2] === control, "map.controls contains control" ); 21 t.eq( control.div.style.zIndex, "253", "Control div zIndexed properly" );22 t.eq( map.viewPortDiv.lastChild.style.zIndex, "253", "Viewport div contains control div" );21 t.eq( parseInt(control.div.style.zIndex), 253, "Control div zIndexed properly" ); 22 t.eq( parseInt(map.viewPortDiv.lastChild.style.zIndex), 253, "Viewport div contains control div" ); 23 23 t.eq( control.div.style.top, "4px", "Control div top located correctly by default"); 24 24 trunk/openlayers/tests/test_Events.html
r265 r315 3 3 <script src="../lib/OpenLayers.js"></script> 4 4 <script type="text/javascript"><!-- 5 var isMozilla = (navigator.userAgent.indexOf("compatible") == -1); 5 6 var map; 6 7 function test_01_Events_constructor (t) { … … 9 10 events = new OpenLayers.Events(obj, $('map'), eventTypes); 10 11 t.ok( events instanceof OpenLayers.Events, "new OpenLayers.Control returns object" ); 11 t.ok( events.div instanceof HTMLDivElement, "events.div isa HTMLDivElement" ); 12 if (!isMozilla) 13 t.ok( true, "skipping element test outside of Mozilla"); 14 else 15 t.ok( events.div instanceof HTMLDivElement, "events.div isa HTMLDivElement" ); 12 16 t.ok( events.object === obj, "events.object is the object we passed" ); 13 17 trunk/openlayers/tests/test_Feature.html
r295 r315 3 3 <script src="../lib/OpenLayers.js"></script> 4 4 <script type="text/javascript"><!-- 5 var isMozilla = (navigator.userAgent.indexOf("compatible") == -1); 6 var map; 5 7 var feature, layer; 6 8 … … 47 49 t.ok( feature.marker.icon instanceof OpenLayers.Icon, 48 50 "createMarker sets a marker icon property to an icon" ); 51 49 52 t.eq( feature.marker.icon.url, 50 53 "http://boston.openguides.org/features/ORANGE.png", … … 54 57 map.addLayer(layer); 55 58 map.setCenter(new OpenLayers.LonLat(0,0),0); 56 t.ok( map.layers[0] == =layer,59 t.ok( map.layers[0] == layer, 57 60 "Marker layer added to map okay." ); 58 t.ok( map.layers[0].div.firstChild instanceof HTMLImageElement, 59 "layer div firstChild is an image" ); 61 if (!isMozilla) 62 t.ok( true, "skipping element test outside of Mozilla"); 63 else 64 t.ok( map.layers[0].div.firstChild instanceof HTMLImageElement, 65 "layer div firstChild is an image" ); 60 66 t.eq( map.layers[0].div.firstChild.src, 61 67 "http://boston.openguides.org/features/ORANGE.png", … … 68 74 </head> 69 75 <body> 70 <div id="map" ></div>76 <div id="map" style="width: 500px; height: 300px;"></div> 71 77 </body> 72 78 </html> trunk/openlayers/tests/test_Layer_Text.html
r313 r315 3 3 <script src="../lib/OpenLayers.js"></script> 4 4 <script type="text/javascript"><!-- 5 var isMozilla = (navigator.userAgent.indexOf("compatible") == -1); 5 6 var layer; 6 7 … … 28 29 t.delay_call( 1, function() { 29 30 map.setCenter(new OpenLayers.LonLat(0,0),0); 30 t.ok( map.layers[0].div.firstChild instanceof HTMLImageElement, "Marker added to div" ) 31 if (!isMozilla) 32 t.ok( true, "skipping element test outside of Mozilla"); 33 else 34 t.ok( map.layers[0].div.firstChild instanceof HTMLImageElement, "Marker added to div" ) 31 35 t.eq( map.layers[0].div.firstChild.style.top, "219px", "Marker top set correctly" ) 32 36 t.eq( map.layers[0].div.firstChild.style.left, "273px", "Marker left set correctly" ) trunk/openlayers/tests/test_Layer_WMS.html
r312 r315 3 3 <script src="../lib/OpenLayers.js"></script> 4 4 <script type="text/javascript"><!-- 5 var isMozilla = (navigator.userAgent.indexOf("compatible") == -1); 5 6 var layer; 6 7 … … 27 28 t.eq( tile.img.style.top, "6px", "image top is set correctly via addtile" ); 28 29 t.eq( tile.img.style.left, "5px", "image top is set correctly via addtile" ); 29 t.ok( layer.div.firstChild instanceof HTMLImageElement, "div first child is an image object" ); 30 if (!isMozilla) 31 t.ok( true, "skipping element test outside of Mozilla"); 32 else 33 t.ok( layer.div.firstChild instanceof HTMLImageElement, "div first child is an image object" ); 30 34 t.eq( layer.div.firstChild.src, "http://octo.metacarta.com/cgi-bin/mapserv?bbox=1,2,3,4&width=256&height=256&map=/mapdata/vmap_wms.map&layers=basic&format=image/jpeg&service=WMS&version=1.1.1&request=GetMap&styles=&exceptions=application/vnd.ogc.se_inimage&srs=EPSG:4326", "div first child is correct image object" ); 31 35 var pos = tile.getPosition(); trunk/openlayers/tests/test_Map.html
r300 r315 3 3 <script src="../lib/OpenLayers.js"></script> 4 4 <script type="text/javascript"><!-- 5 var isMozilla = (navigator.userAgent.indexOf("compatible") == -1); 5 6 var map; 6 7 function test_01_Map_constructor (t) { … … 8 9 9 10 map = new OpenLayers.Map('map'); // no longer need to call $(), constructor does it 10 t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map returns object" ); 11 t.ok( map.div instanceof HTMLDivElement, "map.div is an HTMLDivElement" ); 12 t.ok( map.viewPortDiv instanceof HTMLDivElement, "map.viewPortDiv is an HTMLDivElement" ); 13 t.ok( map.layerContainerDiv instanceof HTMLDivElement, "map.layerContainerDiv is an HTMLDivElement" ); 11 t.ok( map instanceof OpenLayers.Map, "new OpenLayers.Map returns object" ); 12 if (!isMozilla) { 13 t.ok( true, "skipping element test outside of Mozilla"); 14 t.ok( true, "skipping element test outside of Mozilla"); 15 t.ok( true, "skipping element test outside of Mozilla"); 16 } else { 17 t.ok( map.div instanceof HTMLDivElement, "map.div is an HTMLDivElement" ); 18 t.ok( map.viewPortDiv instanceof HTMLDivElement, "map.viewPortDiv is an HTMLDivElement" ); 19 t.ok( map.layerContainerDiv instanceof HTMLDivElement, "map.layerContainerDiv is an HTMLDivElement" ); 20 } 14 21 t.ok( map.layers instanceof Array, "map.layers is an Array" ); 15 22 t.ok( map.controls instanceof Array, "map.controls is an Array" ); trunk/openlayers/tests/test_Tile_Image.html
r182 r315 3 3 <script src="../lib/OpenLayers.js"></script> 4 4 <script type="text/javascript"><!-- 5 var isMozilla = (navigator.userAgent.indexOf("compatible") == -1); 5 6 var tile; 6 7 … … 29 30 new OpenLayers.Size(5,6)); 30 31 tile.draw(); 31 t.ok( tile.img instanceof HTMLImageElement, "tile.draw creates an image"); 32 if (!isMozilla) 33 t.ok( true, "skipping element test outside of Mozilla"); 34 else 35 t.ok( tile.img instanceof HTMLImageElement, "tile.draw creates an image"); 32 36 t.eq( tile.img.src, "http://www.openlayers.org/dev/tests/tileimage", "tile.draw creates an image"); 33 37 t.eq( tile.img.style.width, "5px", "Image width is correct" ); trunk/openlayers/tests/test_Util.html
r225 r315 3 3 <script src="../lib/OpenLayers.js"></script> 4 4 <script type="text/javascript"><!-- 5 var isMozilla = (navigator.userAgent.indexOf("compatible") == -1); 5 6 var map; 6 7 function test_01_Util_getImagesLocation (t) { … … 64 65 var div = OpenLayers.Util.createDiv(id, px, sz, overflow, img, position); 65 66 66 t.ok( div instanceof HTMLDivElement, "createDiv creates a valid HTMLDivElement" ); 67 if (!isMozilla) 68 t.ok( true, "skipping element test outside of Mozilla"); 69 else 70 t.ok( div instanceof HTMLDivElement, "createDiv creates a valid HTMLDivElement" ); 67 71 t.eq( div.id, id, "div.id set correctly"); 68 72 t.eq( div.style.left, px.x + "px", "div.style.left set correctly"); … … 79 83 var div = OpenLayers.Util.createDiv(); 80 84 81 t.ok( div instanceof HTMLDivElement, "createDiv creates a valid HTMLDivElement" ); 85 if (!isMozilla) 86 t.ok( true, "skipping element test outside of Mozilla"); 87 else 88 t.ok( div instanceof HTMLDivElement, "createDiv creates a valid HTMLDivElement" ); 82 89 t.ok( (div.id != ""), "div.id set correctly"); 83 t.eq( div.style.left, "0pt", "div.style.left set correctly"); 84 t.eq( div.style.top, "0pt", "div.style.top set correctly"); 90 // the next two tests return "0pt" in Mozilla, "0px" in IE 91 t.eq( div.style.left.indexOf("0p"), 0, "div.style.left set correctly"); 92 t.eq( div.style.top.indexOf("0p"), 0, "div.style.top set correctly"); 85 93 86 94 t.eq( div.style.width, "", "div.style.width set correctly"); … … 105 113 var image = OpenLayers.Util.createImage(img, sz, xy, position, id, border); 106 114 107 t.ok( image instanceof HTMLImageElement, "createImage creates a valid HTMLImageElement" ); 115 if (!isMozilla) 116 t.ok( true, "skipping element test outside of Mozilla"); 117 else 118 t.ok( image instanceof HTMLImageElement, "createImage creates a valid HTMLImageElement" ); 108 119 t.eq( image.id, id, "image.id set correctly"); 109 120 t.eq( image.style.left, xy.x + "px", "image.style.left set correctly"); … … 120 131 var image = OpenLayers.Util.createImage(); 121 132 122 t.ok( image instanceof HTMLImageElement, "createDiv creates a valid HTMLDivElement" ); 133 if (!isMozilla) 134 t.ok( true, "skipping element test outside of Mozilla"); 135 else 136 t.ok( image instanceof HTMLImageElement, "createDiv creates a valid HTMLDivElement" ); 123 137 t.eq( image.id, "", "image.id set correctly"); 124 138 t.eq( image.style.left, "", "image.style.left set correctly");
