Bug 1685187 - [devtools] Fix browser_resources_document_events.js intermittent. r=ochameau.

The test was failing in some case because interactiveEvent and completeEvent had
the same timestamp (which is still valid).
The test is modified to check greater or equal instead of strict greater.
Note that this test still has intermittent around willNavigateEvent and
loadingEvent (see https://searchfox.org/mozilla-central/rev/a2c26b9b49a521f4be39559ca1ca9c345a237c70/devtools/server/actors/webconsole/listeners/document-events.js#11-34)

Differential Revision: https://phabricator.services.mozilla.com/D136839
This commit is contained in:
Nicolas Chevobbe 2022-01-25 08:18:17 +00:00
Родитель bc42c77238
Коммит 8aa8d1be36
1 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -602,38 +602,38 @@ function assertEvents({
is(
typeof willNavigateEvent.time,
"number",
"Type of time attribute for will-navigate event is correct"
`Type of time attribute for will-navigate event is correct (${willNavigateEvent.time})`
);
}
is(
typeof loadingEvent.time,
"number",
"Type of time attribute for loading event is correct"
`Type of time attribute for loading event is correct (${loadingEvent.time})`
);
is(
typeof interactiveEvent.time,
"number",
"Type of time attribute for interactive event is correct"
`Type of time attribute for interactive event is correct (${interactiveEvent.time})`
);
is(
typeof completeEvent.time,
"number",
"Type of time attribute for complete event is correct"
`Type of time attribute for complete event is correct (${completeEvent.time})`
);
if (willNavigateEvent && !ignoreWillNavigateTimestamp) {
ok(
willNavigateEvent.time < loadingEvent.time,
"Timestamp for dom-loading event is greater than will-navigate event"
willNavigateEvent.time <= loadingEvent.time,
`Timestamp for dom-loading event is greater than will-navigate event (${willNavigateEvent.time} <= ${loadingEvent.time})`
);
}
ok(
loadingEvent.time < interactiveEvent.time,
"Timestamp for interactive event is greater than loading event"
loadingEvent.time <= interactiveEvent.time,
`Timestamp for interactive event is greater than loading event (${loadingEvent.time} <= ${interactiveEvent.time})`
);
ok(
interactiveEvent.time < completeEvent.time,
"Timestamp for complete event is greater than interactive event"
interactiveEvent.time <= completeEvent.time,
`Timestamp for complete event is greater than interactive event (${interactiveEvent.time} <= ${completeEvent.time}).`
);
if (willNavigateEvent) {