diff options
Diffstat (limited to 'toolkit/components/glean/tests/xpcshell/test_JOG.js')
-rw-r--r-- | toolkit/components/glean/tests/xpcshell/test_JOG.js | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/toolkit/components/glean/tests/xpcshell/test_JOG.js b/toolkit/components/glean/tests/xpcshell/test_JOG.js index 53b1d25962..00f3ded135 100644 --- a/toolkit/components/glean/tests/xpcshell/test_JOG.js +++ b/toolkit/components/glean/tests/xpcshell/test_JOG.js @@ -289,11 +289,11 @@ add_task(async function test_jog_custom_pings() { `"ping"`, false ); - Services.fog.testRegisterRuntimePing("jog-ping", true, true, true, []); + Services.fog.testRegisterRuntimePing("jog-ping", true, true, true, true, []); Assert.ok("jogPing" in GleanPings); let submitted = false; Glean.jogCat.jogPingBool.set(false); - GleanPings.jogPing.testBeforeNextSubmit(reason => { + GleanPings.jogPing.testBeforeNextSubmit(() => { submitted = true; Assert.equal(false, Glean.jogCat.jogPingBool.testGetValue()); }); @@ -338,10 +338,7 @@ add_task(async function test_jog_timing_distribution_works() { // But we can guarantee it's only two samples. Assert.equal( 2, - Object.entries(data.values).reduce( - (acc, [bucket, count]) => acc + count, - 0 - ), + Object.entries(data.values).reduce((acc, [, count]) => acc + count, 0), "Only two buckets with samples" ); }); @@ -642,7 +639,9 @@ add_task(function test_jog_dotted_categories_work() { add_task(async function test_jog_ping_works() { const kReason = "reason-1"; - Services.fog.testRegisterRuntimePing("my-ping", true, true, true, [kReason]); + Services.fog.testRegisterRuntimePing("my-ping", true, true, true, true, [ + kReason, + ]); let submitted = false; GleanPings.myPing.testBeforeNextSubmit(reason => { submitted = true; @@ -652,6 +651,20 @@ add_task(async function test_jog_ping_works() { Assert.ok(submitted, "Ping must have been submitted"); }); +add_task(async function test_jog_noinfo_ping_works() { + const kReason = "reason-1"; + Services.fog.testRegisterRuntimePing("noinfo-ping", true, true, true, false, [ + kReason, + ]); + let submitted = false; + GleanPings.noinfoPing.testBeforeNextSubmit(reason => { + submitted = true; + Assert.equal(kReason, reason); + }); + GleanPings.noinfoPing.submit("reason-1"); + Assert.ok(submitted, "Ping must have been submitted"); +}); + add_task(function test_jog_name_collision() { Assert.ok("aCounter" in Glean.testOnlyJog); Assert.equal(undefined, Glean.testOnlyJog.aCounter.testGetValue()); |