 });
        assert_throws_dom("SecurityError", function() { document.domain = REMOTE_HOST; });
        assert_throws_dom("SecurityError", function() { document.domain = "example.com"; });
      }, "failed setting of document.domain");

      async_test(function(t) {
        iframe.addEventListener("load", t.step_func_done(function() {
          // Before setting document.domain, the iframe is not
          // same-origin-domain, so security checks fail.
          assert_equals(iframe.contentDocument, null)