Backed out 4 changesets (bug 1582751, bug 1575785, bug 1592616) for bc failures at browser_protections_UI.js. CLOSED TREE
authorBrindusan Cristian <cbrindusan@mozilla.com>
Wed, 06 Nov 2019 02:23:31 +0200
changeset 500746 8da66de59b68180d2676d6609c31ec0d5ded1893
parent 500745 71b00388948f9cb015bf36023a513497ed897be8
child 500747 063086c09dc6b15acc643d85fa7cc8c30d4a5e0e
push id99809
push usercbrindusan@mozilla.com
push dateWed, 06 Nov 2019 00:43:56 +0000
treeherderautoland@fb5acb145e6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1582751, 1575785, 1592616
milestone72.0a1
backs out7065a97d62f2e7d8981b181be85257f3c50db287
5f243fa3ab1e24e2c6b87536bc05b6930296af8c
7870976299f236c2bbeb5dbea2a9066dae3ac6bb
a9b6b44f82afcddf49bc27e4178e2f625bb35b65
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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)
browser/base/content/browser-siteProtections.js
browser/base/content/browser.xhtml
browser/base/content/test/siteProtections/browser_protections_UI.js
browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
browser/components/controlcenter/content/protectionsPanel.inc.xul
browser/locales/en-US/browser/protectionsPanel.ftl
browser/locales/en-US/chrome/browser/browser.properties
browser/themes/shared/controlcenter/panel.inc.css
--- a/browser/base/content/browser-siteProtections.js
+++ b/browser/base/content/browser-siteProtections.js
@@ -1231,40 +1231,28 @@ var gProtectionsHandler = {
     ));
   },
   get _protectionsPopupSiteNotWorkingTPSwitch() {
     delete this._protectionsPopupSiteNotWorkingTPSwitch;
     return (this._protectionsPopupSiteNotWorkingTPSwitch = document.getElementById(
       "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(
       "protections-popup-sendReportView-learn-more"
     ));
   },
   get _protectionsPopupSendReportURL() {
     delete this._protectionsPopupSendReportURL;
     return (this._protectionsPopupSendReportURL = document.getElementById(
       "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(
       "tracking-protection-icon-tooltip-label"
     ));
   },
 
   get noTrackersDetectedDescription() {
@@ -2181,22 +2169,17 @@ var gProtectionsHandler = {
   showSendReportView() {
     // Save this URI to make sure that the user really only submits the location
     // they see in the report breakage dialog.
     this.reportURI = gBrowser.currentURI;
     let urlWithoutQuery = this.reportURI.asciiSpec.replace(
       "?" + 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"
     );
   },
 
   toggleBreakageLink() {
     // The breakage link will only be shown if tracking protection is enabled
     // for the site and the TP toggle state is on. And we won't show the
@@ -2204,17 +2187,16 @@ var gProtectionsHandler = {
     // know the previous TP state. We check the ContentBlockingAllowList instead
     // of 'hasException' attribute of the protection popup for the previous
     // since the 'hasException' will also be toggled as well as toggling the TP
     // switch. We won't be able to know the previous TP state through the
     // 'hasException' attribute. So we fallback to check the
     // ContentBlockingAllowList here.
     this._protectionsPopupTPSwitchBreakageLink.hidden =
       ContentBlockingAllowList.includes(gBrowser.selectedBrowser) ||
-      !this._protectionsPopup.hasAttribute("blocking") ||
       !this._protectionsPopupTPSwitch.hasAttribute("enabled");
   },
 
   submitBreakageReport(uri) {
     let reportEndpoint = Services.prefs.getStringPref(
       this.PREF_REPORT_BREAKAGE_URL
     );
     if (!reportEndpoint) {
@@ -2282,41 +2264,38 @@ var gProtectionsHandler = {
         activatedBlockers.push(blocker.reportBreakageLabel);
       }
     }
 
     if (activatedBlockers.length) {
       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);
   },
 
   async maybeUpdateEarliestRecordedDateTooltip() {
     if (this._hasEarliestRecord) {
       return;
     }
 
--- a/browser/base/content/browser.xhtml
+++ b/browser/base/content/browser.xhtml
@@ -72,17 +72,16 @@
         persist="screenX screenY width height sizemode"
         data-l10n-sync="true">
 
 <linkset>
   <html:link rel="localization" href="branding/brand.ftl"/>
   <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>
 
 # All JS files which are needed by browser.xhtml and other top level windows to
 # support MacOS specific features *must* go into the global-scripts.inc file so
 # that they can be shared with macWindow.inc.xul.
 #include global-scripts.inc
--- a/browser/base/content/test/siteProtections/browser_protections_UI.js
+++ b/browser/base/content/test/siteProtections/browser_protections_UI.js
@@ -1,70 +1,59 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /* 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",
   "resource://gre/modules/ContentBlockingAllowList.jsm"
 );
 
 add_task(async function setup() {
   await SpecialPowers.pushPrefEnv({
     set: [
       // Set the auto hide timing to 100ms for blocking the test less.
       ["browser.protections_panel.toast.timeout", 100],
       // Hide protections cards so as not to trigger more async messaging
       // when landing on the page.
       ["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;
   Services.telemetry.canRecordExtended = true;
   Services.telemetry.clearEvents();
 
   registerCleanupFunction(() => {
     Services.telemetry.canRecordExtended = oldCanRecord;
     Services.telemetry.clearEvents();
   });
 });
 
 add_task(async function testToggleSwitch() {
   let tab = await BrowserTestUtils.openNewForegroundTab(
     gBrowser,
-    TRACKING_PAGE
+    "https://example.com"
   );
   await openProtectionsPanel();
   let events = Services.telemetry.snapshotEvents(
     Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS
   ).parent;
   let buttonEvents = events.filter(
     e =>
       e[1] == "security.ui.protectionspopup" &&
       e[2] == "open" &&
       e[3] == "protections_popup"
   );
   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
     ),
     "The 'Site not working?' link should be visible."
   );
 
   ok(
--- a/browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
+++ b/browser/base/content/test/trackingUI/browser_trackingUI_report_breakage.js
@@ -103,41 +103,16 @@ add_task(async function testReportBreaka
     await viewShown;
 
     ok(true, "Main view was shown");
   });
 
   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.
   let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
   await BrowserTestUtils.withNewTab(url, async function() {
     await testReportBreakage(TRACKING_PAGE, "trackingprotection");
   });
 
@@ -159,49 +134,45 @@ add_task(async function testCR() {
 });
 
 add_task(async function testFP() {
   Services.prefs.setIntPref(CB_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT);
   Services.prefs.setBoolPref(FP_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(browser) {
-    let promise = waitForContentBlockingEvent();
     await SpecialPowers.spawn(browser, [], function() {
       content.postMessage("fingerprinting", "*");
     });
-    await promise;
 
     await testReportBreakage(TRACKING_PAGE, "fingerprinting");
   });
 
   Services.prefs.clearUserPref(FP_PREF);
   Services.prefs.clearUserPref(CB_PREF);
 });
 
 add_task(async function testCM() {
   Services.prefs.setIntPref(CB_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT);
   Services.prefs.setBoolPref(CM_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(browser) {
-    let promise = waitForContentBlockingEvent();
     await SpecialPowers.spawn(browser, [], function() {
       content.postMessage("cryptomining", "*");
     });
-    await promise;
 
     await testReportBreakage(TRACKING_PAGE, "cryptomining");
   });
 
   Services.prefs.clearUserPref(CM_PREF);
   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);
   let i = server.identity;
   let path =
     i.primaryScheme + "://" + i.primaryHost + ":" + i.primaryPort + "/";
 
   Services.prefs.setStringPref(PREF_REPORT_BREAKAGE_URL, path);
@@ -305,45 +276,22 @@ async function testReportBreakage(url, t
             "This is a comment\r\n",
           'Content-Disposition: form-data; name="labels"\r\n\r\n' +
             `${tags}\r\n`,
           "",
         ],
         "Should send the correct form data"
       );
 
-      if (error) {
-        response.setStatusLine(request.httpVersion, 500, "Request failed");
-      } else {
-        response.setStatusLine(request.httpVersion, 201, "Entry created");
-      }
-
       resolve();
     });
 
     comments.value = "This is a comment";
     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.
   await new Promise(r => server.stop(r));
 
   Services.prefs.clearUserPref(PREF_REPORT_BREAKAGE_URL);
 }
--- a/browser/components/controlcenter/content/protectionsPanel.inc.xul
+++ b/browser/components/controlcenter/content/protectionsPanel.inc.xul
@@ -305,19 +305,16 @@
           <vbox class="protections-popup-sendReportView-collection-section">
             <label control="protections-popup-sendReportView-collection-url">&contentBlocking.breakageReportView.collection.url.label;</label>
             <html:input readonly="readonly" id="protections-popup-sendReportView-collection-url" aria-label="&contentBlocking.breakageReportView.collection.url.label;"/>
           </vbox>
           <vbox class="protections-popup-sendReportView-collection-section">
             <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">
           <button id="protections-popup-sendReportView-cancel"
                   label="&contentBlocking.breakageReportView.cancel.label;"
                   oncommand="gProtectionsHandler._protectionsPopupMultiView.goBack();"/>
           <button id="protections-popup-sendReportView-submit"
                   default="true"
deleted file mode 100644
--- a/browser/locales/en-US/browser/protectionsPanel.ftl
+++ /dev/null
@@ -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.
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -1015,14 +1015,13 @@ storageAccess.description.learnmore = th
 
 confirmationHint.sendToDevice.label = Sent!
 confirmationHint.copyURL.label = Copied to clipboard!
 confirmationHint.pageBookmarked.label = Saved to Library!
 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.
 # %S will be replaced with brandShortName
 livebookmarkMigration.title                      = %S Live Bookmarks
--- a/browser/themes/shared/controlcenter/panel.inc.css
+++ b/browser/themes/shared/controlcenter/panel.inc.css
@@ -474,21 +474,16 @@ description#identity-popup-content-verif
 #protections-popup-sendReportView-collection-comments {
   height: 120px;
 }
 
 #protections-popup-sendReportView label {
   margin-inline-start: 0;
 }
 
-#protections-popup-sendReportView-report-error {
-  margin-bottom: 24px;
-  color: #d74345;
-}
-
 .protections-popup-category {
   /* Overwrite toolbarbutton styles */
   -moz-appearance: none;
   margin: 0;
   padding-inline-start: 0;
 }
 
 .protections-popup-category:-moz-focusring,