2011-02-27 17:36:36 -08:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
2011-01-21 13:12:12 -08:00
|
|
|
|
|
|
|
function test() {
|
|
|
|
let cw;
|
|
|
|
|
|
|
|
let createGroupItem = function () {
|
|
|
|
let bounds = new cw.Rect(20, 20, 150, 150);
|
|
|
|
let groupItem = new cw.GroupItem([], {bounds: bounds, immediately: true});
|
|
|
|
|
2011-04-22 13:05:11 -07:00
|
|
|
cw.UI.setActive(groupItem);
|
2011-01-21 13:12:12 -08:00
|
|
|
gBrowser.loadOneTab('about:blank', {inBackground: true});
|
|
|
|
|
|
|
|
return groupItem;
|
|
|
|
}
|
|
|
|
|
|
|
|
let testVeryQuickDragAndDrop = function () {
|
2011-01-21 15:15:22 -08:00
|
|
|
let sourceGroup = createGroupItem();
|
|
|
|
let targetGroup = cw.GroupItems.groupItems[0];
|
2011-01-21 13:12:12 -08:00
|
|
|
|
|
|
|
sourceGroup.pushAway(true);
|
|
|
|
targetGroup.pushAway(true);
|
|
|
|
|
|
|
|
let sourceTab = sourceGroup.getChild(0).container;
|
|
|
|
EventUtils.synthesizeMouseAtCenter(sourceTab, {type: 'mousedown'}, cw);
|
|
|
|
|
|
|
|
let targetTab = targetGroup.getChild(0).container;
|
|
|
|
EventUtils.synthesizeMouseAtCenter(targetTab, {type: 'mousemove'}, cw);
|
|
|
|
EventUtils.synthesizeMouseAtCenter(targetTab, {type: 'mouseup'}, cw);
|
|
|
|
|
|
|
|
is(targetGroup.getChildren().length, 2, 'target group has two tabs');
|
2011-07-03 17:11:40 -07:00
|
|
|
is(cw.GroupItems.groupItems.length, 1, 'sourceGroup was closed');
|
|
|
|
isnot(cw.GroupItems.groupItems[0], sourceGroup, 'sourceGroup was closed');
|
2011-01-21 13:12:12 -08:00
|
|
|
|
|
|
|
targetGroup.getChild(0).close();
|
2011-07-03 17:11:40 -07:00
|
|
|
hideTabView(finish);
|
2011-01-21 13:12:12 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
showTabView(function () {
|
|
|
|
cw = TabView.getContentWindow();
|
|
|
|
afterAllTabsLoaded(testVeryQuickDragAndDrop);
|
|
|
|
});
|
|
|
|
}
|