Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / workers / worker-document-domain-security.html
bloba153bc492d0b81b1dbca7fa10bfc3738d75b446c
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 assert_throws("SecurityError", function () {
14 new Worker("http://example.test/worker.js");
15 });
17 try {
18 new Worker("resources/non-existent.js");
19 } catch (e) {
20 assert_unreached("Same-origin worker shouldn't throw.");
22 }, "SecurityError thrown when accessing another domain's worker.");
24 </script>
25 </head>
26 <body>
27 </body>
28 </html>