summaryrefslogtreecommitdiffstats
path: root/docshell/test/navigation/file_bug1758664.html
blob: 07798dfdddf3c5e62650015cf5742d645765fba8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html>
<head>
<script>
var onIframeOnload = function() {
    var iframe = window.document.getElementById('applicationIframe');
    opener.is(iframe.contentWindow.location.search, "?iframe", "Should have loaded the iframe");
    window.close();
    opener.SimpleTest.finish();
}

var onPageOnload = function() {
    if (location.search == "?iframe") {
      return;
    }
    if(!window.name) {
        window.name = 'file_bug1758664.html';
        window.location.reload();
        return;
    }
    var iframe = window.document.getElementById('applicationIframe');
    iframe.addEventListener('load', onIframeOnload);
    iframe.src = "file_bug1758664.html?iframe";
}
window.document.addEventListener("DOMContentLoaded", onPageOnload);

</script>
</head>
<body>
    <iframe id="applicationIframe"></iframe>
</body>
</html>