browser_bug462289.js
Go to the documentation of this file.
1 var tab1, tab2;
2 
3 function test() {
5 
6  tab1 = gBrowser.addTab();
7  tab2 = gBrowser.addTab();
8 
9  EventUtils.synthesizeMouse(tab1, 2, 2, {});
10  setTimeout(step2, 0);
11 }
12 
13 function step2()
14 {
15  isnot(document.activeElement, tab1, "mouse on tab not activeElement");
16 
17  EventUtils.synthesizeMouse(tab1, 2, 2, {});
18  setTimeout(step3, 0);
19 }
20 
21 function step3()
22 {
23  isnot(document.activeElement, tab1, "mouse on tab again activeElement");
24 
25  document.getElementById("searchbar").focus();
26  EventUtils.synthesizeKey("VK_TAB", { });
27  is(document.activeElement, tab1, "tab key to tab activeElement");
28 
29  EventUtils.synthesizeMouse(tab1, 2, 2, {});
30  setTimeout(step4, 0);
31 }
32 
33 function step4()
34 {
35  is(document.activeElement, tab1, "mouse on tab while focused still activeElement");
36 
37  EventUtils.synthesizeMouse(tab2, 2, 2, {});
38  setTimeout(step5, 0);
39 }
40 
41 function step5()
42 {
43  // The tabbox selects a tab within a setTimeout in a bubbling mousedown event
44  // listener, and focuses the current tab if another tab previously had focus
45  is(document.activeElement, tab2, "mouse on another tab while focused still activeElement");
46 
47  content.focus();
48  EventUtils.synthesizeMouse(tab2, 2, 2, {button: 1, type: "mousedown"});
49  setTimeout(step6, 0);
50 }
51 
52 function step6()
53 {
54  isnot(document.activeElement, tab2, "tab not focused via middle click");
55 
56  gBrowser.removeTab(tab1);
57  gBrowser.removeTab(tab2);
58 
59  finish();
60 }
function step3()
function step2()
function step5()
waitForExplicitFinish()
aWindow setTimeout(function(){_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap);}, 0)
var tab1
var tab2
function test()
function step4()
function step6()