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 function test() {
5 let cw;
7 let createGroupItem = function () {
8 let bounds = new cw.Rect(20, 20, 150, 150);
9 let groupItem = new cw.GroupItem([], {bounds: bounds, immediately: true});
11 cw.UI.setActive(groupItem);
12 gBrowser.loadOneTab('about:blank', {inBackground: true});
14 return groupItem;
15 }
17 let testVeryQuickDragAndDrop = function () {
18 let sourceGroup = createGroupItem();
19 let targetGroup = cw.GroupItems.groupItems[0];
21 sourceGroup.pushAway(true);
22 targetGroup.pushAway(true);
24 let sourceTab = sourceGroup.getChild(0).container;
25 EventUtils.synthesizeMouseAtCenter(sourceTab, {type: 'mousedown'}, cw);
27 let targetTab = targetGroup.getChild(0).container;
28 EventUtils.synthesizeMouseAtCenter(targetTab, {type: 'mousemove'}, cw);
29 EventUtils.synthesizeMouseAtCenter(targetTab, {type: 'mouseup'}, cw);
31 is(targetGroup.getChildren().length, 2, 'target group has two tabs');
32 is(cw.GroupItems.groupItems.length, 1, 'sourceGroup was closed');
33 isnot(cw.GroupItems.groupItems[0], sourceGroup, 'sourceGroup was closed');
35 targetGroup.getChild(0).close();
36 hideTabView(finish);
37 }
39 waitForExplicitFinish();
41 showTabView(function () {
42 cw = TabView.getContentWindow();
43 afterAllTabsLoaded(testVeryQuickDragAndDrop);
44 });
45 }