<!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>
