summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/loader/meta-refresh-vs-open.html
blob: 3644877b5e9b28debc459c429f7d12ce1e6f3eed (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
33
34
35
36
<html>
<head>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}
</script>
<meta http-equiv="refresh" content="0;url=data:text/plain,You should not have been redirected here.">
</head>
<body>
<iframe id="ifrm" src="about:blank"></iframe>
<script>
    document.body.onload = function() {
        if (window.testRunner)
            document.write('<p>FAIL: onload</p>');
        else
            alert('FAIL: onload');
    }

    // Having a subframe open should prevent refresh.
    document.getElementById("ifrm").contentDocument.open();

    setTimeout(function () {
        // Test succeeded, now remove traps and return to a state that won't confuse our test runner.
        document.body.onload = function() {};
        if (window.stop)
            stop();
        document.getElementById("ifrm").contentDocument.close();
        if (window.testRunner)
            testRunner.notifyDone();
      }, 500);
</script>
<p>SUCCESS - shouldn't refresh or invoke onload.</p>
</body>
</html>