summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/loader/onunload-form-submit-crash-2.html
blob: c414698f8a994a389438c30170548ee9610a7fd2 (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
<html>
<head>
    <title>Test for http://bugs.webkit.org/show_bug.cgi?id=13015</title>
    <script>
        function test()
        {
            if (location.href.indexOf("?") == -1) {
                if (window.testRunner) {
                    testRunner.dumpAsText();
                    testRunner.waitUntilDone();
                }
                location.href = "resources/onunload-form-submit-success.html";
            } else {
                document.getElementById("result").innerText = "FAIL";
                if (window.testRunner)
                    testRunner.notifyDone();
            }
        }

        function handleUnload()
        {
            if (location.href.indexOf("?") == -1)
                document.myForm.submit();
        }
    </script>
</head>
<body onload="test()" onunload="handleUnload()">
    <form name="myForm">
    </form>
    <p id="result">
        Test did not finish.
    </p>
</body>
<html>