Fix slow downloadFile
test by stubbing URL.createObjectURL
#6707
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This test was often reported as slow (>1000ms) when running the whole test suite. Measuring timing showed that most of the delay was in the first
URL.createObjectURL
call. The issue did not reproduce when running only thedownloadFile
tests. If changing the order in which different file types are tested, the slowness still only occurred on the first call, so isn't related to a particular file type. https://issues.chromium.org/issues/40269900 notes that this call involves a synchronous IPC call between renderer and browser process, so the issue may just be that the browser process is busier when the full suite runs.As
createObjectURL
has a simple signature, I think we can get away with just stubbing it.