2 <script src="../js/resources/js-test-pre.js"></script>
5 <p id="description"></p>
6 <pre id="console"></pre>
8 description('Verifies that we can go back and forward from the top level of a frame set where a window changes its name after the initial load.');
14 if (window.layoutTestController) {
15 layoutTestController.setCanOpenWindows();
16 layoutTestController.dumpAsText();
17 layoutTestController.waitUntilDone();
20 testWindow = window.open('resources/history-subframe-with-name-container.html');
22 testFailed('Could not open test window');
27 1: 'FRAME_LOADED_INITIAL',
28 2: 'FRAME_LOADED_NAV',
29 3: 'FRAME_LOADED_BACK',
30 4: 'FRAME_LOADED_FORWARD'
36 function onFrameLoaded(pageId)
38 // The page ID is put in a global so that the eval() inside of shouldBe can
40 currentPageId = pageId;
43 switch (currentState) {
45 shouldBe('2', 'currentPageId');
48 shouldBe('3', 'currentPageId');
49 testWindow.history.back();
52 shouldBe('2', 'currentPageId');
53 testWindow.history.forward();
56 shouldBe('3', 'currentPageId');
59 testFailed('Should not be in state ' + currentState);
63 if (currentState == 4) {
64 testPassed('Complete: navigated through all the states');
65 if (window.layoutTestController)
66 layoutTestController.notifyDone();