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.
michael@0 | 1 | function test() |
michael@0 | 2 | { |
michael@0 | 3 | waitForExplicitFinish(); |
michael@0 | 4 | |
michael@0 | 5 | test1(); |
michael@0 | 6 | } |
michael@0 | 7 | |
michael@0 | 8 | /** |
michael@0 | 9 | * 1. load about:addons in a new tab and select that tab |
michael@0 | 10 | * 2. insert a button with tooltiptext |
michael@0 | 11 | * 3. create a new blank tab and select that tab |
michael@0 | 12 | * 4. select the about:addons tab and hover the inserted button |
michael@0 | 13 | * 5. remove the about:addons tab |
michael@0 | 14 | * 6. remove the blank tab |
michael@0 | 15 | * |
michael@0 | 16 | * the test succeeds if it doesn't trigger any assertions |
michael@0 | 17 | */ |
michael@0 | 18 | function test1() { |
michael@0 | 19 | let uri = "about:addons"; |
michael@0 | 20 | let tab = gBrowser.addTab(); |
michael@0 | 21 | |
michael@0 | 22 | tab.linkedBrowser.addEventListener("load", function(aEvent) { |
michael@0 | 23 | tab.linkedBrowser.removeEventListener("load", arguments.callee, true); |
michael@0 | 24 | |
michael@0 | 25 | let doc = gBrowser.contentDocument; |
michael@0 | 26 | var e = doc.createElement("button"); |
michael@0 | 27 | e.setAttribute('label', "hello"); |
michael@0 | 28 | e.setAttribute('tooltiptext', "world"); |
michael@0 | 29 | doc.documentElement.insertBefore(e, doc.documentElement.firstChild); |
michael@0 | 30 | |
michael@0 | 31 | let tab2 = gBrowser.addTab(); |
michael@0 | 32 | gBrowser.selectedTab = tab2; |
michael@0 | 33 | |
michael@0 | 34 | setTimeout(function() { |
michael@0 | 35 | gBrowser.selectedTab = tab; |
michael@0 | 36 | |
michael@0 | 37 | let doc = gBrowser.contentDocument; |
michael@0 | 38 | var win = gBrowser.contentWindow; |
michael@0 | 39 | EventUtils.disableNonTestMouseEvents(true); |
michael@0 | 40 | try { |
michael@0 | 41 | EventUtils.synthesizeMouse(e, 1, 1, { type: "mouseover" }, win); |
michael@0 | 42 | EventUtils.synthesizeMouse(e, 2, 6, { type: "mousemove" }, win); |
michael@0 | 43 | EventUtils.synthesizeMouse(e, 2, 4, { type: "mousemove" }, win); |
michael@0 | 44 | } finally { |
michael@0 | 45 | EventUtils.disableNonTestMouseEvents(false); |
michael@0 | 46 | } |
michael@0 | 47 | |
michael@0 | 48 | executeSoon(function() { |
michael@0 | 49 | gBrowser.removeTab(tab, {animate: false}); |
michael@0 | 50 | gBrowser.removeTab(tab2, {animate: false}); |
michael@0 | 51 | ok(true, "pass if no assertions"); |
michael@0 | 52 | |
michael@0 | 53 | // done |
michael@0 | 54 | executeSoon(finish); |
michael@0 | 55 | }); |
michael@0 | 56 | }, 0); |
michael@0 | 57 | }, true); |
michael@0 | 58 | |
michael@0 | 59 | gBrowser.selectedTab = tab; |
michael@0 | 60 | gBrowser.selectedTab.linkedBrowser.loadURI(uri); |
michael@0 | 61 | } |