"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "browser/components/doh/test/browser/head.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.

head.js  (firefox-90.0.1.source.tar.xz):head.js  (firefox-90.0.2.source.tar.xz)
skipping to change at line 89 skipping to change at line 89
// Enable the CFR. // Enable the CFR.
Preferences.set(CFR_PREF, JSON.stringify(CFR_JSON)); Preferences.set(CFR_PREF, JSON.stringify(CFR_JSON));
// Tell DoHController that this isn't real life. // Tell DoHController that this isn't real life.
Preferences.set(prefs.TESTING_PREF, true); Preferences.set(prefs.TESTING_PREF, true);
// Avoid non-local connections to the TRR endpoint. // Avoid non-local connections to the TRR endpoint.
Preferences.set(prefs.CONFIRMATION_NS_PREF, "skip"); Preferences.set(prefs.CONFIRMATION_NS_PREF, "skip");
// Enable trr selection for tests. This is off by default so it can be // Enable trr selection and provider steeringfor tests. This is off
// controlled via Normandy. // by default so it can be controlled via Normandy.
Preferences.set(prefs.TRR_SELECT_ENABLED_PREF, true); Preferences.set(prefs.TRR_SELECT_ENABLED_PREF, true);
Preferences.set(prefs.PROVIDER_STEERING_PREF, true);
// Enable committing the TRR selection. This pref ships false by default so // Enable committing the TRR selection. This pref ships false by default so
// it can be controlled e.g. via Normandy, but for testing let's set enable. // it can be controlled e.g. via Normandy, but for testing let's set enable.
Preferences.set(prefs.TRR_SELECT_COMMIT_PREF, true); Preferences.set(prefs.TRR_SELECT_COMMIT_PREF, true);
// Clear mode on shutdown by default. // Clear mode on shutdown by default.
Preferences.set(prefs.CLEAR_ON_SHUTDOWN_PREF, true); Preferences.set(prefs.CLEAR_ON_SHUTDOWN_PREF, true);
// Generally don't bother with debouncing or throttling. // Generally don't bother with debouncing or throttling.
// The throttling test will set this explicitly. // The throttling test will set this explicitly.
skipping to change at line 213 skipping to change at line 214
async function checkHeuristicsTelemetry( async function checkHeuristicsTelemetry(
decision, decision,
evaluateReason, evaluateReason,
steeredProvider = "" steeredProvider = ""
) { ) {
let events; let events;
await TestUtils.waitForCondition(() => { await TestUtils.waitForCondition(() => {
events = Services.telemetry.snapshotEvents( events = Services.telemetry.snapshotEvents(
Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS
).parent; ).parent;
return events && events.length; events = events?.filter(
e => e[1] == "doh" && e[2] == "evaluate_v2" && e[3] == "heuristics"
);
return events?.length;
}); });
events = events.filter(
e => e[1] == "doh" && e[2] == "evaluate_v2" && e[3] == "heuristics"
);
is(events.length, 1, "Found the expected heuristics event."); is(events.length, 1, "Found the expected heuristics event.");
is(events[0][4], decision, "The event records the expected decision"); is(events[0][4], decision, "The event records the expected decision");
if (evaluateReason) { if (evaluateReason) {
is(events[0][5].evaluateReason, evaluateReason, "Got the expected reason."); is(events[0][5].evaluateReason, evaluateReason, "Got the expected reason.");
} }
is(events[0][5].steeredProvider, steeredProvider, "Got expected provider."); is(events[0][5].steeredProvider, steeredProvider, "Got expected provider.");
// After checking the event, clear all telemetry. Since we check for a single // After checking the event, clear all telemetry. Since we check for a single
// event above, this ensures all heuristics events are intentional and tested. // event above, this ensures all heuristics events are intentional and tested.
// TODO: Test events other than heuristics. Those tests would also work the // TODO: Test events other than heuristics. Those tests would also work the
 End of changes. 4 change blocks. 
6 lines changed or deleted 7 lines changed or added

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