<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
<script>
var iframeHasLoadedFirstPage = false;

function runTest()
{
    if (!iframeHasLoadedFirstPage) {
        iframeHasLoadedFirstPage = true;

        shouldBeEqualToString("document.getElementById('theFrame').contentDocument.baseURI", "http://127.0.0.1:8000/dom/iframe-no-src-set-location.html");
        var iframe = document.getElementById('theFrame');
        iframe.src = "javascript:document.location.replace('./resources/iframe-no-src-set-location-pass.html')";
    } else {
        shouldBe("document.getElementById('theFrame').contentDocument.body.innerHTML", "'PASS\\n'");

        finishJSTest();
    }
}

</script>
</head>
<body>
<script>
description("This tests that an iframe with no src attribute uses the parent document's URL as a base when resolving non-fully-qualified URLs set by JavaScript.");
jsTestIsAsync = true;
</script>
<iframe id="theFrame" onload="runTest()"></iframe>
</body>
</html>
