cross-frame-access-history.html 1.43 KB
Newer Older
weinig's avatar
weinig committed
1 2 3 4 5
<html>
<head>
    <script src="resources/cross-frame-access.js"></script>
</head>
<body>
weinig's avatar
weinig committed
6
<iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-get-test.html" style=""></iframe>
weinig's avatar
weinig committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<pre id="console"></pre>
<script>

window.targetWindow = frames[0];

window.onload = function()
{
    if (window.layoutTestController)
        layoutTestController.dumpAsText();

    log("\n----- tests for getting/setting window.history and its properties -----\n");

    // history object
    log("Firefox prohibits getting 'history.length' but that seems unnecessarily strict since you're allowed to use the 'history' object.");
    shouldBeTrue("canGet('targetWindow.history.length')");

    shouldBeTrue("canGet('targetWindow.history.back')");
    shouldBeTrue("canGet('targetWindow.history.forward')");
    shouldBeTrue("canGet('targetWindow.history.go')");
weinig@apple.com's avatar
weinig@apple.com committed
26 27 28 29 30 31

    // FIXME: Calling these currently cause the subsequent test to include a dump of this test's render tree.
    // (see http://bugs.webkit.org/show_bug.cgi?id=16510)
    // shouldBeTrue("canCall('targetWindow.history.back')");
    // shouldBeTrue("canCall('targetWindow.history.forward')");
    // shouldBeTrue("canCall('targetWindow.history.go', '-1')");
weinig's avatar
weinig committed
32 33 34 35 36 37 38 39 40 41

    shouldBeTrue("canGet('targetWindow.history.toString')");
    shouldBe("toString('targetWindow.history')", "'[object History]'");

    // Work around DRT bug that causes subsequent tests to fail.
    window.stop();
}
</script>
</body>
</html>