Skip to content

Commit

Permalink
Fix the "caches image resources at the document/page level as expecte…
Browse files Browse the repository at this point in the history
…d (issue 11878)" unit test

This unit test fails occasionally (albeit much less than before thanks
to PR mozilla#17663), so we change the parsing time check's divisor to prevent
it from happening again. If the last page's rendering time is less than
or equal to 50% of the first page's rendering time that should be enough
proof that no worker thread re-parsing occurred while also providing a
wide enough range to avoid intermittents.

Note that the assertion is now equal to the one we already have in the
"caches image resources at the document/page level, with main-thread
copying of complex images (issue 11518)" unit test which seems to work
reliably so far.
  • Loading branch information
timvandermeij committed Jul 6, 2024
1 parent bb3e316 commit 2a44203
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/unit/api_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4155,7 +4155,7 @@ Caron Broadcasting, Inc., an Ohio corporation (“Lessee”).`)
checkedCopyLocalImage = true;
// Ensure that the image was copied in the main-thread, rather
// than being re-parsed in the worker-thread (which is slower).
expect(statsOverall).toBeLessThan(firstStatsOverall / 4);
expect(statsOverall).toBeLessThan(firstStatsOverall / 2);
}
}
}
Expand Down

0 comments on commit 2a44203

Please sign in to comment.