Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 /*
5 * These tests make sure that dragging and dropping sites works as expected.
6 * Sites contained in the grid need to shift around to indicate the result
7 * of the drag-and-drop operation. If the grid is full and we're dragging
8 * a new site into it another one gets pushed out.
9 * This is a continuation of browser_newtab_drag_drop.js
10 * to decrease test run time, focusing on external sites.
11 */
12 function runTests() {
13 // drag a new site onto the very first cell
14 yield setLinks("0,1,2,3,4,5,6,7,8");
15 setPinnedLinks(",,,,,,,7,8");
17 yield addNewTabPageTab();
18 checkGrid("0,1,2,3,4,5,6,7p,8p");
20 yield simulateExternalDrop(0);
21 checkGrid("99p,0,1,2,3,4,5,7p,8p");
23 // drag a new site onto the grid and make sure that pinned cells don't get
24 // pushed out
25 yield setLinks("0,1,2,3,4,5,6,7,8");
26 setPinnedLinks(",,,,,,,7,8");
28 yield addNewTabPageTab();
29 checkGrid("0,1,2,3,4,5,6,7p,8p");
31 yield simulateExternalDrop(7);
32 checkGrid("0,1,2,3,4,5,7p,99p,8p");
34 // drag a new site beneath a pinned cell and make sure the pinned cell is
35 // not moved
36 yield setLinks("0,1,2,3,4,5,6,7,8");
37 setPinnedLinks(",,,,,,,,8");
39 yield addNewTabPageTab();
40 checkGrid("0,1,2,3,4,5,6,7,8p");
42 yield simulateExternalDrop(7);
43 checkGrid("0,1,2,3,4,5,6,99p,8p");
45 // drag a new site onto a block of pinned sites and make sure they're shifted
46 // around accordingly
47 yield setLinks("0,1,2,3,4,5,6,7,8");
48 setPinnedLinks("0,1,2,,,,,,");
50 yield addNewTabPageTab();
51 checkGrid("0p,1p,2p");
53 yield simulateExternalDrop(1);
54 checkGrid("0p,99p,1p,2p,3,4,5,6,7");
55 }