Loading browser/components/urlbar/private/QuickSuggestRemoteSettings.sys.mjs +0 −4 Original line number Diff line number Diff line Loading @@ -261,10 +261,6 @@ class _QuickSuggestRemoteSettings { return this.#rs; } _test_setConfig(config) { this.#setConfig(config); } // The `RemoteSettings` client. #rs = null; Loading browser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.sys.mjs +4 −5 Original line number Diff line number Diff line Loading @@ -357,10 +357,9 @@ class _QuickSuggestTestUtils { * * @param {object} config * The config to be applied. See * {@link QuickSuggestRemoteSettings._test_setConfig} */ setConfig(config) { lazy.QuickSuggestRemoteSettings._test_setConfig(config); async setConfig(config) { await this.#mockRemoteSettings.update({ config }); } /** Loading @@ -378,9 +377,9 @@ class _QuickSuggestTestUtils { */ async withConfig({ config, callback }) { let original = lazy.QuickSuggestRemoteSettings.config; this.setConfig(config); await this.setConfig(config); await callback(); this.setConfig(original); await this.setConfig(original); } /** Loading browser/components/urlbar/tests/quicksuggest/browser/browser_telemetry_nonsponsored.js +4 −2 Original line number Diff line number Diff line Loading @@ -209,7 +209,9 @@ add_task(async function nonsponsoredBestMatch() { await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.bestMatch.enabled", true]], }); QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.BEST_MATCH_CONFIG); await QuickSuggestTestUtils.setConfig( QuickSuggestTestUtils.BEST_MATCH_CONFIG ); await doTelemetryTest({ index, suggestion: REMOTE_SETTINGS_RESULT, Loading Loading @@ -361,6 +363,6 @@ add_task(async function nonsponsoredBestMatch() { }, }, }); QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.DEFAULT_CONFIG); await QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.DEFAULT_CONFIG); await SpecialPowers.popPrefEnv(); }); browser/components/urlbar/tests/quicksuggest/browser/browser_telemetry_sponsored.js +4 −2 Original line number Diff line number Diff line Loading @@ -208,7 +208,9 @@ add_task(async function sponsoredBestMatch() { await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.bestMatch.enabled", true]], }); QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.BEST_MATCH_CONFIG); await QuickSuggestTestUtils.setConfig( QuickSuggestTestUtils.BEST_MATCH_CONFIG ); await doTelemetryTest({ index, suggestion: REMOTE_SETTINGS_RESULT, Loading Loading @@ -360,6 +362,6 @@ add_task(async function sponsoredBestMatch() { }, }, }); QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.DEFAULT_CONFIG); await QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.DEFAULT_CONFIG); await SpecialPowers.popPrefEnv(); }); browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_impressionCaps.js +9 −9 Original line number Diff line number Diff line Loading @@ -2025,7 +2025,7 @@ add_task(async function configChange_sameIntervalLowerCap_1() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [{ interval_s: 3, max_count: 1 }], Loading Loading @@ -2108,7 +2108,7 @@ add_task(async function configChange_sameIntervalLowerCap_2() { }); } await checkTelemetryEvents([]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [{ interval_s: 3, max_count: 1 }], Loading Loading @@ -2208,7 +2208,7 @@ add_task(async function configChange_sameIntervalHigherCap() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [{ interval_s: 3, max_count: 5 }], Loading Loading @@ -2329,7 +2329,7 @@ add_task(async function configChange_1IntervalTo2NewIntervalsHigher() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [ Loading Loading @@ -2493,7 +2493,7 @@ add_task(async function configChange_2IntervalsTo1NewIntervalHigher() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [{ interval_s: 6, max_count: 5 }], Loading Loading @@ -2620,7 +2620,7 @@ add_task(async function configChange_1IntervalTo1NewIntervalLower() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [{ interval_s: 3, max_count: 3 }], Loading Loading @@ -2699,7 +2699,7 @@ add_task(async function configChange_1IntervalToLifetime() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { lifetime: 3, Loading Loading @@ -2760,7 +2760,7 @@ add_task(async function configChange_lifetimeCapHigher() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { lifetime: 5, Loading Loading @@ -2842,7 +2842,7 @@ add_task(async function configChange_lifetimeCapLower() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { lifetime: 1, Loading Loading
browser/components/urlbar/private/QuickSuggestRemoteSettings.sys.mjs +0 −4 Original line number Diff line number Diff line Loading @@ -261,10 +261,6 @@ class _QuickSuggestRemoteSettings { return this.#rs; } _test_setConfig(config) { this.#setConfig(config); } // The `RemoteSettings` client. #rs = null; Loading
browser/components/urlbar/tests/quicksuggest/QuickSuggestTestUtils.sys.mjs +4 −5 Original line number Diff line number Diff line Loading @@ -357,10 +357,9 @@ class _QuickSuggestTestUtils { * * @param {object} config * The config to be applied. See * {@link QuickSuggestRemoteSettings._test_setConfig} */ setConfig(config) { lazy.QuickSuggestRemoteSettings._test_setConfig(config); async setConfig(config) { await this.#mockRemoteSettings.update({ config }); } /** Loading @@ -378,9 +377,9 @@ class _QuickSuggestTestUtils { */ async withConfig({ config, callback }) { let original = lazy.QuickSuggestRemoteSettings.config; this.setConfig(config); await this.setConfig(config); await callback(); this.setConfig(original); await this.setConfig(original); } /** Loading
browser/components/urlbar/tests/quicksuggest/browser/browser_telemetry_nonsponsored.js +4 −2 Original line number Diff line number Diff line Loading @@ -209,7 +209,9 @@ add_task(async function nonsponsoredBestMatch() { await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.bestMatch.enabled", true]], }); QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.BEST_MATCH_CONFIG); await QuickSuggestTestUtils.setConfig( QuickSuggestTestUtils.BEST_MATCH_CONFIG ); await doTelemetryTest({ index, suggestion: REMOTE_SETTINGS_RESULT, Loading Loading @@ -361,6 +363,6 @@ add_task(async function nonsponsoredBestMatch() { }, }, }); QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.DEFAULT_CONFIG); await QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.DEFAULT_CONFIG); await SpecialPowers.popPrefEnv(); });
browser/components/urlbar/tests/quicksuggest/browser/browser_telemetry_sponsored.js +4 −2 Original line number Diff line number Diff line Loading @@ -208,7 +208,9 @@ add_task(async function sponsoredBestMatch() { await SpecialPowers.pushPrefEnv({ set: [["browser.urlbar.bestMatch.enabled", true]], }); QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.BEST_MATCH_CONFIG); await QuickSuggestTestUtils.setConfig( QuickSuggestTestUtils.BEST_MATCH_CONFIG ); await doTelemetryTest({ index, suggestion: REMOTE_SETTINGS_RESULT, Loading Loading @@ -360,6 +362,6 @@ add_task(async function sponsoredBestMatch() { }, }, }); QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.DEFAULT_CONFIG); await QuickSuggestTestUtils.setConfig(QuickSuggestTestUtils.DEFAULT_CONFIG); await SpecialPowers.popPrefEnv(); });
browser/components/urlbar/tests/quicksuggest/unit/test_quicksuggest_impressionCaps.js +9 −9 Original line number Diff line number Diff line Loading @@ -2025,7 +2025,7 @@ add_task(async function configChange_sameIntervalLowerCap_1() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [{ interval_s: 3, max_count: 1 }], Loading Loading @@ -2108,7 +2108,7 @@ add_task(async function configChange_sameIntervalLowerCap_2() { }); } await checkTelemetryEvents([]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [{ interval_s: 3, max_count: 1 }], Loading Loading @@ -2208,7 +2208,7 @@ add_task(async function configChange_sameIntervalHigherCap() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [{ interval_s: 3, max_count: 5 }], Loading Loading @@ -2329,7 +2329,7 @@ add_task(async function configChange_1IntervalTo2NewIntervalsHigher() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [ Loading Loading @@ -2493,7 +2493,7 @@ add_task(async function configChange_2IntervalsTo1NewIntervalHigher() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [{ interval_s: 6, max_count: 5 }], Loading Loading @@ -2620,7 +2620,7 @@ add_task(async function configChange_1IntervalTo1NewIntervalLower() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { custom: [{ interval_s: 3, max_count: 3 }], Loading Loading @@ -2699,7 +2699,7 @@ add_task(async function configChange_1IntervalToLifetime() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { lifetime: 3, Loading Loading @@ -2760,7 +2760,7 @@ add_task(async function configChange_lifetimeCapHigher() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { lifetime: 5, Loading Loading @@ -2842,7 +2842,7 @@ add_task(async function configChange_lifetimeCapLower() { }, }, ]); QuickSuggestTestUtils.setConfig({ await QuickSuggestTestUtils.setConfig({ impression_caps: { sponsored: { lifetime: 1, Loading