tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / xmlhttprequest / xmlhttprequest-bad-mimetype.html
1 <p>This test checks for <a href="rdar://problem/5303567">&lt;rdar://problem/5303567&gt;</a> REGRESSION: XMLHttpRequest.responseXML returns NULL if response MIME type is not XML -- breaks Wikipedia widget</p>
2 <hr>
3
4 <pre id="console"></pre>
5
6 <script>
7 function log(s)
8 {
9     document.getElementById("console").appendChild(document.createTextNode(s + "\n"));
10 }
11
12 function logProperty(object, propertyName)
13 {
14     var property;
15     try {
16         property = object[propertyName];
17     } catch(e) {
18         property = e;
19     }
20     
21     if (String(property).indexOf("\n") != -1)
22         property = property.split("\n")[0] + "...";
23     log(propertyName + ": " + property + " (" + typeof property + ")");
24 }
25
26 function sendRequest(url) 
27 {
28     request = new XMLHttpRequest();
29     request.open("GET", url, false);
30     request.send(null);
31     return request;
32 }
33
34 function test(url)
35 {
36     try {
37         sendRequest(url);
38         log("PASS: No exception.");
39     } catch(e) {
40         log("FAIL: Caught exception " + e + ".");
41     }
42
43     var properties = [
44         "readyState",
45         "responseText",
46         "responseXML",
47         "status",
48         "statusText",
49     ];
50     
51     for (var i = 0; i < properties.length; i++) //>
52         logProperty(request, properties[i]);
53 }
54
55 if (window.layoutTestController)
56     layoutTestController.dumpAsText();
57 test("resources/plist.app");
58 </script>