Bug 1477310 - Enable the new certificate error pages by default in Nightly. r=johannh
authorTrisha Gupta <tgupta@mozilla.com>
Wed, 01 Aug 2018 15:57:22 +0530
changeset 431162 385ebda7ee53
parent 431161 6b10b850fddb
child 431163 83d0673bbca4
child 431176 85247ce250af
push id34429
push usercbrindusan@mozilla.com
push dateSun, 12 Aug 2018 21:49:33 +0000
treeherdermozilla-central@83d0673bbca4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1477310
milestone63.0a1
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
Bug 1477310 - Enable the new certificate error pages by default in Nightly. r=johannh MozReview-Commit-ID: DN7s5t2m2Nm
browser/app/profile/firefox.js
browser/base/content/test/about/browser_aboutCertError.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -944,18 +944,22 @@ pref("app.feedback.baseURL", "https://in
 #endif
 
 // base URL for web-based marketing pages
 pref("app.productInfo.baseURL", "https://www.mozilla.org/firefox/features/");
 
 // Name of alternate about: page for certificate errors (when undefined, defaults to about:neterror)
 pref("security.alternate_certificate_error_page", "certerror");
 
-// Indicates if new certificate error page (enabled) or not
+// Enable the new certificate error page only for Nightly
+#if defined(NIGHTLY_BUILD)
+pref("browser.security.newcerterrorpage.enabled", true);
+#else
 pref("browser.security.newcerterrorpage.enabled", false);
+#endif
 
 // Whether to start the private browsing mode at application startup
 pref("browser.privatebrowsing.autostart", false);
 
 // Whether the bookmark panel should be shown when bookmarking a page.
 pref("browser.bookmarks.editDialog.showForNewBookmarks", true);
 
 // Don't try to alter this pref, it'll be reset the next time you use the
--- a/browser/base/content/test/about/browser_aboutCertError.js
+++ b/browser/base/content/test/about/browser_aboutCertError.js
@@ -148,16 +148,25 @@ add_task(async function checkBadStsCert(
     ok(exceptionButtonHidden, "Exception button is hidden");
 
     let message = await ContentTask.spawn(browser, {frame: useFrame}, async function({frame}) {
       let doc = frame ? content.document.querySelector("iframe").contentDocument : content.document;
       let advancedButton = doc.getElementById("advancedButton");
       advancedButton.click();
       return doc.getElementById("badCertTechnicalInfo").textContent;
     });
+    if (Services.prefs.getBoolPref("browser.security.newcerterrorpage.enabled", false)) {
+      ok(message.includes("SSL_ERROR_BAD_CERT_DOMAIN"), "Didn't find SSL_ERROR_BAD_CERT_DOMAIN.");
+      ok(message.includes("The certificate is only valid for"), "Didn't find error message.");
+      ok(message.includes("a security certificate that is not valid for"), "Didn't find error message.");
+      ok(message.includes("badchain.include-subdomains.pinning.example.com"), "Didn't find domain in error message.");
+
+      BrowserTestUtils.removeTab(gBrowser.selectedTab);
+      return;
+    }
     ok(message.includes("SSL_ERROR_BAD_CERT_DOMAIN"), "Didn't find SSL_ERROR_BAD_CERT_DOMAIN.");
     ok(message.includes("The certificate is only valid for"), "Didn't find error message.");
     ok(message.includes("uses an invalid security certificate"), "Didn't find error message.");
     ok(message.includes("badchain.include-subdomains.pinning.example.com"), "Didn't find domain in error message.");
 
     BrowserTestUtils.removeTab(gBrowser.selectedTab);
   }
 });