"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "browser/components/doh/test/browser/browser_remoteSettings_newProfile.js" between
firefox-90.0.1.source.tar.xz and firefox-90.0.2.source.tar.xz

About: Firefox is Mozilla’s standalone Web browser. Source code.

browser_remoteSettings_newProfile.js  (firefox-90.0.1.source.tar.xz):browser_remoteSettings_newProfile.js  (firefox-90.0.2.source.tar.xz)
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ * http://creativecommons.org/publicdomain/zero/1.0/
*/ */
"use strict"; "use strict";
add_task(setup); add_task(setup);
add_task(setupRegion); add_task(setupRegion);
async function setPrefAndWaitForConfigFlush(pref, value) {
let configFlushedPromise = DoHTestUtils.waitForConfigFlush();
Preferences.set(pref, value);
await configFlushedPromise;
}
async function clearPrefAndWaitForConfigFlush(pref, value) {
let configFlushedPromise = DoHTestUtils.waitForConfigFlush();
Preferences.reset(pref);
await configFlushedPromise;
}
add_task(async function testNewProfile() { add_task(async function testNewProfile() {
is( is(
DoHConfigController.currentConfig.enabled, DoHConfigController.currentConfig.enabled,
false, false,
"Rollout should not be enabled" "Rollout should not be enabled"
); );
let provider1 = { let provider1 = {
id: "provider1", id: "provider1",
uri: "https://example.org/1", uri: "https://example.org/1",
skipping to change at line 55 skipping to change at line 67
autoDefaultEnabled: true, autoDefaultEnabled: true,
autoDefaultProviders: "provider1, provider3", autoDefaultProviders: "provider1, provider3",
}); });
is( is(
DoHConfigController.currentConfig.enabled, DoHConfigController.currentConfig.enabled,
true, true,
"Rollout should be enabled" "Rollout should be enabled"
); );
await ensureTRRMode(2); await ensureTRRMode(2);
await checkHeuristicsTelemetry("enable_doh", "startup");
Assert.deepEqual( Assert.deepEqual(
DoHConfigController.currentConfig.providerList, DoHConfigController.currentConfig.providerList,
[provider1, provider3], [provider1, provider3],
"Provider list should be loaded" "Provider list should be loaded"
); );
is( is(
DoHConfigController.currentConfig.providerSteering.enabled, DoHConfigController.currentConfig.providerSteering.enabled,
true, true,
"Steering should be enabled" "Steering should be enabled"
); );
skipping to change at line 86 skipping to change at line 99
DoHConfigController.currentConfig.trrSelection.providerList, DoHConfigController.currentConfig.trrSelection.providerList,
[provider1, provider3], [provider1, provider3],
"TRR Selection provider list should be loaded" "TRR Selection provider list should be loaded"
); );
is( is(
DoHConfigController.currentConfig.fallbackProviderURI, DoHConfigController.currentConfig.fallbackProviderURI,
provider1.uri, provider1.uri,
"Fallback provider URI should be that of the first one" "Fallback provider URI should be that of the first one"
); );
// Test that overriding with prefs works.
await setPrefAndWaitForConfigFlush(prefs.PROVIDER_STEERING_PREF, false);
is(
DoHConfigController.currentConfig.providerSteering.enabled,
false,
"Provider steering should be disabled"
);
await ensureTRRMode(2);
await checkHeuristicsTelemetry("enable_doh", "startup");
await setPrefAndWaitForConfigFlush(prefs.TRR_SELECT_ENABLED_PREF, false);
is(
DoHConfigController.currentConfig.trrSelection.enabled,
false,
"TRR selection should be disabled"
);
await ensureTRRMode(2);
await checkHeuristicsTelemetry("enable_doh", "startup");
// Try a regional pref this time
await setPrefAndWaitForConfigFlush(
`${kRegionalPrefNamespace}.enabled`,
false
);
is(
DoHConfigController.currentConfig.enabled,
false,
"Rollout should be disabled"
);
await ensureTRRMode(undefined);
await ensureNoHeuristicsTelemetry();
await clearPrefAndWaitForConfigFlush(`${kRegionalPrefNamespace}.enabled`);
is(
DoHConfigController.currentConfig.enabled,
true,
"Rollout should be enabled"
);
await DoHTestUtils.resetRemoteSettingsConfig(); await DoHTestUtils.resetRemoteSettingsConfig();
is( is(
DoHConfigController.currentConfig.enabled, DoHConfigController.currentConfig.enabled,
false, false,
"Rollout should be disabled" "Rollout should be disabled"
); );
await ensureTRRMode(undefined); await ensureTRRMode(undefined);
}); });
 End of changes. 3 change blocks. 
0 lines changed or deleted 53 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)