Skip to content

Commit

Permalink
[resource-timing] Avoid race condition
Browse files Browse the repository at this point in the history
Depending on the scheduling of resource retrieval, performance entries
for the test harness files may be observable by this test. That behavior
is beyond the focus of this test, so such entries should be ignored if
present.
  • Loading branch information
jugglinmike authored and yoavweiss committed Dec 13, 2018
1 parent 16b2635 commit 483983d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resource-timing/single-entry-per-resource.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
function (entryList, obs) {
var entries = entryList.getEntriesByType("resource");
for (var i = 0; i < entries.length; ++i) {
// Ignore any entries for the test harness files if present.
if (/testharness(report)?\.js/.test(entries[i].name)) {
continue;
}

++observed;
if (entries[i].name.indexOf(img_url) != -1)
++img_entries;
Expand Down

0 comments on commit 483983d

Please sign in to comment.