summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dom/null-document-location-assign-crash.html
blob: e5ee2994113ee73dd5f5d4904b17f43eba81649b (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
37
38
39
<p>This test checks for a NULL document crash that can happen when calling
location.assign. If the test passes, you'll see a PASS message below.</p>
<hr>
<pre id="pre"></pre>
<iframe style="visibility:hidden" src="does-not-exist.bogus"></iframe> <!-- forces asynchronous load -->
<script>
<!--
function log(s)
{
    document.getElementById("pre").appendChild(document.createTextNode(s));
}

function test()
{
    frames[0].location.assign("javascript:'<script>parent.pass()</script>'");
}

function pass()
{
    log("PASS: You didn't crash.");

    if (window.testRunner)
        testRunner.notifyDone();
}

function main()
{
    if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
    }    
    
    // setTimeout forces execution in the context of the frame
    frames[0].setTimeout(test, 0);
}

main();
-->
</script>