Changeset 8091 for trunk/openlayers/tests
- Timestamp:
- 10/04/08 16:13:28 (2 months ago)
- Files:
-
- trunk/openlayers/tests/Icon.html (modified) (1 diff)
- trunk/openlayers/tests/Layer/Markers.html (modified) (1 diff)
- trunk/openlayers/tests/Marker.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/tests/Icon.html
r8088 r8091 34 34 t.eq(parseFloat(icon.imageDiv.style.opacity), 0.5, "icon.setOpacity() works"); 35 35 } 36 37 function test_Icon_isDrawn(t) { 38 t.plan(4); 39 40 var icon = {}; 41 42 //no imageDiv 43 var drawn = OpenLayers.Icon.prototype.isDrawn.apply(icon, []); 44 t.ok(!drawn, "icon with no imageDiv not drawn"); 45 46 //imageDiv no parentNode 47 icon.imageDiv = {}; 48 drawn = OpenLayers.Icon.prototype.isDrawn.apply(icon, []); 49 t.ok(!drawn, "icon with imageDiv with no parentNode not drawn"); 50 51 //imageDiv with parent 52 icon.imageDiv.parentNode = {}; 53 drawn = OpenLayers.Icon.prototype.isDrawn.apply(icon, []); 54 t.ok(drawn, "icon with imageDiv with parentNode drawn"); 55 56 //imageDiv with parent but nodetype 11 57 icon.imageDiv.parentNode = {'nodeType': 11}; 58 drawn = OpenLayers.Icon.prototype.isDrawn.apply(icon, []); 59 t.ok(!drawn, "imageDiv with parent but nodetype 11 not drawn"); 60 } 61 36 62 37 63 trunk/openlayers/tests/Layer/Markers.html
r6724 r8091 47 47 48 48 } 49 49 50 function test_Layer_Markers_destroy (t) { 50 51 t.plan( 1 ); trunk/openlayers/tests/Marker.html
r6724 r8091 135 135 map.destroy(); 136 136 } 137 138 function test_Marker_isDrawn(t) { 139 t.plan(3); 140 141 var marker = {}; 142 143 //no icon 144 var drawn = OpenLayers.Marker.prototype.isDrawn.apply(marker, []); 145 t.ok(!drawn, "marker with no icon not drawn"); 146 147 //not drawn icon 148 marker.icon = { isDrawn: function() { return false; } }; 149 drawn = OpenLayers.Marker.prototype.isDrawn.apply(marker, []); 150 t.ok(!drawn, "marker with not drawn icon not drawn"); 151 152 //drawn icon 153 marker.icon.isDrawn = function() { return true; }; 154 drawn = OpenLayers.Marker.prototype.isDrawn.apply(marker, []); 155 t.ok(drawn, "marker with drawn icon drawn"); 156 } 137 157 138 158 </script>
