Backed out 4 changesets (bug 1582751, bug 1575785, bug 1592616) for bc failures at browser_protections_UI.js. CLOSED TREE

Backed out changeset 7065a97d62f2 (bug 1592616)
Backed out changeset 5f243fa3ab1e (bug 1575785)
Backed out changeset 7870976299f2 (bug 1582751)
Backed out changeset a9b6b44f82af (bug 1592616)
This commit is contained in:
Brindusan Cristian
2019-11-06 02:23:31 +02:00
parent ae0f59c088
commit 9c5f78c9db
8 changed files with 6 additions and 105 deletions

View File

@@ -1236,12 +1236,6 @@ var gProtectionsHandler = {
"protections-popup-siteNotWorking-tp-switch"
));
},
get _protectionsPopupSiteNotWorkingReportError() {
delete this._protectionsPopupSiteNotWorkingReportError;
return (this._protectionsPopupSiteNotWorkingReportError = document.getElementById(
"protections-popup-sendReportView-report-error"
));
},
get _protectionsPopupSendReportLearnMore() {
delete this._protectionsPopupSendReportLearnMore;
return (this._protectionsPopupSendReportLearnMore = document.getElementById(
@@ -1254,12 +1248,6 @@ var gProtectionsHandler = {
"protections-popup-sendReportView-collection-url"
));
},
get _protectionsPopupSendReportButton() {
delete this._protectionsPopupSendReportButton;
return (this._protectionsPopupSendReportButton = document.getElementById(
"protections-popup-sendReportView-submit"
));
},
get _trackingProtectionIconTooltipLabel() {
delete this._trackingProtectionIconTooltipLabel;
return (this._trackingProtectionIconTooltipLabel = document.getElementById(
@@ -2186,12 +2174,7 @@ var gProtectionsHandler = {
"?" + this.reportURI.query,
""
);
let commentsTextarea = document.getElementById(
"protections-popup-sendReportView-collection-comments"
);
commentsTextarea.value = "";
this._protectionsPopupSendReportURL.value = urlWithoutQuery;
this._protectionsPopupSiteNotWorkingReportError.hidden = true;
this._protectionsPopupMultiView.showSubView(
"protections-popup-sendReportView"
);
@@ -2209,7 +2192,6 @@ var gProtectionsHandler = {
// ContentBlockingAllowList here.
this._protectionsPopupTPSwitchBreakageLink.hidden =
ContentBlockingAllowList.includes(gBrowser.selectedBrowser) ||
!this._protectionsPopup.hasAttribute("blocking") ||
!this._protectionsPopupTPSwitch.hasAttribute("enabled");
},
@@ -2287,31 +2269,28 @@ var gProtectionsHandler = {
formData.set("labels", activatedBlockers.join(","));
}
this._protectionsPopupSendReportButton.disabled = true;
fetch(reportEndpoint, {
method: "POST",
credentials: "omit",
body: formData,
})
.then(response => {
this._protectionsPopupSendReportButton.disabled = false;
.then(function(response) {
if (!response.ok) {
Cu.reportError(
`Content Blocking report to ${reportEndpoint} failed with status ${
response.status
}`
);
this._protectionsPopupSiteNotWorkingReportError.hidden = false;
} else {
this._protectionsPopup.hidePopup();
ConfirmationHint.show(this.iconBox, "breakageReport");
// Clear the textarea value when the report is submitted
commentsTextarea.value = "";
}
})
.catch(Cu.reportError);
},
onSendReportClicked() {
this._protectionsPopup.hidePopup();
this.submitBreakageReport(this.reportURI);
},

View File

@@ -77,7 +77,6 @@
<html:link rel="localization" href="browser/branding/sync-brand.ftl"/>
<html:link rel="localization" href="browser/browser.ftl"/>
<html:link rel="localization" href="browser/menubar.ftl"/>
<html:link rel="localization" href="browser/protectionsPanel.ftl"/>
<html:link rel="localization" href="browser/appmenu.ftl"/>
<html:link rel="localization" href="browser/readerView.ftl"/>
</linkset>

View File

@@ -3,11 +3,6 @@
/* Basic UI tests for the protections panel */
"use strict";
const TRACKING_PAGE =
"http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
ChromeUtils.defineModuleGetter(
this,
"ContentBlockingAllowList",
@@ -24,7 +19,6 @@ add_task(async function setup() {
["browser.contentblocking.report.monitor.enabled", false],
["browser.contentblocking.report.lockwise.enabled", false],
["browser.contentblocking.report.proxy.enabled", false],
["privacy.trackingprotection.enabled", true],
],
});
let oldCanRecord = Services.telemetry.canRecordExtended;
@@ -40,7 +34,7 @@ add_task(async function setup() {
add_task(async function testToggleSwitch() {
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
TRACKING_PAGE
"https://example.com"
);
await openProtectionsPanel();
let events = Services.telemetry.snapshotEvents(
@@ -55,11 +49,6 @@ add_task(async function testToggleSwitch() {
is(buttonEvents.length, 1, "recorded telemetry for opening the popup");
// Check the visibility of the "Site not working?" link.
await TestUtils.waitForCondition(() => {
return BrowserTestUtils.is_visible(
gProtectionsHandler._protectionsPopupTPSwitchBreakageLink
);
});
ok(
BrowserTestUtils.is_visible(
gProtectionsHandler._protectionsPopupTPSwitchBreakageLink

View File

@@ -108,31 +108,6 @@ add_task(async function testReportBreakageCancel() {
Services.prefs.clearUserPref(TP_PREF);
});
add_task(async function testNoTracking() {
await BrowserTestUtils.withNewTab(BENIGN_PAGE, async function() {
await openProtectionsPopup();
let siteNotWorkingButton = document.getElementById(
"protections-popup-tp-switch-breakage-link"
);
ok(
BrowserTestUtils.is_hidden(siteNotWorkingButton),
"site not working button is not visible"
);
});
});
add_task(async function testReportBreakageError() {
Services.prefs.setBoolPref(TP_PREF, true);
// Make sure that we correctly strip the query.
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
await BrowserTestUtils.withNewTab(url, async function() {
await testReportBreakage(TRACKING_PAGE, "trackingprotection", true);
});
Services.prefs.clearUserPref(TP_PREF);
});
add_task(async function testTP() {
Services.prefs.setBoolPref(TP_PREF, true);
// Make sure that we correctly strip the query.
@@ -164,11 +139,9 @@ add_task(async function testFP() {
// Make sure that we correctly strip the query.
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
await BrowserTestUtils.withNewTab(url, async function(browser) {
let promise = waitForContentBlockingEvent();
await SpecialPowers.spawn(browser, [], function() {
content.postMessage("fingerprinting", "*");
});
await promise;
await testReportBreakage(TRACKING_PAGE, "fingerprinting");
});
@@ -183,11 +156,9 @@ add_task(async function testCM() {
// Make sure that we correctly strip the query.
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
await BrowserTestUtils.withNewTab(url, async function(browser) {
let promise = waitForContentBlockingEvent();
await SpecialPowers.spawn(browser, [], function() {
content.postMessage("cryptomining", "*");
});
await promise;
await testReportBreakage(TRACKING_PAGE, "cryptomining");
});
@@ -196,7 +167,7 @@ add_task(async function testCM() {
Services.prefs.clearUserPref(CB_PREF);
});
async function testReportBreakage(url, tags, error = false) {
async function testReportBreakage(url, tags) {
// Setup a mock server for receiving breakage reports.
let server = new HttpServer();
server.start(-1);
@@ -310,12 +281,6 @@ async function testReportBreakage(url, tags, error = false) {
"Should send the correct form data"
);
if (error) {
response.setStatusLine(request.httpVersion, 500, "Request failed");
} else {
response.setStatusLine(request.httpVersion, 201, "Entry created");
}
resolve();
});
@@ -323,23 +288,6 @@ async function testReportBreakage(url, tags, error = false) {
submitButton.click();
});
let errorMessage = document.getElementById(
"protections-popup-sendReportView-report-error"
);
if (error) {
await BrowserTestUtils.waitForCondition(() =>
BrowserTestUtils.is_visible(errorMessage)
);
is(
comments.value,
"This is a comment",
"Comment not cleared in case of an error"
);
gProtectionsHandler._protectionsPopup.hidePopup();
} else {
ok(BrowserTestUtils.is_hidden(errorMessage), "Error message not shown");
}
await popuphidden;
// Stop the server.

View File

@@ -310,9 +310,6 @@
<label control="protections-popup-sendReportView-collection-comments">&contentBlocking.breakageReportView2.collection.comments.label;</label>
<html:textarea id="protections-popup-sendReportView-collection-comments" aria-label="&contentBlocking.breakageReportView2.collection.comments.label;"/>
</vbox>
<label id="protections-popup-sendReportView-report-error"
data-l10n-id="protections-panel-sendreportview-error"
hidden="true" role="alert"></label>
</vbox>
<vbox id="protections-popup-sendReportView-footer"
class="panel-footer">

View File

@@ -1,5 +0,0 @@
# 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/.
protections-panel-sendreportview-error = There was an error sending the report. Please try again later.

View File

@@ -1020,7 +1020,6 @@ confirmationHint.addSearchEngine.label = Search engine added!
confirmationHint.pinTab.label = Pinned!
confirmationHint.pinTab.description = Right-click the tab to unpin it.
confirmationHint.passwordSaved.label = Password saved!
confirmationHint.breakageReport.label = Report sent. Thank you!
# LOCALIZATION NOTE (livebookmarkMigration.title):
# Used by the export of user's live bookmarks to an OPML file as a title for the file.

View File

@@ -479,11 +479,6 @@ description#identity-popup-content-verifier,
margin-inline-start: 0;
}
#protections-popup-sendReportView-report-error {
margin-bottom: 24px;
color: #d74345;
}
.protections-popup-category {
/* Overwrite toolbarbutton styles */
-moz-appearance: none;