summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/loader/create-frame-in-DOMContentLoaded.html
blob: 8aa074c472fc8d2a60f40ac5d9b84df2d78245fe (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
<head>
<script>
var frame;
function print(message)
{
    var line = document.createElement("div");
    line.appendChild(document.createTextNode(message));
    document.body.appendChild(line);
}
function handleDOMContentLoadedEvent()
{
    document.body.removeChild(document.body.firstChild);
    print("A) Entered DOMContentLoaded event handler function.");
    frame = document.createElement("iframe");
    document.body.appendChild(frame);
    print("B) Exiting DOMContentLoaded event handler function.");
    if (window.testRunner)
        testRunner.notifyDone();
}
function handleLoadEvent()
{
    print("C) Entered load event handler function.");
    document.body.removeChild(frame);
    print("D) Exiting load event handler function.");
    print("Test passed if messages A, B, C, D were all in order and there was no crash.");
}
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}
addEventListener("load", handleLoadEvent);
addEventListener("DOMContentLoaded", handleDOMContentLoadedEvent);
</script>
</head>
<body>TEST DID NOT RUN YET</body>