Bug 1521708, r=johannh
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 22 Jan 2019 15:24:36 +0000
changeset 514902 e2775f83185e13bc4eb050b8182fd59d00ca7867
parent 514901 acd0dadf80139d92223cf7506618621919418797
child 514903 96d9416e177cb1067d52340f2ced0596e3770e88
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1521708
milestone66.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 1521708, r=johannh Differential Revision: https://phabricator.services.mozilla.com/D17244
browser/base/content/tabbrowser.js
browser/components/urlbar/tests/browser/browser.ini
browser/components/urlbar/tests/browser/browser_urlbar_content_opener.js
--- a/browser/base/content/tabbrowser.js
+++ b/browser/base/content/tabbrowser.js
@@ -5191,17 +5191,17 @@ class TabProgressListener {
         let tabCacheIndex = gBrowser._tabLayerCache.indexOf(this.mTab);
         if (tabCacheIndex != -1) {
           gBrowser._tabLayerCache.splice(tabCacheIndex, 1);
           gBrowser._getSwitcher().cleanUpTabAfterEviction(this.mTab);
         }
       }
     }
 
-    if (!this.mBlank) {
+    if (!this.mBlank || this.mBrowser.hasContentOpener) {
       this._callProgressListeners("onLocationChange",
                                   [aWebProgress, aRequest, aLocation, aFlags]);
       if (topLevel && !isSameDocument) {
         // Include the true final argument to indicate that this event is
         // simulated (instead of being observed by the webProgressListener).
         this._callProgressListeners("onContentBlockingEvent",
                                     [aWebProgress, null, 0, true]);
       }
--- a/browser/components/urlbar/tests/browser/browser.ini
+++ b/browser/components/urlbar/tests/browser/browser.ini
@@ -35,16 +35,17 @@ skip-if = os != "mac" # Mac only feature
 [browser_page_action_menu_share_win.js]
 support-files =
   browser_page_action_menu_share_win.html
 skip-if = os != "win" # Windows only feature
 [browser_populateAfterPushState.js]
 [browser_urlbar_blanking.js]
 support-files =
   file_blank_but_not_blank.html
+[browser_urlbar_content_opener.js]
 [browser_urlbar_locationchange_urlbar_edit_dos.js]
 support-files =
   file_urlbar_edit_dos.html
 [browser_urlbar_remoteness_switch.js]
 run-if = e10s
 [browser_urlbar_searchsettings.js]
 [browser_urlbar_whereToOpen.js]
 [browser_urlbarCopying.js]
new file mode 100644
--- /dev/null
+++ b/browser/components/urlbar/tests/browser/browser_urlbar_content_opener.js
@@ -0,0 +1,18 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com");
+
+add_task(async function() {
+  await BrowserTestUtils.withNewTab(TEST_PATH + "dummy_page.html", async function(browser) {
+    let windowOpenedPromise = BrowserTestUtils.waitForNewWindow();
+    await ContentTask.spawn(browser, null, function() {
+      content.window.open("", "_BLANK", "toolbar=no,height=300,width=500");
+    });
+    let newWin = await windowOpenedPromise;
+    is(newWin.gURLBar.value, "about:blank", "Should be displaying about:blank for the opened window.");
+    await BrowserTestUtils.closeWindow(newWin);
+  });
+});