[OpenLayers-Commits] r11657 - sandbox/tschaub/click/tests/Control

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Mon Mar 7 10:04:45 EST 2011


Author: tschaub
Date: 2011-03-07 07:04:44 -0800 (Mon, 07 Mar 2011)
New Revision: 11657

Modified:
   sandbox/tschaub/click/tests/Control/TouchNavigation.html
Log:
Adding tests for click handler options on touch navigation control.

Modified: sandbox/tschaub/click/tests/Control/TouchNavigation.html
===================================================================
--- sandbox/tschaub/click/tests/Control/TouchNavigation.html	2011-03-07 14:48:26 UTC (rev 11656)
+++ sandbox/tschaub/click/tests/Control/TouchNavigation.html	2011-03-07 15:04:44 UTC (rev 11657)
@@ -102,6 +102,29 @@
 
     }
 
+    function test_clickHandlerOptions(t) {
+
+        t.plan(3);
+
+         var nav = new OpenLayers.Control.TouchNavigation();
+         t.eq(nav.clickHandlerOptions, null, "clickHandlerOptions null by default");
+
+         var map = new OpenLayers.Map({
+             div: document.body,
+             controls: [
+                 new OpenLayers.Control.TouchNavigation({
+                     clickHandlerOptions: {foo: "bar"}
+                 })
+             ]
+         });
+         nav = map.controls[0];
+
+         t.eq(nav.handlers.click.foo, "bar", "foo property is set on the click handler");
+         t.eq(nav.handlers.click.pixelTolerance, 2, "pixelTolerance is 2 by default");
+         map.destroy();
+
+    }
+
     function test_zoomOut(t) {
         t.plan(1);
 



More information about the Commits mailing list