michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: /* michael@0: * These tests make sure that all changes that are made to a specific michael@0: * 'New Tab Page' are synchronized with all other open 'New Tab Pages' michael@0: * automatically. All about:newtab pages should always be in the same michael@0: * state. michael@0: */ michael@0: function runTests() { michael@0: // Disabled until bug 716543 is fixed. michael@0: return; michael@0: michael@0: yield setLinks("0,1,2,3,4,5,6,7,8,9"); michael@0: setPinnedLinks(",1"); michael@0: michael@0: yield addNewTabPageTab(); michael@0: checkGrid("0,1p,2,3,4,5,6,7,8"); michael@0: michael@0: let resetButton = getContentDocument().getElementById("toolbar-button-reset"); michael@0: ok(!resetButton.hasAttribute("modified"), "page is not modified"); michael@0: michael@0: let oldSites = getGrid().sites; michael@0: let oldResetButton = resetButton; michael@0: michael@0: // create the new tab page michael@0: yield addNewTabPageTab(); michael@0: checkGrid("0,1p,2,3,4,5,6,7,8"); michael@0: michael@0: resetButton = getContentDocument().getElementById("toolbar-button-reset"); michael@0: ok(!resetButton.hasAttribute("modified"), "page is not modified"); michael@0: michael@0: // unpin a cell michael@0: yield unpinCell(1); michael@0: checkGrid("0,1,2,3,4,5,6,7,8"); michael@0: checkGrid("0,1,2,3,4,5,6,7,8", oldSites); michael@0: michael@0: // remove a cell michael@0: yield blockCell(1); michael@0: checkGrid("0,2,3,4,5,6,7,8,9"); michael@0: checkGrid("0,2,3,4,5,6,7,8,9", oldSites); michael@0: ok(resetButton.hasAttribute("modified"), "page is modified"); michael@0: ok(oldResetButton.hasAttribute("modified"), "page is modified"); michael@0: michael@0: // insert a new cell by dragging michael@0: yield simulateExternalDrop(1); michael@0: checkGrid("0,99p,2,3,4,5,6,7,8"); michael@0: checkGrid("0,99p,2,3,4,5,6,7,8", oldSites); michael@0: michael@0: // drag a cell around michael@0: yield simulateDrop(2, 1); michael@0: checkGrid("0,2p,99p,3,4,5,6,7,8"); michael@0: checkGrid("0,2p,99p,3,4,5,6,7,8", oldSites); michael@0: michael@0: // reset the new tab page michael@0: yield getContentWindow().gToolbar.reset(TestRunner.next); michael@0: checkGrid("0,1,2,3,4,5,6,7,8"); michael@0: checkGrid("0,1,2,3,4,5,6,7,8", oldSites); michael@0: ok(!resetButton.hasAttribute("modified"), "page is not modified"); michael@0: ok(!oldResetButton.hasAttribute("modified"), "page is not modified"); michael@0: }