1 <p>Tests origin whitelisting subdomain behavior.
</p>
3 <pre id=
"console"></pre>
5 testRunner
.dumpAsText();
6 testRunner
.waitUntilDone();
7 testRunner
.addOriginAccessWhitelistEntry("http://127.0.0.1:8000", "http", "localhost", true);
11 document
.getElementById('console').appendChild(document
.createTextNode(message
+ '\n'));
14 function test(url
, expectSuccess
)
16 log("Testing: " + url
+ " (sync)");
17 var req
= new XMLHttpRequest();
18 req
.open("GET", url
, false);
21 log((expectSuccess
? "PASS: " : "FAIL: ") + req
.responseText
);
23 log((expectSuccess
? "FAIL: " : "PASS: ") + e
);
26 log("Testing: " + url
+ " (async)");
27 req
= new XMLHttpRequest();
28 req
.open("GET", url
, true);
29 req
.onload = function() {
30 log((expectSuccess
? "PASS: " : "FAIL: ") + req
.responseText
);
33 req
.onerror = function() {
34 log((expectSuccess
? "FAIL: " : "PASS: ") + req
.status
);
41 ["http://localhost:8000/xmlhttprequest/resources/get.txt", true]
42 // FIXME: Is it possible to setup the following tests?
43 // ["http://foo.localhost:8000/xmlhttprequest/resources/get.txt", true]
44 // ["http://bar.foo.localhost:8000/xmlhttprequest/resources/get.txt", true]
45 // ["http://foolocalhost:8000/xmlhttprequest/resources/get.txt", false]
52 if (currentTest
< tests
.length
)
53 test
.apply(null, tests
[currentTest
++]);
55 testRunner
.notifyDone();