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 dragging and dropping sites works as expected. michael@0: * Sites contained in the grid need to shift around to indicate the result michael@0: * of the drag-and-drop operation. If the grid is full and we're dragging michael@0: * a new site into it another one gets pushed out. michael@0: * This is a continuation of browser_newtab_drag_drop.js michael@0: * to decrease test run time, focusing on external sites. michael@0: */ michael@0: function runTests() { michael@0: // drag a new site onto the very first cell michael@0: yield setLinks("0,1,2,3,4,5,6,7,8"); michael@0: setPinnedLinks(",,,,,,,7,8"); michael@0: michael@0: yield addNewTabPageTab(); michael@0: checkGrid("0,1,2,3,4,5,6,7p,8p"); michael@0: michael@0: yield simulateExternalDrop(0); michael@0: checkGrid("99p,0,1,2,3,4,5,7p,8p"); michael@0: michael@0: // drag a new site onto the grid and make sure that pinned cells don't get michael@0: // pushed out michael@0: yield setLinks("0,1,2,3,4,5,6,7,8"); michael@0: setPinnedLinks(",,,,,,,7,8"); michael@0: michael@0: yield addNewTabPageTab(); michael@0: checkGrid("0,1,2,3,4,5,6,7p,8p"); michael@0: michael@0: yield simulateExternalDrop(7); michael@0: checkGrid("0,1,2,3,4,5,7p,99p,8p"); michael@0: michael@0: // drag a new site beneath a pinned cell and make sure the pinned cell is michael@0: // not moved michael@0: yield setLinks("0,1,2,3,4,5,6,7,8"); michael@0: setPinnedLinks(",,,,,,,,8"); michael@0: michael@0: yield addNewTabPageTab(); michael@0: checkGrid("0,1,2,3,4,5,6,7,8p"); michael@0: michael@0: yield simulateExternalDrop(7); michael@0: checkGrid("0,1,2,3,4,5,6,99p,8p"); michael@0: michael@0: // drag a new site onto a block of pinned sites and make sure they're shifted michael@0: // around accordingly michael@0: yield setLinks("0,1,2,3,4,5,6,7,8"); michael@0: setPinnedLinks("0,1,2,,,,,,"); michael@0: michael@0: yield addNewTabPageTab(); michael@0: checkGrid("0p,1p,2p"); michael@0: michael@0: yield simulateExternalDrop(1); michael@0: checkGrid("0p,99p,1p,2p,3,4,5,6,7"); michael@0: }