summaryrefslogtreecommitdiffstats
path: root/browser/base/content/test/about/browser_aboutNetError.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /browser/base/content/test/about/browser_aboutNetError.js
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/base/content/test/about/browser_aboutNetError.js')
-rw-r--r--browser/base/content/test/about/browser_aboutNetError.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/browser/base/content/test/about/browser_aboutNetError.js b/browser/base/content/test/about/browser_aboutNetError.js
index 8222a0f6e8..9131f5e696 100644
--- a/browser/base/content/test/about/browser_aboutNetError.js
+++ b/browser/base/content/test/about/browser_aboutNetError.js
@@ -25,6 +25,38 @@ function resetPrefs() {
Services.prefs.clearUserPref("browser.fixup.alternate.enabled");
}
+async function resetTelemetry() {
+ Services.telemetry.clearEvents();
+ await TestUtils.waitForCondition(() => {
+ let events = Services.telemetry.snapshotEvents(
+ Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS,
+ true
+ ).content;
+ return !events || !events.length;
+ });
+ Services.telemetry.setEventRecordingEnabled("security.ui.tlserror", true);
+}
+
+async function checkTelemetry(errorString) {
+ let loadEvent = await TestUtils.waitForCondition(() => {
+ let events = Services.telemetry.snapshotEvents(
+ Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS,
+ true
+ ).content;
+ return events?.find(e => e[1] == "security.ui.tlserror" && e[2] == "load");
+ }, "recorded telemetry for the load");
+ loadEvent.shift();
+ Assert.deepEqual(loadEvent, [
+ "security.ui.tlserror",
+ "load",
+ "abouttlserror",
+ errorString,
+ {
+ is_frame: "false",
+ },
+ ]);
+}
+
add_task(async function resetToDefaultConfig() {
info(
"Change TLS config to cause page load to fail, check that reset button is shown and that it works"
@@ -34,6 +66,8 @@ add_task(async function resetToDefaultConfig() {
Services.prefs.setIntPref("security.tls.version.min", 1); // TLS 1.0
Services.prefs.setIntPref("security.tls.version.max", 1);
+ await resetTelemetry();
+
let browser;
let pageLoaded;
await BrowserTestUtils.openNewForegroundTab(
@@ -49,6 +83,8 @@ add_task(async function resetToDefaultConfig() {
info("Loading and waiting for the net error");
await pageLoaded;
+ await checkTelemetry("SSL_ERROR_PROTOCOL_VERSION_ALERT");
+
// Setup an observer for the target page.
const finalLoadComplete = BrowserTestUtils.browserLoaded(
browser,
@@ -92,6 +128,8 @@ add_task(async function checkLearnMoreLink() {
Services.prefs.setIntPref("security.tls.version.min", 3);
Services.prefs.setIntPref("security.tls.version.max", 4);
+ await resetTelemetry();
+
let browser;
let pageLoaded;
await BrowserTestUtils.openNewForegroundTab(
@@ -107,6 +145,8 @@ add_task(async function checkLearnMoreLink() {
info("Loading and waiting for the net error");
await pageLoaded;
+ await checkTelemetry("SSL_ERROR_PROTOCOL_VERSION_ALERT");
+
const baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
await SpecialPowers.spawn(browser, [baseURL], function (_baseURL) {
@@ -206,6 +246,8 @@ add_task(async function checkDomainCorrection() {
// Test that ciphersuites that use 3DES (namely, TLS_RSA_WITH_3DES_EDE_CBC_SHA)
// can only be enabled when deprecated TLS is enabled.
add_task(async function onlyAllow3DESWithDeprecatedTLS() {
+ await resetTelemetry();
+
// By default, connecting to a server that only uses 3DES should fail.
await BrowserTestUtils.withNewTab(
{ gBrowser, url: "about:blank" },
@@ -215,6 +257,8 @@ add_task(async function onlyAllow3DESWithDeprecatedTLS() {
}
);
+ await checkTelemetry("SSL_ERROR_NO_CYPHER_OVERLAP");
+
// Enabling deprecated TLS should also enable 3DES.
Services.prefs.setBoolPref("security.tls.version.enable-deprecated", true);
await BrowserTestUtils.withNewTab(