[OpenLayers-Commits] r11601 - in
sandbox/ahocevar/renderer-ng/tests: Layer Renderer
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Tue Mar 1 10:39:59 EST 2011
Author: ahocevar
Date: 2011-03-01 07:39:57 -0800 (Tue, 01 Mar 2011)
New Revision: 11601
Modified:
sandbox/ahocevar/renderer-ng/tests/Layer/Vector.html
sandbox/ahocevar/renderer-ng/tests/Renderer/SVG2.html
Log:
updated tests
Modified: sandbox/ahocevar/renderer-ng/tests/Layer/Vector.html
===================================================================
--- sandbox/ahocevar/renderer-ng/tests/Layer/Vector.html 2011-03-01 15:39:30 UTC (rev 11600)
+++ sandbox/ahocevar/renderer-ng/tests/Layer/Vector.html 2011-03-01 15:39:57 UTC (rev 11601)
@@ -458,9 +458,7 @@
t.plan(9);
var map = new OpenLayers.Map("map");
- var layer = new OpenLayers.Layer.Vector(null, {
- drawn: true
- });
+ var layer = new OpenLayers.Layer.Vector();
map.addLayer(layer);
var feature = new OpenLayers.Feature.Vector(
new OpenLayers.Geometry.Point(10, 10)
@@ -477,6 +475,7 @@
};
// draw feature with no state
+ layer.drawn = true;
layer.drawFeature(feature);
t.ok(log.feature === feature, "[no state] drawFeature called with correct feature");
t.ok(log.style.display !== "none", "[no state] drawFeature called with style display not none");
Modified: sandbox/ahocevar/renderer-ng/tests/Renderer/SVG2.html
===================================================================
--- sandbox/ahocevar/renderer-ng/tests/Renderer/SVG2.html 2011-03-01 15:39:30 UTC (rev 11600)
+++ sandbox/ahocevar/renderer-ng/tests/Renderer/SVG2.html 2011-03-01 15:39:57 UTC (rev 11601)
@@ -1,6 +1,6 @@
<html>
<head>
-<script src="../../lib/OpenLayers.js"></script>
+<script src="../OLLoader.js"></script>
<script type="text/javascript">
var geometry = null, node = null;
@@ -51,7 +51,7 @@
t.plan(5);
OpenLayers.Renderer.SVG2.prototype._setExtent =
- OpenLayers.Renderer.Elements.prototype.setExtent;
+ OpenLayers.Renderer.SVG2.prototype.setExtent;
var g_SetExtent = false;
OpenLayers.Renderer.SVG2.prototype.setExtent = function() {
@@ -60,7 +60,6 @@
}
var r = new OpenLayers.Renderer.SVG2(document.body);
-
var extent = new OpenLayers.Bounds(1,2,3,4);
r.map = {
getResolution: function() {
@@ -68,23 +67,26 @@
},
getExtent: function() {
return extent;
+ },
+ getMaxExtent: function() {
+ return extent;
}
}
r.updateDimensions();
t.eq(g_SetExtent, true, "Elements.setExtent() called");
- t.eq(r.rendererRoot.getAttributeNS(null, "width"), "12", "width is correct");
- t.eq(r.rendererRoot.getAttributeNS(null, "height"), "12", "height is correct");
- t.eq(r.rendererRoot.getAttributeNS(null, "viewBox"), "-1 -6 6 6", "rendererRoot viewBox is correct");
+ t.eq(r.rendererRoot.getAttributeNS(null, "width"), "4", "width is correct");
+ t.eq(r.rendererRoot.getAttributeNS(null, "height"), "4", "height is correct");
+ t.eq(r.rendererRoot.getAttributeNS(null, "viewBox"), "1 -4 2 2", "rendererRoot viewBox is correct");
// test extent changes
extent = new OpenLayers.Bounds(2,3,5,6);
r.updateDimensions();
- t.eq(r.rendererRoot.getAttributeNS(null, "viewBox"), "-1 -9 9 9", "rendererRoot viewBox is correct after a new setExtent");
+ t.eq(r.rendererRoot.getAttributeNS(null, "viewBox"), "2 -6 3 3", "rendererRoot viewBox is correct after a new setExtent");
- OpenLayers.Renderer.Elements.prototype.setExtent =
- OpenLayers.Renderer.Elements.prototype._setExtent;
+ OpenLayers.Renderer.SVG2.prototype.setExtent =
+ OpenLayers.Renderer.SVG2.prototype._setExtent;
}
function test_SVG_drawpoint(t) {
@@ -361,13 +363,13 @@
}
t.plan(1);
-
+
var r = new OpenLayers.Renderer.SVG2(document.body);
var g = {CLASS_NAME: "OpenLayers.Geometry.Point"}
var s = {graphicName: "square"};
- t.eq(r.getNodeType(g, s), "use", "Correct node type for well known symbols");
+ t.eq(r.getNodeType(g, s), "svg", "Correct node type for well known symbols");
}
function test_svg_importsymbol(t) {
@@ -413,7 +415,7 @@
t.eq(r.dashStyle({strokeWidth: 1, strokeDashstyle: "dashdot"}, 1), "4,4,1,4", "dashdot dasharray created correctly");
t.eq(r.dashStyle({strokeWidth: 1, strokeDashstyle: "longdashdot"}, 1), "8,4,1,4", "dashdot dasharray created correctly");
}
-
+
</script>
</head>
<body>
More information about the Commits
mailing list