Backed out 3 changesets (bug 1582751, bug 1575785, bug 1592616) for causing perma failures in browser/base/content/test/siteProtections/browser_protections_UI.js CLOSED TREE

Backed out changeset d08754485c25 (bug 1575785)
Backed out changeset be51af34cb7a (bug 1582751)
Backed out changeset c753c25b8f77 (bug 1592616)
This commit is contained in:
shindli 2019-11-03 08:43:22 +02:00
Родитель 6777843239
Коммит bc9e237999
8 изменённых файлов: 6 добавлений и 100 удалений

Просмотреть файл

@ -1235,12 +1235,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(
@ -1253,12 +1247,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(
@ -2179,12 +2167,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"
);
@ -2202,7 +2185,6 @@ var gProtectionsHandler = {
// ContentBlockingAllowList here.
this._protectionsPopupTPSwitchBreakageLink.hidden =
ContentBlockingAllowList.includes(gBrowser.selectedBrowser) ||
!this._protectionsPopup.hasAttribute("blocking") ||
!this._protectionsPopupTPSwitch.hasAttribute("enabled");
},
@ -2280,31 +2262,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);
},

Просмотреть файл

@ -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>

Просмотреть файл

@ -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(

Просмотреть файл

@ -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.

Просмотреть файл

@ -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">

Просмотреть файл

@ -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.

Просмотреть файл

@ -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.

Просмотреть файл

@ -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;