diff options
Diffstat (limited to 'testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html')
-rw-r--r-- | testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html new file mode 100644 index 0000000000..d3af35c6d7 --- /dev/null +++ b/testing/web-platform/tests/html/browsers/origin/relaxing-the-same-origin-restriction/document_domain.html @@ -0,0 +1,35 @@ +<!doctype html> +<html> + <head> + <title>document.domain's getter</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script> + test(function() { + assert_equals(typeof document.domain, "string", "document.domain is a string"); + assert_not_equals(document.domain, "", "document.domain is not empty"); + }, "basics"); + + test(function() { + assert_equals(document.domain, window.location.hostname, "equals location.hostname"); + }, "current document"); + + test(function() { + var doc = new Document(); + assert_equals(doc.domain, window.location.hostname, "equals location.hostname"); + }, "new Document()"); + + async_test(t => { + const client = new XMLHttpRequest(); + client.open("GET", "/common/blank.html"); + client.responseType = "document" + client.send(); + client.onload = t.step_func_done(() => { + assert_equals(client.response.domain, window.location.hostname); + }); + }, "XMLHttpRequest's response document"); + </script> + </head> + <body> + </body> +</html> |