forked from mirrors/gecko-dev
Bug 1830380 - Fix intermittent test failure, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D177017
This commit is contained in:
parent
d245bc86c2
commit
5f7a75c735
1 changed files with 32 additions and 21 deletions
|
|
@ -91,20 +91,8 @@ add_task(async function TRROnlyExceptionButtonTelemetry() {
|
|||
doc.documentURI.startsWith("about:neterror"),
|
||||
"Should be showing error page"
|
||||
);
|
||||
|
||||
let buttons = ["neterrorTryAgainButton", "trrSettingsButton"];
|
||||
for (let buttonId of buttons) {
|
||||
let button = doc.getElementById(buttonId);
|
||||
button.click();
|
||||
}
|
||||
});
|
||||
|
||||
is(
|
||||
gBrowser.tabs.length,
|
||||
3,
|
||||
"Should open about:preferences#privacy-doh in another tab"
|
||||
);
|
||||
|
||||
let loadEvent = await TestUtils.waitForCondition(() => {
|
||||
let events = Services.telemetry.snapshotEvents(
|
||||
Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS,
|
||||
|
|
@ -126,15 +114,38 @@ add_task(async function TRROnlyExceptionButtonTelemetry() {
|
|||
},
|
||||
]);
|
||||
|
||||
let clickEvents = await TestUtils.waitForCondition(() => {
|
||||
let events = Services.telemetry.snapshotEvents(
|
||||
Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS,
|
||||
true
|
||||
).content;
|
||||
return events?.filter(
|
||||
e => e[1] == "security.doh.neterror" && e[2] == "click"
|
||||
);
|
||||
}, "recorded telemetry for clicking buttons");
|
||||
await SpecialPowers.spawn(browser, [], function() {
|
||||
const doc = content.document;
|
||||
let buttons = ["neterrorTryAgainButton", "trrSettingsButton"];
|
||||
for (let buttonId of buttons) {
|
||||
let button = doc.getElementById(buttonId);
|
||||
button.click();
|
||||
}
|
||||
});
|
||||
|
||||
// Since we click TryAgain, make sure the error page is loaded again.
|
||||
await BrowserTestUtils.waitForErrorPage(browser);
|
||||
|
||||
is(
|
||||
gBrowser.tabs.length,
|
||||
3,
|
||||
"Should open about:preferences#privacy-doh in another tab"
|
||||
);
|
||||
|
||||
let clickEvents = await TestUtils.waitForCondition(
|
||||
() => {
|
||||
let events = Services.telemetry.snapshotEvents(
|
||||
Ci.nsITelemetry.DATASET_PRERELEASE_CHANNELS,
|
||||
true
|
||||
).content;
|
||||
return events?.filter(
|
||||
e => e[1] == "security.doh.neterror" && e[2] == "click"
|
||||
);
|
||||
},
|
||||
"recorded telemetry for clicking buttons",
|
||||
500,
|
||||
100
|
||||
);
|
||||
|
||||
let firstEvent = clickEvents[0];
|
||||
firstEvent.shift(); // remove timestamp
|
||||
|
|
|
|||
Loading…
Reference in a new issue