OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 <p>XMLHttpRequest.open() should be correctly overloaded</p> | 3 <p>XMLHttpRequest.open() should be correctly overloaded</p> |
4 <script> | 4 <script> |
5 | 5 |
6 var console_messages = document.createElement("ol"); | 6 var console_messages = document.createElement("ol"); |
7 document.body.appendChild(console_messages); | 7 document.body.appendChild(console_messages); |
8 | 8 |
9 function log(message) | 9 function log(message) |
10 { | 10 { |
(...skipping 11 matching lines...) Expand all Loading... |
22 if (req.readyState == expectedState) | 22 if (req.readyState == expectedState) |
23 log("PASS: " + description); | 23 log("PASS: " + description); |
24 else | 24 else |
25 log("FAIL: " + description + " (expected:" + expectedState + ", actual
:" + req.readyState +")"); | 25 log("FAIL: " + description + " (expected:" + expectedState + ", actual
:" + req.readyState +")"); |
26 } | 26 } |
27 | 27 |
28 if (window.testRunner) | 28 if (window.testRunner) |
29 testRunner.dumpAsText(); | 29 testRunner.dumpAsText(); |
30 | 30 |
31 req = new XMLHttpRequest(); | 31 req = new XMLHttpRequest(); |
32 req.open("GET", "methods.cgi", true); | 32 req.open("GET", "methods.cgi?1", true); |
33 shouldSendBehaveAs(req, true, "if async argument is true, send() should beha
ve asynchronously"); | 33 shouldSendBehaveAs(req, true, "if async argument is true, send() should beha
ve asynchronously"); |
34 | 34 |
35 req = new XMLHttpRequest(); | 35 req = new XMLHttpRequest(); |
36 req.open("GET", "methods.cgi", false); | 36 req.open("GET", "methods.cgi?2", false); |
37 shouldSendBehaveAs(req, false, "if async argument is false, send() should be
have synchronously"); | 37 shouldSendBehaveAs(req, false, "if async argument is false, send() should be
have synchronously"); |
38 | 38 |
39 req = new XMLHttpRequest(); | 39 req = new XMLHttpRequest(); |
40 req.open("GET", "methods.cgi"); | 40 req.open("GET", "methods.cgi?3"); |
41 shouldSendBehaveAs(req, true, "if async argument is not given, send() should
behave like as async=true"); | 41 shouldSendBehaveAs(req, true, "if async argument is not given, send() should
behave like as async=true"); |
42 | 42 |
43 req = new XMLHttpRequest(); | 43 req = new XMLHttpRequest(); |
44 req.open("GET", "methods.cgi", undefined); | 44 req.open("GET", "methods.cgi?4", undefined); |
45 shouldSendBehaveAs(req, false, "if async argument is undefined, send() shoul
d behave like as async=false"); | 45 shouldSendBehaveAs(req, false, "if async argument is undefined, send() shoul
d behave like as async=false"); |
46 | 46 |
47 req = new XMLHttpRequest(); | 47 req = new XMLHttpRequest(); |
48 req.open("GET", "methods.cgi", "OK"); | 48 req.open("GET", "methods.cgi?5", "OK"); |
49 shouldSendBehaveAs(req, true, "if async argument is a non-empty string, send
() should behave like as async=true"); | 49 shouldSendBehaveAs(req, true, "if async argument is a non-empty string, send
() should behave like as async=true"); |
50 | 50 |
51 </script> | 51 </script> |
52 </body> | 52 </body> |
53 </html> | 53 </html> |
OLD | NEW |