Backed out changeset 70253d6678af (bug 1295072) for failures in browser_ext_tabs_create.js
authorPhil Ringnalda <philringnalda@gmail.com>
Sun, 05 Feb 2017 13:23:21 -0800
changeset 479278 951bab16551ab166d754f8c8fcea69fda7d98773
parent 479277 d2a01f76d88f836438078efabf9ca55c048b073e
child 479279 20e6f90089fadb1c946894445a5b663922eb4ca1
push id44211
push userbmo:hskupin@gmail.com
push dateMon, 06 Feb 2017 12:18:11 +0000
bugs1295072
milestone54.0a1
backs out70253d6678af8e2f2b4386c77e825af9f600fe46
Backed out changeset 70253d6678af (bug 1295072) for failures in browser_ext_tabs_create.js
browser/components/extensions/ext-tabs.js
browser/components/extensions/test/browser/browser_ext_tabs_create.js
--- a/browser/components/extensions/ext-tabs.js
+++ b/browser/components/extensions/ext-tabs.js
@@ -413,20 +413,16 @@ extensions.registerSchemaAPI("tabs", "ad
           if (createProperties.index !== null) {
             window.gBrowser.moveTabTo(tab, createProperties.index);
           }
 
           if (createProperties.pinned) {
             window.gBrowser.pinTab(tab);
           }
 
-          if (active && !url) {
-            window.focusAndSelectUrlBar();
-          }
-
           if (createProperties.url && createProperties.url !== window.BROWSER_NEW_TAB_URL) {
             // We can't wait for a location change event for about:newtab,
             // since it may be pre-rendered, in which case its initial
             // location change event has already fired.
 
             // Mark the tab as initializing, so that operations like
             // `executeScript` wait until the requested URL is loaded in
             // the tab before dispatching messages to the inner window
--- a/browser/components/extensions/test/browser/browser_ext_tabs_create.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_create.js
@@ -1,13 +1,13 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
-add_task(function* test_create_options() {
+add_task(function* () {
   let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:robots");
   gBrowser.selectedTab = tab;
 
   // TODO: Multiple windows.
 
   // Using pre-loaded new tab pages interferes with onUpdated events.
   // It probably shouldn't.
   SpecialPowers.setBoolPref("browser.newtab.preload", false);
@@ -159,40 +159,8 @@ add_task(function* test_create_options()
 
   yield extension.startup();
   yield extension.awaitFinish("tabs.create");
   yield extension.unload();
 
   yield BrowserTestUtils.removeTab(tab);
 });
 
-add_task(function* test_urlbar_focus() {
-  const extension = ExtensionTestUtils.loadExtension({
-    background() {
-      browser.test.onMessage.addListener(async (cmd, ...args) => {
-        const result = await browser.tabs[cmd](...args);
-        browser.test.sendMessage("result", result);
-      });
-    },
-  });
-
-  yield extension.startup();
-
-  // Test content is focused after opening a regular url
-  extension.sendMessage("create", {url: "https://example.com"});
-  const tab1 = yield extension.awaitMessage("result");
-
-  is(document.activeElement.tagName, "browser", "Content focused after opening a web page");
-
-  extension.sendMessage("remove", tab1.id);
-  yield extension.awaitMessage("result");
-
-  // Test urlbar is focused after opening an empty tab
-  extension.sendMessage("create", {});
-  const tab2 = yield extension.awaitMessage("result");
-
-  ok(gURLBar.focused, "Urlbar focused after opening an empty tab");
-
-  extension.sendMessage("remove", tab2.id);
-  yield extension.awaitMessage("result");
-
-  yield extension.unload();
-});