1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/base/content/test/newtab/browser_newtab_drop_preview.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,22 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + http://creativecommons.org/publicdomain/zero/1.0/ */ 1.6 + 1.7 +/* 1.8 + * These tests ensure that the drop preview correctly arranges sites when 1.9 + * dragging them around. 1.10 + */ 1.11 +function runTests() { 1.12 + // the first three sites are pinned - make sure they're re-arranged correctly 1.13 + yield setLinks("0,1,2,3,4,5,6,7,8"); 1.14 + setPinnedLinks("0,1,2,,,5"); 1.15 + 1.16 + yield addNewTabPageTab(); 1.17 + checkGrid("0p,1p,2p,3,4,5p,6,7,8"); 1.18 + 1.19 + let cw = getContentWindow(); 1.20 + cw.gDrag._draggedSite = getCell(0).site; 1.21 + let sites = cw.gDropPreview.rearrange(getCell(4)); 1.22 + cw.gDrag._draggedSite = null; 1.23 + 1.24 + checkGrid("3,1p,2p,4,0p,5p,6,7,8", sites); 1.25 +}