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