3 <script type=
"text/javascript">
7 document
.getElementById('console').appendChild(document
.createTextNode(message
+ "\n"));
10 if (window
.testRunner
) {
11 testRunner
.dumpAsText();
12 testRunner
.waitUntilDone();
16 if (window
.testRunner
)
17 testRunner
.notifyDone();
22 var xhr
= new XMLHttpRequest
;
23 xhr
.open("PUT", "http://localhost:8000/xmlhttprequest/resources/basic-auth/access-control-auth-basic.php?uid=fooUser", false, "fooUser", "barPass");
24 xhr
.withCredentials
= true;
25 xhr
.onerror = function (e
) {
26 log("FAILED: received error");
29 xhr
.onreadystatechange = function () {
30 if (xhr
.readyState
== 4) {
31 log((xhr
.status
== 401) ? "PASSED" : "FAILED: credential send!");
37 log("FAILED: got exception " + e
.message
);
43 <body onload=
"runTest();">
44 <p>Test case for bug
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=37781">37781</a>: [XHR] Cross-Origin synchronous request with credential raises NETWORK_ERR
</p>
45 <pre id='console'
></pre>