| <p>This test checks for <a href="rdar://problem/5303567"><rdar://problem/5303567></a> REGRESSION: XMLHttpRequest.responseXML returns NULL if response MIME type is not XML -- breaks Wikipedia widget</p> |
| <hr> |
| |
| <pre id="console"></pre> |
| |
| <script> |
| function log(s) |
| { |
| document.getElementById("console").appendChild(document.createTextNode(s + "\n")); |
| } |
| |
| function logProperty(object, propertyName) |
| { |
| var property; |
| try { |
| property = object[propertyName]; |
| } catch(e) { |
| property = e; |
| } |
| |
| if (String(property).indexOf("\n") != -1) |
| property = property.split("\n")[0] + "..."; |
| log(propertyName + ": " + property + " (" + typeof property + ")"); |
| } |
| |
| function sendRequest(url) |
| { |
| request = new XMLHttpRequest(); |
| request.open("GET", url, false); |
| request.send(null); |
| return request; |
| } |
| |
| function test(url) |
| { |
| try { |
| sendRequest(url); |
| log("PASS: No exception."); |
| } catch(e) { |
| log("FAIL: Caught exception " + e + "."); |
| } |
| |
| var properties = [ |
| "readyState", |
| "responseText", |
| "responseXML", |
| "status", |
| "statusText", |
| ]; |
| |
| for (var i = 0; i < properties.length; i++) //> |
| logProperty(request, properties[i]); |
| } |
| |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| test("resources/plist.app"); |
| </script> |