]> dev.renevier.net Git - syp.git/blob - openlayers/tests/Ajax.html
initial commit
[syp.git] / openlayers / tests / Ajax.html
1 <html>
2 <head>
3   <script src="../lib/OpenLayers.js"></script>
4   <script type="text/javascript">
5
6     function test_Ajax_loadUrl(t) {
7         t.plan(5);
8         var _get = OpenLayers.Request.GET;
9         var caller = {};
10         var onComplete = function() {};
11         var onFailure = function() {};
12         var params = {};
13         OpenLayers.Request.GET = function(config) {
14             t.eq(config.url, "http://example.com/?format=image+kml", "correct url")
15             t.eq(config.params, params, "correct params");
16             t.eq(config.scope, caller, "correct scope");
17             t.ok(config.success === onComplete, "correct success callback");
18             t.ok(config.failure === onFailure, "correct failure callback");
19         };
20         OpenLayers.loadURL("http://example.com/?format=image+kml", params, caller, onComplete, onFailure);
21         OpenLayers.Request.GET = _get;
22     }
23   </script>
24 </head>
25 <body>
26 </body>
27 </html>