michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: function test() { michael@0: let cw; michael@0: michael@0: let createGroupItem = function () { michael@0: let bounds = new cw.Rect(20, 20, 150, 150); michael@0: let groupItem = new cw.GroupItem([], {bounds: bounds, immediately: true}); michael@0: michael@0: cw.UI.setActive(groupItem); michael@0: gBrowser.loadOneTab('about:blank', {inBackground: true}); michael@0: michael@0: return groupItem; michael@0: } michael@0: michael@0: let testVeryQuickDragAndDrop = function () { michael@0: let sourceGroup = createGroupItem(); michael@0: let targetGroup = cw.GroupItems.groupItems[0]; michael@0: michael@0: sourceGroup.pushAway(true); michael@0: targetGroup.pushAway(true); michael@0: michael@0: let sourceTab = sourceGroup.getChild(0).container; michael@0: EventUtils.synthesizeMouseAtCenter(sourceTab, {type: 'mousedown'}, cw); michael@0: michael@0: let targetTab = targetGroup.getChild(0).container; michael@0: EventUtils.synthesizeMouseAtCenter(targetTab, {type: 'mousemove'}, cw); michael@0: EventUtils.synthesizeMouseAtCenter(targetTab, {type: 'mouseup'}, cw); michael@0: michael@0: is(targetGroup.getChildren().length, 2, 'target group has two tabs'); michael@0: is(cw.GroupItems.groupItems.length, 1, 'sourceGroup was closed'); michael@0: isnot(cw.GroupItems.groupItems[0], sourceGroup, 'sourceGroup was closed'); michael@0: michael@0: targetGroup.getChild(0).close(); michael@0: hideTabView(finish); michael@0: } michael@0: michael@0: waitForExplicitFinish(); michael@0: michael@0: showTabView(function () { michael@0: cw = TabView.getContentWindow(); michael@0: afterAllTabsLoaded(testVeryQuickDragAndDrop); michael@0: }); michael@0: }