blob: f009f2c9410153a4fe01a52bfd6ceaceb68071e0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
"use strict";
const { TelemetryController } = ChromeUtils.importESModule(
"resource://gre/modules/TelemetryController.sys.mjs"
);
const { TelemetrySession } = ChromeUtils.importESModule(
"resource://gre/modules/TelemetrySession.sys.mjs"
);
add_task(async function test() {
let now = Services.telemetry.msSinceProcessStart();
let payload = TelemetrySession.getPayload("main");
// Check the first_paint scalar.
ok(
"scalars" in payload.processes.parent,
"Scalars are present in the payload."
);
ok(
"timestamps.first_paint" in payload.processes.parent.scalars,
"The first_paint timestamp is present in the payload."
);
Assert.greater(
payload.processes.parent.scalars["timestamps.first_paint"],
0,
"first_paint scalar is greater than 0."
);
Assert.greater(now, 0, "Browser test runtime is greater than zero.");
// Check that the first_paint scalar is less than the current time.
Assert.greater(
now,
payload.processes.parent.scalars["timestamps.first_paint"],
"first_paint is less than total browser test runtime."
);
});
|