summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/history/history-back-twice-with-subframes-assert.html
blob: 2d2bafd9ab3b6dc1d918293a69a29c810e54045c (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
<!DOCTYPE html>
<script>
if (testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function runTest() {
    var loadCount = 2;
    var didGoBack = false;

    var frame1 = document.getElementById('frame1');
    var frame2 = document.getElementById('frame2');
    frame1.onload = frame2.onload = function() {
        loadCount--;
        if (loadCount)
            return;

        if (!didGoBack) {
            // We've navigated both frames, now go back 2 steps.
            loadCount = 2;
            history.go(-2);
            didGoBack = true;
            return;
        }
        
        if (testRunner)
            testRunner.notifyDone();
    }

    frame1.src = frame2.src = 'data:text/html,navigated'; 
}
</script>
<body onload="setTimeout(runTest, 0)">
<div>This tests that navigating two subframes and then going back using history.go(-2) won't assert.</div>
<iframe id='frame1' src='data:text/html,frame1'></iframe>
<iframe id='frame2' src='data:text/html,frame2'></iframe>
</body>