Backed out 2 changesets (bug 1676492) for causing failures at test_navigation.py. CLOSED TREE

Backed out changeset 09fd88048f35 (bug 1676492)
Backed out changeset bc76e6966ec9 (bug 1676492)
This commit is contained in:
Butkovits Atila 2022-08-30 20:56:51 +03:00
parent feca6731ff
commit 59d03e0b1d
12 changed files with 20 additions and 81 deletions

View File

@ -33,10 +33,6 @@ XPCOMUtils.defineLazyPreferenceGetter(
class AboutNewTabChild extends JSWindowActorChild {
handleEvent(event) {
if (event.type == "DOMContentLoaded") {
if (!this.contentWindow.document.body.firstElementChild) {
return; // about:newtab is a blank page
}
// If the separate about:welcome page is enabled, we can skip all of this,
// since that mode doesn't load any of the Activity Stream bits.
if (

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src chrome:; object-src 'none'" >
</head>
</html>

View File

@ -649,7 +649,6 @@ var gInitialPages = [
"about:sessionrestore",
"about:welcome",
"about:welcomeback",
"chrome://browser/content/blanktab.html",
];
function isInitialPage(url) {
@ -6744,9 +6743,7 @@ function setToolbarVisibility(
}
}
isVisible =
!!currentURI &&
(BookmarkingUI.isOnNewTabPage({ currentURI }) ||
currentURI?.spec == "chrome://browser/content/blanktab.html");
!!currentURI && BookmarkingUI.isOnNewTabPage({ currentURI });
break;
}
}

View File

@ -247,10 +247,6 @@ add_task(async function test_with_newtabpage_disabled() {
visible: true,
message: "Toolbar is visible with NTP enabled",
});
let firstid = await SpecialPowers.spawn(newtab.linkedBrowser, [], () => {
return content.document.body.firstElementChild?.id;
});
is(firstid, "root", "new tab page contains content");
await BrowserTestUtils.removeTab(newtab);
await SpecialPowers.pushPrefEnv({
@ -260,22 +256,11 @@ add_task(async function test_with_newtabpage_disabled() {
document.getElementById("cmd_newNavigatorTab").doCommand();
await TestUtils.waitForCondition(() => gBrowser.tabs.length == tabCount + 1);
newtab = gBrowser.selectedTab;
is(newtab.linkedBrowser.currentURI.spec, "about:blank", "blank is loaded");
await waitForBookmarksToolbarVisibility({
visible: true,
message: "Toolbar is visible with NTP disabled",
visible: false,
message: "Toolbar is not visible with NTP disabled",
});
is(
newtab.linkedBrowser.currentURI.spec,
"about:newtab",
"blank new tab is loaded"
);
firstid = await SpecialPowers.spawn(newtab.linkedBrowser, [], () => {
return content.document.body.firstElementChild;
});
ok(!firstid, "blank new tab page contains no content");
await BrowserTestUtils.removeTab(newtab);
await SpecialPowers.pushPrefEnv({

View File

@ -76,8 +76,7 @@ function isBlankPageURL(aURL) {
aURL == "about:blank" ||
aURL == "about:home" ||
aURL == "about:welcome" ||
aURL == BROWSER_NEW_TAB_URL ||
aURL == "chrome://browser/content/blanktab.html"
aURL == BROWSER_NEW_TAB_URL
);
}

View File

@ -35,7 +35,6 @@ browser.jar:
content/browser/aboutTabCrashed.css (content/aboutTabCrashed.css)
content/browser/aboutTabCrashed.js (content/aboutTabCrashed.js)
content/browser/aboutTabCrashed.xhtml (content/aboutTabCrashed.xhtml)
content/browser/blanktab.html (content/blanktab.html)
content/browser/browser.css (content/browser.css)
content/browser/browser.js (content/browser.js)
* content/browser/browser.xhtml (content/browser.xhtml)

View File

@ -100,7 +100,7 @@ static const RedirEntry kRedirMap[] = {
// Actual activity stream URL for home and newtab are set in channel
// creation
{"home", "about:blank", ACTIVITY_STREAM_FLAGS},
{"newtab", "chrome://browser/content/blanktab.html", ACTIVITY_STREAM_FLAGS},
{"newtab", "about:blank", ACTIVITY_STREAM_FLAGS},
{"welcome", "about:blank",
nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |

View File

@ -51,7 +51,7 @@ add_task(async function homepage_test_startpage_none() {
},
});
await check_homepage({
expectedURL: "chrome://browser/content/blanktab.html",
expectedURL: "about:blank",
expectedPageVal: 1,
});
});

View File

@ -1,33 +1,25 @@
function getSpec(uri) {
function checkSpec(uri, check, message) {
const { spec } = NetUtil.newChannel({
loadUsingSystemPrincipal: true,
uri,
}).URI;
info(`got ${spec} for ${uri}`);
return spec;
check(spec, "about:blank", message);
}
add_task(async function test_newtab_enabled() {
ok(
!getSpec("about:newtab").endsWith("/blanktab.html"),
checkSpec(
"about:newtab",
isnot,
"did not get blank for default about:newtab"
);
ok(
!getSpec("about:home").endsWith("/blanktab.html"),
"did not get blank for default about:home"
);
checkSpec("about:home", isnot, "did not get blank for default about:home");
await SpecialPowers.pushPrefEnv({
set: [["browser.newtabpage.enabled", false]],
});
ok(
getSpec("about:newtab").endsWith("/blanktab.html"),
"got special blank page when newtab is not enabled"
);
ok(
!getSpec("about:home").endsWith("/blanktab.html"),
"got special blank page for about:home"
);
checkSpec("about:newtab", is, "got blank when newtab is not enabled");
checkSpec("about:home", isnot, "still did not get blank for about:home");
});

View File

@ -32,8 +32,6 @@ const HOMEPAGE_OVERRIDE_KEY = "homepage_override";
const URL_OVERRIDES_TYPE = "url_overrides";
const NEW_TAB_KEY = "newTabURL";
const BLANK_HOMEPAGE_URL = "chrome://browser/content/blanktab.html";
var gHomePane = {
HOME_MODE_FIREFOX_HOME: "0",
HOME_MODE_BLANK: "1",
@ -102,8 +100,7 @@ var gHomePane = {
// If the new tab url was changed to about:blank or about:newtab
if (
AboutNewTab.newTabURL === "about:newtab" ||
AboutNewTab.newTabURL === "about:blank" ||
AboutNewTab.newTabURL === BLANK_HOMEPAGE_URL
AboutNewTab.newTabURL === "about:blank"
) {
let newtabEnabledPref = Services.prefs.getBoolPref(
this.NEWTAB_ENABLED_PREF,
@ -308,7 +305,7 @@ var gHomePane = {
// (and it makes existing tests happy).
let newValue;
if (
this._isBlankPage(homePage) ||
homePage === "about:blank" ||
(HomePage.isDefault && !HomePage.locked)
) {
newValue = "";
@ -338,7 +335,7 @@ var gHomePane = {
isHomePageBlank() {
const startupPref = Preferences.get("browser.startup.page");
return (
["about:blank", BLANK_HOMEPAGE_URL, ""].includes(HomePage.get()) ||
["about:blank", ""].includes(HomePage.get()) ||
startupPref.value === gMainPane.STARTUP_PREF_BLANK
);
},
@ -475,8 +472,8 @@ var gHomePane = {
}
break;
case this.HOME_MODE_BLANK:
if (!this._isBlankPage(HomePage.get())) {
HomePage.safeSet(BLANK_HOMEPAGE_URL);
if (HomePage.get() !== "about:blank") {
HomePage.safeSet("about:blank");
} else {
this._renderCustomSettings({ shouldShow: false });
}
@ -624,10 +621,6 @@ var gHomePane = {
);
},
_isBlankPage(url) {
return url == "about:blank" || url == BLANK_HOMEPAGE_URL;
},
/**
* Show the Restore Defaults button if any preference on the Home tab was
* changed, or hide it otherwise.

View File

@ -18,8 +18,6 @@ add_task(async function default_homepage_test() {
homeMode.dispatchEvent(new Event("command"));
is(Services.prefs.getCharPref("browser.startup.homepage"), "about:home");
// HOME_MODE_BLANK
homeMode.value = 1;
@ -30,11 +28,6 @@ add_task(async function default_homepage_test() {
"Wait for customSettings to be hidden."
);
is(
Services.prefs.getCharPref("browser.startup.homepage"),
"chrome://browser/content/blanktab.html"
);
// HOME_MODE_CUSTOM
homeMode.value = 2;

View File

@ -136,10 +136,6 @@ let HomePage = {
}
}
if (homePages == "about:blank") {
homePages = "chrome://browser/content/blanktab.html";
}
return homePages;
},