Bug 1667282 - [devtools] Fix browser_resources_network_events.js intermittent. r=bomsy

We should only assert `updates` attribute on resource-updated,
as we aren't guaranteed how many updates we will have in resource-available.
That's because of resource throttling. Updates may be coalesced into available,
but we can't predict how many.

Differential Revision: https://phabricator.services.mozilla.com/D93337
This commit is contained in:
Alexandre Poirot 2020-10-14 13:03:31 +00:00
Родитель e4d44d95b2
Коммит b5d324284b
1 изменённых файлов: 5 добавлений и 5 удалений

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

@ -280,6 +280,11 @@ async function testNetworkEventResources(options) {
const expected = options.expectedResourcesOnUpdated[key];
const actual = actualResourcesOnUpdated[key];
assertResources(actual, expected);
is(
actual.updates.length,
expected.updates.length,
"The number of updates is correct"
);
}
await resourceWatcher.unwatchResources(
@ -311,11 +316,6 @@ function assertResources(actual, expected) {
);
is(actual.request.url, expected.request.url, "The url is correct");
is(actual.request.method, expected.request.method, "The method is correct");
is(
actual.updates.length,
expected.updates.length,
"The number of updates is correct"
);
}
const EXISTING_REQUESTS_COMMANDS = [