Backed out 5 changesets (bug 1582751, bug 1575785, bug 1592616) for browser-chrome failures at browser/base/content/test/siteProtections/browser_protections_UI.js on a CLOSED TREE

Backed out changeset 7bc4ba491fc6 (bug 1592616)
Backed out changeset 7f420cfdf282 (bug 1592616)
Backed out changeset 9c00153e7458 (bug 1575785)
Backed out changeset e8ba7d342c46 (bug 1582751)
Backed out changeset 6ded6886d2ed (bug 1592616)
This commit is contained in:
Coroiu Cristina 2019-11-06 22:58:29 +02:00
Родитель 086fc4d815
Коммит 10c5246702
9 изменённых файлов: 8 добавлений и 114 удалений

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

@ -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);
},

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

@ -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,13 +34,8 @@ add_task(async function setup() {
add_task(async function testToggleSwitch() {
let tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
TRACKING_PAGE
"https://example.com"
);
await TestUtils.waitForCondition(() => {
return gProtectionsHandler._protectionsPopup.hasAttribute("blocking");
});
await openProtectionsPanel();
let events = Services.telemetry.snapshotEvents(
Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS

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

@ -9,7 +9,6 @@ add_task(async function setup() {
["browser.contentblocking.report.monitor.enabled", false],
["browser.contentblocking.report.lockwise.enabled", false],
["browser.contentblocking.report.proxy.enabled", false],
["browser.contentblocking.cfr-milestone.update-interval", 0],
],
});
});

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

@ -64,9 +64,6 @@ add_task(async function testReportBreakageCancel() {
Services.prefs.setBoolPref(TP_PREF, true);
await BrowserTestUtils.withNewTab(TRACKING_PAGE, async function() {
await TestUtils.waitForCondition(() =>
gProtectionsHandler._protectionsPopup.hasAttribute("blocking")
);
await openProtectionsPopup();
let siteNotWorkingButton = document.getElementById(
@ -111,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.
@ -167,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");
});
@ -186,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");
});
@ -199,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);
@ -209,16 +177,13 @@ async function testReportBreakage(url, tags, error = false) {
Services.prefs.setStringPref(PREF_REPORT_BREAKAGE_URL, path);
await TestUtils.waitForCondition(() =>
gProtectionsHandler._protectionsPopup.hasAttribute("blocking")
);
await openProtectionsPopup();
let siteNotWorkingButton = document.getElementById(
"protections-popup-tp-switch-breakage-link"
);
ok(
BrowserTestUtils.is_visible(siteNotWorkingButton),
await TestUtils.waitForCondition(
() => BrowserTestUtils.is_visible(siteNotWorkingButton),
"site not working button is visible"
);
let siteNotWorkingView = document.getElementById(
@ -316,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();
});
@ -329,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;