diff -r 000000000000 -r 6474c204b198 browser/components/tabview/test/browser_tabview_bug604098.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/browser/components/tabview/test/browser_tabview_bug604098.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,41 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +let contentWindow; +let contentElement; + +function test() { + waitForExplicitFinish(); + + registerCleanupFunction(function() { + if (gBrowser.tabs.length > 1) + gBrowser.removeTab(gBrowser.tabs[1]); + hideTabView(); + }); + + showTabView(function() { + contentWindow = TabView.getContentWindow(); + contentElement = contentWindow.document.getElementById("content"); + test1(); + }); +} + +function test1() { + let groupItems = contentWindow.GroupItems.groupItems; + is(groupItems.length, 1, "there is one groupItem"); + + whenTabViewIsHidden(function() { + gBrowser.selectedTab = gBrowser.tabs[0]; + is(groupItems.length, 2, "there are two groupItems"); + closeGroupItem(groupItems[1], finish); + }); + + // double click + doubleClick(contentElement, 0); +} + +function doubleClick(targetElement, buttonCode) { + EventUtils.sendMouseEvent( + { type: "dblclick", button: buttonCode }, targetElement, contentWindow); +} +