Backed out 9 changesets (bug 1702330) for Mochitest failures in toolkit/components/url-classifier/tests/mochitest/test_reporturl.html. CLOSED TREE
Backed out changeset f84605e6fc8b (bug 1702330) Backed out changeset 79c63bf11b29 (bug 1702330) Backed out changeset 5425a2312f6e (bug 1702330) Backed out changeset d76516e0d07d (bug 1702330) Backed out changeset 3b75ffae171a (bug 1702330) Backed out changeset 4bb6ceb6adb3 (bug 1702330) Backed out changeset 607be325b4e8 (bug 1702330) Backed out changeset 4b345ea924cc (bug 1702330) Backed out changeset c7f0de372b21 (bug 1702330)
This commit is contained in:
@@ -125,7 +125,7 @@ add_task(async () => {
|
||||
// 5. Accessibility announcements dialog (#a11y-announcement)
|
||||
// 6. Tab notification deck (#tab-notification-deck) (proton only)
|
||||
let baseRootChildCount = Services.prefs.getBoolPref(
|
||||
"browser.proton.enabled",
|
||||
"browser.proton.infobars.enabled",
|
||||
false
|
||||
)
|
||||
? 6
|
||||
|
||||
@@ -34,8 +34,8 @@ XPCOMUtils.defineLazyPreferenceGetter(
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
"PROTON_ENABLED",
|
||||
"browser.proton.enabled",
|
||||
"PROTON_INFOBARS_ENABLED",
|
||||
"browser.proton.infobars.enabled",
|
||||
false
|
||||
);
|
||||
|
||||
@@ -162,7 +162,7 @@ var DefaultBrowserNotification = {
|
||||
|
||||
let iconPixels = win.devicePixelRatio > 1 ? "64" : "32";
|
||||
let iconURL = "chrome://branding/content/icon" + iconPixels + ".png";
|
||||
const priority = PROTON_ENABLED
|
||||
const priority = PROTON_INFOBARS_ENABLED
|
||||
? win.gNotificationBox.PRIORITY_SYSTEM
|
||||
: win.gNotificationBox.PRIORITY_INFO_MEDIUM;
|
||||
let callback = this._onNotificationEvent.bind(this);
|
||||
|
||||
@@ -397,7 +397,7 @@ XPCOMUtils.defineLazyGetter(this, "gHighPriorityNotificationBox", () => {
|
||||
return new MozElements.NotificationBox(element => {
|
||||
element.classList.add("global-notificationbox");
|
||||
element.setAttribute("notificationside", "top");
|
||||
if (gProton) {
|
||||
if (gProtonInfobarsEnabled) {
|
||||
// With Proton enabled all notification boxes are at the top, built into the browser chrome.
|
||||
let tabNotifications = document.getElementById("tab-notification-deck");
|
||||
gNavToolbox.insertBefore(element, tabNotifications);
|
||||
@@ -409,7 +409,7 @@ XPCOMUtils.defineLazyGetter(this, "gHighPriorityNotificationBox", () => {
|
||||
|
||||
// Regular notification bars shown at the bottom of the window.
|
||||
XPCOMUtils.defineLazyGetter(this, "gNotificationBox", () => {
|
||||
return gProton
|
||||
return gProtonInfobarsEnabled
|
||||
? gHighPriorityNotificationBox
|
||||
: new MozElements.NotificationBox(element => {
|
||||
element.classList.add("global-notificationbox");
|
||||
@@ -558,6 +558,14 @@ XPCOMUtils.defineLazyPreferenceGetter(
|
||||
}
|
||||
);
|
||||
|
||||
/* Temporary pref while the Proton infobars work stabilizes. */
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
"gProtonInfobarsEnabled",
|
||||
"browser.proton.infobars.enabled",
|
||||
false
|
||||
);
|
||||
|
||||
/* Temporary pref while the dust settles around the updated tooltip design
|
||||
for tabs and bookmarks toolbar. This will eventually be removed and
|
||||
browser.proton.enabled will be used instead. */
|
||||
|
||||
@@ -826,7 +826,7 @@
|
||||
if (!browser._notificationBox) {
|
||||
browser._notificationBox = new MozElements.NotificationBox(element => {
|
||||
element.setAttribute("notificationside", "top");
|
||||
if (gProton) {
|
||||
if (gProtonInfobarsEnabled) {
|
||||
element.setAttribute(
|
||||
"name",
|
||||
`tab-notification-box-${this._nextNotificationBoxId++}`
|
||||
@@ -1112,7 +1112,7 @@
|
||||
|
||||
this._appendStatusPanel();
|
||||
|
||||
if (gProton) {
|
||||
if (gProtonInfobarsEnabled) {
|
||||
this._updateVisibleNotificationBox(newBrowser);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ skip-if = tsan # Bug 1676326, highly frequent on TSan
|
||||
[browser_aboutNewTab_bookmarksToolbarNewWindow.js]
|
||||
[browser_aboutNewTab_bookmarksToolbarPrefs.js]
|
||||
[browser_aboutNewTab_defaultBrowserNotification.js]
|
||||
skip-if = debug || asan || tsan || ccov || verify # Default browser checks are skipped on debug builds, bug 1660723
|
||||
skip-if = debug || asan || tsan || ccov # Default browser checks are skipped on debug builds, bug 1660723
|
||||
[browser_aboutStopReload.js]
|
||||
[browser_aboutSupport.js]
|
||||
[browser_aboutSupport_newtab_security_state.js]
|
||||
|
||||
@@ -154,9 +154,7 @@ add_task(async function clicking_button_on_notification_calls_setAsDefault() {
|
||||
!shellService.isDefaultBrowser(),
|
||||
"should not be default prior to clicking button"
|
||||
);
|
||||
let button = notification.buttonContainer.querySelector(
|
||||
".notification-button"
|
||||
);
|
||||
let button = notification.querySelector(".notification-button");
|
||||
button.click();
|
||||
ok(
|
||||
shellService.isDefaultBrowser(),
|
||||
@@ -250,7 +248,8 @@ add_task(async function clicking_dismiss_disables_default_browser_checking() {
|
||||
"Notification should be default browser"
|
||||
);
|
||||
|
||||
notification.closeButton.click();
|
||||
let closeButton = notification.querySelector(".close-icon");
|
||||
closeButton.click();
|
||||
ok(
|
||||
!Services.prefs.getBoolPref("browser.shell.checkDefaultBrowser"),
|
||||
"checkDefaultBrowser bar pref should be false after dismissing notification"
|
||||
|
||||
@@ -31,7 +31,7 @@ function openAboutPrefPromise(win) {
|
||||
for (let protonEnabled of [true, false]) {
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.proton.enabled", protonEnabled]],
|
||||
set: [["browser.proton.infobars.enabled", protonEnabled]],
|
||||
});
|
||||
let win = await BrowserTestUtils.openNewWindowWithFlushedXULCacheForMozSupports();
|
||||
// Open a new tab to keep the window open.
|
||||
|
||||
@@ -72,10 +72,7 @@ add_task(async function test_opening_blocked_popups() {
|
||||
// Show the menu.
|
||||
let popupShown = BrowserTestUtils.waitForEvent(window, "popupshown");
|
||||
let popupFilled = waitForBlockedPopups(2);
|
||||
EventUtils.synthesizeMouseAtCenter(
|
||||
notification.buttonContainer.querySelector("button"),
|
||||
{}
|
||||
);
|
||||
notification.querySelector("button").doCommand();
|
||||
let popup_event = await popupShown;
|
||||
let menu = popup_event.target;
|
||||
is(menu.id, "blockedPopupOptions", "Blocked popup menu shown");
|
||||
|
||||
@@ -38,7 +38,23 @@ function createNotification({ browser, label, value, priority }) {
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.proton.enabled", true]],
|
||||
set: [["browser.proton.infobars.enabled", true]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function testNotificationDeckIsLazy() {
|
||||
let deck = document.getElementById("tab-notification-deck");
|
||||
ok(!deck, "There is no tab notification deck");
|
||||
await BrowserTestUtils.withNewTab("about:blank", async browser => {
|
||||
createNotification({
|
||||
browser,
|
||||
label: "First notification",
|
||||
value: "first-notification",
|
||||
priority: "PRIORITY_INFO_LOW",
|
||||
});
|
||||
|
||||
deck = document.getElementById("tab-notification-deck");
|
||||
ok(deck, "Creating a notification created the deck");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ add_task(async function test_slow_content_script() {
|
||||
|
||||
ok(text.includes("\u201cSlow Script Extension\u201d"), "Label is correct");
|
||||
|
||||
let stopButton = notification.buttonContainer.querySelector("[label='Stop']");
|
||||
let stopButton = notification.querySelector("[label='Stop']");
|
||||
stopButton.click();
|
||||
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
[browser_registerProtocolHandler_notification.js]
|
||||
support-files =
|
||||
browser_registerProtocolHandler_notification.html
|
||||
skip-if =
|
||||
verify
|
||||
|
||||
@@ -39,32 +39,12 @@ add_task(async function() {
|
||||
"info",
|
||||
"We expect this notification to have the type of 'info'."
|
||||
);
|
||||
|
||||
if (gProton) {
|
||||
// Make sure the CSS is fully loaded...
|
||||
await TestUtils.waitForCondition(
|
||||
() =>
|
||||
notification.shadowRoot.styleSheets.length &&
|
||||
[...notification.shadowRoot.styleSheets].every(s => s.rules.length)
|
||||
);
|
||||
is(
|
||||
notification.ownerGlobal.getComputedStyle(
|
||||
notification.messageImage,
|
||||
"::after"
|
||||
).content,
|
||||
'url("chrome://global/skin/icons/info.svg")',
|
||||
"We expect this notification to have an icon."
|
||||
);
|
||||
} else {
|
||||
ok(
|
||||
notification.messageImage.getAttribute("src"),
|
||||
"We expect this notification to have an icon."
|
||||
);
|
||||
}
|
||||
|
||||
let buttons = notification.buttonContainer.getElementsByClassName(
|
||||
"notification-button"
|
||||
ok(
|
||||
notification.messageImage.getAttribute("src"),
|
||||
"We expect this notification to have an icon."
|
||||
);
|
||||
|
||||
let buttons = notification.getElementsByClassName("notification-button");
|
||||
is(buttons.length, 1, "We expect see one button.");
|
||||
|
||||
let button = buttons[0];
|
||||
|
||||
@@ -94,9 +94,14 @@ async function test_decoder_doctor_notification(
|
||||
}
|
||||
ok(notification, "Got decoder-doctor-notification notification");
|
||||
|
||||
const protonInfobarsEnabled = Services.prefs.getBoolPref(
|
||||
"browser.proton.infobars.enabled",
|
||||
false
|
||||
);
|
||||
is(
|
||||
notification.messageText.textContent,
|
||||
notificationMessage + (gProton && isLink && label ? " " : ""),
|
||||
notificationMessage +
|
||||
(protonInfobarsEnabled && isLink && label ? " " : ""),
|
||||
"notification message should match expectation"
|
||||
);
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ class TestSafeBrowsingNotificationBar(WindowManagerMixin, MarionetteTestCase):
|
||||
|
||||
def check_get_me_out_of_here_button(self):
|
||||
with self.marionette.using_context("chrome"):
|
||||
if self.marionette.get_pref("browser.proton.enabled"):
|
||||
if self.marionette.get_pref("browser.proton.infobars.enabled"):
|
||||
notification_box = self.marionette.find_element(
|
||||
By.CSS_SELECTOR, 'vbox.notificationbox-stack[slot="selected"]'
|
||||
)
|
||||
@@ -125,7 +125,7 @@ class TestSafeBrowsingNotificationBar(WindowManagerMixin, MarionetteTestCase):
|
||||
|
||||
def check_x_button(self):
|
||||
with self.marionette.using_context("chrome"):
|
||||
if self.marionette.get_pref("browser.proton.enabled"):
|
||||
if self.marionette.get_pref("browser.proton.infobars.enabled"):
|
||||
notification_box = self.marionette.find_element(
|
||||
By.CSS_SELECTOR, 'vbox.notificationbox-stack[slot="selected"]'
|
||||
)
|
||||
|
||||
@@ -220,7 +220,9 @@ var Heartbeat = class {
|
||||
this.ratingContainer.appendChild(ratingElement);
|
||||
}
|
||||
|
||||
if (Services.prefs.getBoolPref("browser.proton.enabled")) {
|
||||
if (
|
||||
Services.prefs.getBoolPref("browser.proton.infobars.enabled", false)
|
||||
) {
|
||||
// This will append if there aren't any .text-link elements.
|
||||
this.notice.buttonContainer.append(this.ratingContainer);
|
||||
} else {
|
||||
|
||||
@@ -88,7 +88,7 @@ function getStars(notice, protonEnabled) {
|
||||
for (let protonEnabled of [true, false]) {
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["browser.proton.enabled", protonEnabled]],
|
||||
set: [["browser.proton.infobars.enabled", protonEnabled]],
|
||||
});
|
||||
let win = await BrowserTestUtils.openNewWindowWithFlushedXULCacheForMozSupports();
|
||||
// Open a new tab to keep the window open.
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
<!-- test code goes here -->
|
||||
<script type="application/javascript"><![CDATA[
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const PROTON_ENABLED = Services.prefs.getBoolPref("browser.proton.enabled", false);
|
||||
const NOTIFICATION_LOCAL_NAME = PROTON_ENABLED ? "notification-message" : "notification";
|
||||
const PROTON_INFOBARS_ENABLED = Services.prefs.getBoolPref("browser.proton.infobars.enabled", false);
|
||||
const NOTIFICATION_LOCAL_NAME = PROTON_INFOBARS_ENABLED ? "notification-message" : "notification";
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var testtag_notificationbox_buttons = [
|
||||
@@ -336,7 +336,7 @@ var tests =
|
||||
result(nb, ntf) {
|
||||
testtag_notificationbox_State(nb, "append link with callback", ntf, 1);
|
||||
|
||||
let buttonContainer = PROTON_ENABLED ? ntf.buttonContainer : ntf.messageDetails;
|
||||
let buttonContainer = PROTON_INFOBARS_ENABLED ? ntf.buttonContainer : ntf.messageDetails;
|
||||
let button = buttonContainer.lastElementChild;
|
||||
SimpleTest.is(button.localName, "button", "button is a button");
|
||||
SimpleTest.ok(!button.href, "button href is not set");
|
||||
@@ -385,7 +385,7 @@ var tests =
|
||||
result(nb, ntf) {
|
||||
testtag_notificationbox_State(nb, "append link with callback", ntf, 1);
|
||||
|
||||
let link = PROTON_ENABLED
|
||||
let link = PROTON_INFOBARS_ENABLED
|
||||
? ntf.messageText.lastElementChild.previousSibling.previousSibling
|
||||
: ntf.messageText.lastElementChild.previousSibling;
|
||||
SimpleTest.is(link.localName, "label", "link 1 is a label");
|
||||
@@ -541,7 +541,7 @@ function testtag_notification_State(nb, ntf, testid, label, value, image, priori
|
||||
|
||||
is(ntf.getAttribute("type"), type, testid + " notification type");
|
||||
|
||||
if (PROTON_ENABLED) {
|
||||
if (PROTON_INFOBARS_ENABLED) {
|
||||
let icons = {
|
||||
info: "chrome://global/skin/icons/info.svg",
|
||||
warning: "chrome://global/skin/icons/warning.svg",
|
||||
@@ -562,7 +562,7 @@ function checkPopupTest(nb, ntf)
|
||||
var evt = new Event("");
|
||||
ntf.dispatchEvent(evt);
|
||||
evt.target.buttonInfo = testtag_notificationbox_buttons[0];
|
||||
if (PROTON_ENABLED) {
|
||||
if (PROTON_INFOBARS_ENABLED) {
|
||||
ntf.handleEvent(evt);
|
||||
} else {
|
||||
ntf._doButtonCommand(evt);
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@media (-moz-proton) {
|
||||
@media (-moz-proton-infobars) {
|
||||
@media not (prefers-contrast) {
|
||||
.container.infobar {
|
||||
box-shadow: 0 1px 2px rgba(58, 57, 68, 0.1);
|
||||
@@ -276,7 +276,7 @@ strong {
|
||||
}
|
||||
}
|
||||
|
||||
@media not (-moz-proton) {
|
||||
@media not (-moz-proton-infobars) {
|
||||
:host {
|
||||
/* Colors used by default, and for [type=generic] message bars.*/
|
||||
background-color: var(--in-content-box-info-background);
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
// This is loaded into chrome windows with the subscript loader. If you need to
|
||||
// define globals, wrap in a block to prevent leaking onto `window`.
|
||||
{
|
||||
const { XPCOMUtils } = ChromeUtils.import(
|
||||
"resource://gre/modules/XPCOMUtils.jsm"
|
||||
);
|
||||
const { Services } = ChromeUtils.import(
|
||||
"resource://gre/modules/Services.jsm"
|
||||
);
|
||||
@@ -27,24 +24,17 @@
|
||||
this._insertElementFn = insertElementFn;
|
||||
this._animating = false;
|
||||
this.currentNotification = null;
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
"gProton",
|
||||
"browser.proton.enabled",
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
get stack() {
|
||||
if (!this._stack) {
|
||||
let stack;
|
||||
stack = document.createXULElement(
|
||||
this.gProton ? "vbox" : "legacy-stack"
|
||||
this.protonInfobarsEnabled ? "vbox" : "legacy-stack"
|
||||
);
|
||||
stack._notificationBox = this;
|
||||
stack.className = "notificationbox-stack";
|
||||
if (!this.gProton) {
|
||||
if (!this.protonInfobarsEnabled) {
|
||||
stack.appendChild(document.createXULElement("spacer"));
|
||||
}
|
||||
stack.addEventListener("transitionend", event => {
|
||||
@@ -180,7 +170,7 @@
|
||||
|
||||
// Create the Custom Element and connect it to the document immediately.
|
||||
var newitem;
|
||||
if (this.gProton && !aNotificationIs) {
|
||||
if (this.protonInfobarsEnabled && !aNotificationIs) {
|
||||
if (!customElements.get("notification-message")) {
|
||||
// There's some weird timing stuff when this element is created at
|
||||
// script load time, we don't need it until now anyway so be lazy.
|
||||
@@ -212,7 +202,7 @@
|
||||
}
|
||||
newitem.setAttribute("value", aValue);
|
||||
|
||||
if (aImage && !this.gProton) {
|
||||
if (aImage && !this.protonInfobarsEnabled) {
|
||||
newitem.messageImage.setAttribute("src", aImage);
|
||||
}
|
||||
newitem.eventCallback = aEventCallback;
|
||||
@@ -253,7 +243,7 @@
|
||||
if (!aItem.parentNode) {
|
||||
return;
|
||||
}
|
||||
if (this.gProton) {
|
||||
if (this.protonInfobarsEnabled) {
|
||||
this.currentNotification = aItem;
|
||||
this.removeCurrentNotification(aSkipAnimation);
|
||||
} else if (aItem == this.currentNotification) {
|
||||
@@ -368,6 +358,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get protonInfobarsEnabled() {
|
||||
return Services.prefs.getBoolPref(
|
||||
"browser.proton.infobars.enabled",
|
||||
false
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
// These are defined on the instance prototype for backwards compatibility.
|
||||
@@ -545,6 +542,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get protonInfobarsEnabled() {
|
||||
return Services.prefs.getBoolPref(
|
||||
"browser.proton.infobars.enabled",
|
||||
false
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
customElements.define("notification", MozElements.Notification);
|
||||
|
||||
@@ -191,7 +191,7 @@ notification[type="critical"] > hbox > .messageImage {
|
||||
background-color: var(--notification-primary-button-background-active);
|
||||
}
|
||||
|
||||
@media (-moz-proton) {
|
||||
@media (-moz-proton-infobars) {
|
||||
.notificationbox-stack {
|
||||
background-color: var(--toolbar-bgcolor);
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user