| <p>This test checks for rdar://problem/4962298 REGRESSION: Synchronous XHR for missing local file throws exception -- 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; |
| } |
| log(propertyName + ": " + property + " (" + typeof property + ")"); |
| } |
| |
| function sendRequest() |
| { |
| var request = new XMLHttpRequest(); |
| request.open("GET", "file:///iamthewalrus", false); |
| request.send(null); |
| return request; |
| } |
| |
| if (window.testRunner) |
| testRunner.dumpAsText(); |
| |
| try { |
| var request = sendRequest(); |
| |
| var properties = [ |
| "readyState", |
| "responseText", |
| "responseXML", |
| /* "status", -- excluded because it differs on tiger and leopard */ |
| "statusText", |
| ]; |
| |
| log("PASS: No exception."); |
| for (var i = 0; i < properties.length; i++) //> |
| logProperty(request, properties[i]); |
| } catch(e) { |
| log("FAIL: Caught exception " + e + "."); |
| } |
| </script> |