[OpenLayers-Commits] r11088 - sandbox/elemoine/draw-feature/tests/Handler

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Thu Feb 10 05:46:45 EST 2011


Author: erilem
Date: 2011-02-10 02:46:45 -0800 (Thu, 10 Feb 2011)
New Revision: 11088

Modified:
   sandbox/elemoine/draw-feature/tests/Handler/Polygon.html
Log:
path polygon tests - modifyFeature not called on mousedown anymore

Modified: sandbox/elemoine/draw-feature/tests/Handler/Polygon.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/Handler/Polygon.html	2011-02-10 10:46:40 UTC (rev 11087)
+++ sandbox/elemoine/draw-feature/tests/Handler/Polygon.html	2011-02-10 10:46:45 UTC (rev 11088)
@@ -91,6 +91,7 @@
         var activated = handler.activate();
 
         var evt = {xy: new OpenLayers.Pixel(150, 75), which: 1};
+        handler.mousemove(evt);
         handler.mousedown(evt);
         handler.mouseup(evt);
         var evt = {xy: new OpenLayers.Pixel(175, 100), which: 1};
@@ -108,7 +109,7 @@
     }
 
     function test_callbacks(t) {
-        t.plan(35);
+        t.plan(36);
         var map = new OpenLayers.Map("map", {
             resolutions: [1]
         });
@@ -151,16 +152,19 @@
                   "[activate] correct point");
         t.ok(log.args[1] == handler.polygon,
              "[activate] correct feature");
+        handler.mousemove(
+            {type: "mousemove", xy: new OpenLayers.Pixel(0, 0)});
+        t.eq(logs.length, 1, "[mousemove] called back");
+        log = logs.shift();
+        t.eq(log.type, "modify", "[mousemove] modify called");
+        t.geom_eq(log.args[0], new OpenLayers.Geometry.Point(-150, 75),
+                  "[mousemove] correct point");
+        t.ok(log.args[1] === handler.polygon,
+             "[mousemove] correct feature");
         // mouse down
         handler.mousedown(
             {type: "mousedown", xy: new OpenLayers.Pixel(0, 0)});
-        t.eq(logs.length, 1, "[mousedown] called back");
-        log = logs.shift();
-        t.eq(log.type, "modify", "[mousedown] modify called");
-        t.geom_eq(log.args[0], new OpenLayers.Geometry.Point(-150, 75),
-                  "[mousedown] correct point");
-        t.ok(log.args[1] == handler.polygon,
-             "[mousedown] correct feature");
+        t.eq(logs.length, 0, "[mousedown] not called back");
         // mouse up
         handler.mouseup(
             {type: "mouseup", xy: new OpenLayers.Pixel(0, 0)});
@@ -198,7 +202,6 @@
         // mouse down
         handler.mousedown(
             {type: "mousedown", xy: new OpenLayers.Pixel(10, 10)});
-        log = logs.shift();
         // mouse up
         handler.mouseup(
             {type: "mouseup", xy: new OpenLayers.Pixel(10, 10)});
@@ -218,8 +221,7 @@
         // mouse down
         handler.mousedown(
             {type: "mousedown", xy: new OpenLayers.Pixel(0, 10)});
-        t.eq(logs.length, 1, "[mousedown] called back");
-        log = logs.shift();
+        t.eq(logs.length, 0, "[mousedown] not called back");
         // mouse up
         handler.mouseup(
             {type: "mouseup", xy: new OpenLayers.Pixel(0, 10)});



More information about the Commits mailing list