[Commits] r1640 - in sandbox/cmoullet/ux/RoutingPanel: tests/ux/widgets ux/widgets
commits at geoext.org
commits at geoext.org
Thu Dec 31 17:53:45 CET 2009
Author: cmoullet
Date: 2009-12-31 17:53:45 +0100 (Thu, 31 Dec 2009)
New Revision: 1640
Modified:
sandbox/cmoullet/ux/RoutingPanel/tests/ux/widgets/RoutingPanel.html
sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js
Log:
Improve tests
Modified: sandbox/cmoullet/ux/RoutingPanel/tests/ux/widgets/RoutingPanel.html
===================================================================
--- sandbox/cmoullet/ux/RoutingPanel/tests/ux/widgets/RoutingPanel.html 2009-12-31 16:53:26 UTC (rev 1639)
+++ sandbox/cmoullet/ux/RoutingPanel/tests/ux/widgets/RoutingPanel.html 2009-12-31 16:53:45 UTC (rev 1640)
@@ -11,7 +11,7 @@
<script type="text/javascript" src="../../../ux/widgets/RoutingPanel.js"></script>
<script type="text/javascript">
function test_ctor(t) {
- t.plan(5);
+ t.plan(6);
var layer = new OpenLayers.Layer.OSM("OSM");
@@ -39,7 +39,12 @@
t.eq(routingPanel.routingRecenterMap, true, "recenter on map is true per default");
t.ok(routingPanel.routingPointDrawControl instanceof OpenLayers.Control.DrawFeature,
"routingPanel.routingPointDrawControl is an OpenLayers.Control.DrawFeature object");
- routingPanel.destroy();
+ routingPanel.getItinerary();
+ t.delay_call(2, function() {
+ t.eq(routingPanel.routingStatusCloudmade, 0 , "routing has been computed with cloudmade");
+ routingPanel.destroy();
+ });
+
}
</script>
</head>
Modified: sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js
===================================================================
--- sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js 2009-12-31 16:53:26 UTC (rev 1639)
+++ sandbox/cmoullet/ux/RoutingPanel/ux/widgets/RoutingPanel.js 2009-12-31 16:53:45 UTC (rev 1640)
@@ -484,8 +484,23 @@
];
- this.addEvents('routingcomputed', 'beforeroutingcomputed');
+ this.addEvents(
+ /** api: event[routingcomputed]
+ * Fires when a routing has been computed
+ *
+ * Listener arguments:
+ * * comp - :class:`GeoExt.ux.RoutingPanel`` This component.
+ */
+ 'routingcomputed',
+ /** api: event[beforeroutingcomputed]
+ * Fires when before a routing is computed
+ *
+ * Listener arguments:
+ * * comp - :class:`GeoExt.ux.RoutingPanel`` This component.
+ */
+ 'beforeroutingcomputed');
+
GeoExt.ux.RoutingPanel.superclass.initComponent.call(this);
},
@@ -598,7 +613,7 @@
);
this.routingStore.load();
} else {
- alert('routing service ' + this.routingServiceType + ' not supported. Patch welcome !');
+ alert('Routing service: ' + this.routingServiceType + ' not supported. Patch welcome !');
}
},
More information about the Commits
mailing list