Bug 1634272 - Don't use DocumentChannel for about:newtab r=mattwoodrow default tip
authorPaul Bone <pbone@mozilla.com>
Wed, 03 Jun 2020 05:14:37 +0000
changeset 533632 bf162b065e1feaa64d6df95bc55ee8a894312d34
parent 533631 cee3a0f1d1c8dfb08f05504d3beed3011183be67
push id37474
push userabutkovits@mozilla.com
push dateWed, 03 Jun 2020 09:29:05 +0000
treeherdermozilla-central@bf162b065e1f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1634272, 1626507
milestone79.0a1
first release with
nightly linux32
bf162b065e1f / 79.0a1 / 20200603092905 / files
nightly linux64
bf162b065e1f / 79.0a1 / 20200603092905 / files
nightly mac
bf162b065e1f / 79.0a1 / 20200603092905 / files
nightly win32
bf162b065e1f / 79.0a1 / 20200603092905 / files
nightly win64
bf162b065e1f / 79.0a1 / 20200603092905 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1634272 - Don't use DocumentChannel for about:newtab r=mattwoodrow To avoid this regression we can avoid DocumentChannel because it'll probably be fixed by Bug 1626507. Differential Revision: https://phabricator.services.mozilla.com/D77638
browser/base/content/test/tabs/browser.ini
browser/base/content/test/tabs/browser_navigate_home_focuses_addressbar.js
toolkit/modules/E10SUtils.jsm
--- a/browser/base/content/test/tabs/browser.ini
+++ b/browser/base/content/test/tabs/browser.ini
@@ -54,16 +54,17 @@ support-files = tab_that_closes.html
 [browser_multiselect_tabs_reopen_in_container.js]
 [browser_multiselect_tabs_reorder.js]
 [browser_multiselect_tabs_using_Ctrl.js]
 [browser_multiselect_tabs_using_keyboard.js]
 skip-if = os == 'mac' # Skipped because macOS keyboard support requires changing system settings
 [browser_multiselect_tabs_using_selectedTabs.js]
 [browser_multiselect_tabs_using_Shift_and_Ctrl.js]
 [browser_multiselect_tabs_using_Shift.js]
+[browser_navigate_home_focuses_addressbar.js]
 [browser_navigatePinnedTab.js]
 [browser_new_file_whitelisted_http_tab.js]
 skip-if = !e10s # Test only relevant for e10s.
 [browser_new_tab_insert_position.js]
 skip-if = (debug && os == 'linux' && bits == 32) #Bug 1455882, disabled on Linux32 for almost permafailing
 support-files = file_new_tab_page.html
 [browser_new_tab_in_privilegedabout_process_pref.js]
 skip-if = !e10s || (os == 'linux' && debug && bits == 64) # Pref and test only relevant for e10s, Bug 1581500.
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabs/browser_navigate_home_focuses_addressbar.js
@@ -0,0 +1,16 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+
+const TEST_HTTP = httpURL("dummy_page.html");
+
+// Test for Bug 1634272
+add_task(async function() {
+  await BrowserTestUtils.withNewTab(TEST_HTTP, async function(browser) {
+    info("Tab ready");
+
+    document.getElementById("home-button").click();
+    await BrowserTestUtils.browserLoaded(browser, false, HomePage.get());
+    is(gURLBar.value, "", "URL bar should be empty");
+    ok(gURLBar.focused, "URL bar should be focused");
+  });
+});
--- a/toolkit/modules/E10SUtils.jsm
+++ b/toolkit/modules/E10SUtils.jsm
@@ -130,16 +130,17 @@ const kSafeSchemes = [
   "xmpp",
 ];
 
 const kDocumentChannelDeniedSchemes = ["javascript"];
 const kDocumentChannelDeniedURIs = [
   "about:blank",
   "about:crashcontent",
   "about:newtab",
+  "about:home",
   "about:printpreview",
 ];
 
 // Changes here should also be made in URIUsesDocChannel in nsDocShell.cpp.
 function documentChannelPermittedForURI(aURI) {
   return (
     !kDocumentChannelDeniedSchemes.includes(aURI.scheme) &&
     !kDocumentChannelDeniedURIs.includes(aURI.spec)