Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / document-domain-set.html
blobafa9ed48a869abfed9d3c926671deb704b0c457f
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script>
6 <script>
7 if (document.location.hostname == "127.0.0.1") {
8 document.location.hostname = "subdomain.example.test";
9 } else {
10 test(function () {
11 document.domain = 'example.test';
13 var xhr = new XMLHttpRequest();
14 xhr.open('POST', 'resources/post-echo.cgi', false);
15 xhr.send('PASS');
16 assert_equals(xhr.responseText, "PASS");
17 }, "XMLHttpRequest allowed with document.domain set.");
19 </script>
20 </head>
21 <body>
22 </body>
23 </html>