Drop obsolete logic from the downloadFile
function in test/downloadutils.js
#13420
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 patch is a first step to refactor the testing code to make it more manageable. This is needed in order to, over time, enable the
no-var
rule there too, which is now made difficult by lots of global variable and callback usage.This code is old and predates the improvements we made to the test manifest to only contain working URLs (either Web Archive or GitHub/Bugzilla links), so the fallback logic to try the Web Archive is no longer necessary. This greatly simplifies the function and also makes sure that we fail directly in case a bad URL is added to the manifest, instead of having it work "accidentally" because of this logic, since we want the manifest to be correct at all times (and otherwise fail loudly).
To verify that this works I removed my local
test/pdfs
folder, did a clean checkout of it and ran the tests, which forced a re-download of all files. All files downloaded correctly, there were no MD5 checksum mismatches and the files could also be opened correctly.