michael@0: function test() michael@0: { michael@0: waitForExplicitFinish(); michael@0: michael@0: test1(); michael@0: } michael@0: michael@0: /** michael@0: * 1. load about:addons in a new tab and select that tab michael@0: * 2. insert a button with tooltiptext michael@0: * 3. create a new blank tab and select that tab michael@0: * 4. select the about:addons tab and hover the inserted button michael@0: * 5. remove the about:addons tab michael@0: * 6. remove the blank tab michael@0: * michael@0: * the test succeeds if it doesn't trigger any assertions michael@0: */ michael@0: function test1() { michael@0: let uri = "about:addons"; michael@0: let tab = gBrowser.addTab(); michael@0: michael@0: tab.linkedBrowser.addEventListener("load", function(aEvent) { michael@0: tab.linkedBrowser.removeEventListener("load", arguments.callee, true); michael@0: michael@0: let doc = gBrowser.contentDocument; michael@0: var e = doc.createElement("button"); michael@0: e.setAttribute('label', "hello"); michael@0: e.setAttribute('tooltiptext', "world"); michael@0: doc.documentElement.insertBefore(e, doc.documentElement.firstChild); michael@0: michael@0: let tab2 = gBrowser.addTab(); michael@0: gBrowser.selectedTab = tab2; michael@0: michael@0: setTimeout(function() { michael@0: gBrowser.selectedTab = tab; michael@0: michael@0: let doc = gBrowser.contentDocument; michael@0: var win = gBrowser.contentWindow; michael@0: EventUtils.disableNonTestMouseEvents(true); michael@0: try { michael@0: EventUtils.synthesizeMouse(e, 1, 1, { type: "mouseover" }, win); michael@0: EventUtils.synthesizeMouse(e, 2, 6, { type: "mousemove" }, win); michael@0: EventUtils.synthesizeMouse(e, 2, 4, { type: "mousemove" }, win); michael@0: } finally { michael@0: EventUtils.disableNonTestMouseEvents(false); michael@0: } michael@0: michael@0: executeSoon(function() { michael@0: gBrowser.removeTab(tab, {animate: false}); michael@0: gBrowser.removeTab(tab2, {animate: false}); michael@0: ok(true, "pass if no assertions"); michael@0: michael@0: // done michael@0: executeSoon(finish); michael@0: }); michael@0: }, 0); michael@0: }, true); michael@0: michael@0: gBrowser.selectedTab = tab; michael@0: gBrowser.selectedTab.linkedBrowser.loadURI(uri); michael@0: }