Bug 1640665 - Use `inBackground` parameter of duplicateTab in duplicateTabIn. r=robwu
authorharsh <aroraharsh010@gmail.com>
Thu, 23 Jul 2020 17:52:09 +0000
changeset 541813 d9e15f6cc3505d97898daafe3e6c7282060f2021
parent 541812 f25c770ccbf3cd6876f06f9b1940461064c1b64e
child 541814 f8e83f5b68e0e151df25cf6021fc3ab985a6a012
push id37633
push userccoroiu@mozilla.com
push dateFri, 24 Jul 2020 09:32:06 +0000
treeherdermozilla-central@141543043270 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrobwu
bugs1640665
milestone80.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 1640665 - Use `inBackground` parameter of duplicateTab in duplicateTabIn. r=robwu Differential Revision: https://phabricator.services.mozilla.com/D84236
browser/base/content/browser.js
browser/base/content/test/general/browser_bug623893.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -8524,18 +8524,19 @@ function duplicateTabIn(aTab, where, del
         "browser-delayed-startup-finished"
       );
       break;
     case "tabshifted":
       SessionStore.duplicateTab(window, aTab, delta);
       // A background tab has been opened, nothing else to do here.
       break;
     case "tab":
-      let newTab = SessionStore.duplicateTab(window, aTab, delta);
-      gBrowser.selectedTab = newTab;
+      SessionStore.duplicateTab(window, aTab, delta, true, {
+        inBackground: false,
+      });
       break;
   }
 }
 
 var MousePosTracker = {
   _listeners: new Set(),
   _x: 0,
   _y: 0,
--- a/browser/base/content/test/general/browser_bug623893.js
+++ b/browser/base/content/test/general/browser_bug623893.js
@@ -28,14 +28,13 @@ function promiseGetIndex(browser) {
   });
 }
 
 let duplicate = async function(delta, msg, cb) {
   var startIndex = await promiseGetIndex(gBrowser.selectedBrowser);
 
   duplicateTabIn(gBrowser.selectedTab, "tab", delta);
 
-  let tab = gBrowser.selectedTab;
-  await BrowserTestUtils.waitForEvent(tab, "SSTabRestored");
+  await BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "SSTabRestored");
 
   let endIndex = await promiseGetIndex(gBrowser.selectedBrowser);
   is(endIndex, startIndex + delta, msg);
 };