Bug 1102017 - Fix and enable browser_bug462289.js for e10s. r=mconley
authorDão Gottwald <dao@mozilla.com>
Thu, 03 Mar 2016 17:06:48 +0100
changeset 322925 0e4a7aef432e7dab0133cdf28daa1fb71ada2733
parent 322924 d3bd4762581e1bf0dae4c17acd1a7ff65dccc299
child 322926 4e811a988416d26049193abb91acf67bc9c1fe0a
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1102017, 462289
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1102017 - Fix and enable browser_bug462289.js for e10s. r=mconley
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_bug462289.js
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -185,17 +185,17 @@ skip-if = true # bug 428712
 [browser_bug435035.js]
 [browser_bug435325.js]
 skip-if = buildapp == 'mulet' || e10s # Bug 1099156 - test directly manipulates content
 [browser_bug441778.js]
 skip-if = buildapp == 'mulet'
 [browser_bug455852.js]
 [browser_bug460146.js]
 [browser_bug462289.js]
-skip-if = toolkit == "cocoa" || e10s # Bug 1102017 - middle-button mousedown on selected tab2 does not activate tab - Didn't expect [object XULElement], but got it
+skip-if = toolkit == "cocoa"
 [browser_bug462673.js]
 [browser_bug477014.js]
 [browser_bug479408.js]
 skip-if = buildapp == 'mulet'
 [browser_bug481560.js]
 [browser_bug484315.js]
 [browser_bug491431.js]
 skip-if = buildapp == 'mulet'
--- a/browser/base/content/test/general/browser_bug462289.js
+++ b/browser/base/content/test/general/browser_bug462289.js
@@ -12,63 +12,66 @@ function focus_in_navbar()
 function test()
 {
   waitForExplicitFinish();
 
   tab1 = gBrowser.addTab("about:blank", {skipAnimation: true});
   tab2 = gBrowser.addTab("about:blank", {skipAnimation: true});
 
   EventUtils.synthesizeMouseAtCenter(tab1, {});
-  setTimeout(step2, 0);
+  executeSoon(step2);
 }
 
 function step2()
 {
   is(gBrowser.selectedTab, tab1, "1st click on tab1 selects tab");
   isnot(document.activeElement, tab1, "1st click on tab1 does not activate tab");
 
   EventUtils.synthesizeMouseAtCenter(tab1, {});
-  setTimeout(step3, 0);
+  executeSoon(step3);
 }
 
 function step3()
 {
   is(gBrowser.selectedTab, tab1, "2nd click on selected tab1 keeps tab selected");
   isnot(document.activeElement, tab1, "2nd click on selected tab1 does not activate tab");
 
   ok(true, "focusing URLBar then sending 1 Shift+Tab.");
   gURLBar.focus();
   EventUtils.synthesizeKey("VK_TAB", {shiftKey: true});
   is(gBrowser.selectedTab, tab1, "tab key to selected tab1 keeps tab selected");
   is(document.activeElement, tab1, "tab key to selected tab1 activates tab");
 
   EventUtils.synthesizeMouseAtCenter(tab1, {});
-  setTimeout(step4, 0);
+  executeSoon(step4);
 }
 
 function step4()
 {
   is(gBrowser.selectedTab, tab1, "3rd click on activated tab1 keeps tab selected");
   is(document.activeElement, tab1, "3rd click on activated tab1 keeps tab activated");
 
+  gBrowser.addEventListener("TabSwitchDone", step5);
   EventUtils.synthesizeMouseAtCenter(tab2, {});
-  setTimeout(step5, 0);
 }
 
 function step5()
 {
+  gBrowser.removeEventListener("TabSwitchDone", step5);
+
   // The tabbox selects a tab within a setTimeout in a bubbling mousedown event
   // listener, and focuses the current tab if another tab previously had focus.
   is(gBrowser.selectedTab, tab2, "click on tab2 while tab1 is activated selects tab");
   is(document.activeElement, tab2, "click on tab2 while tab1 is activated activates tab");
 
-  ok(true, "focusing content then sending middle-button mousedown to tab2.");
+  info("focusing content then sending middle-button mousedown to tab2.");
   gBrowser.selectedBrowser.focus();
+
   EventUtils.synthesizeMouseAtCenter(tab2, {button: 1, type: "mousedown"});
-  setTimeout(step6, 0);
+  executeSoon(step6);
 }
 
 function step6()
 {
   is(gBrowser.selectedTab, tab2, "middle-button mousedown on selected tab2 keeps tab selected");
   isnot(document.activeElement, tab2, "middle-button mousedown on selected tab2 does not activate tab");
 
   gBrowser.removeTab(tab2);