mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1724718 - put missing chrome/resource check from jar channels in a better place so we catch all cases, r=valentin,florian,necko-reviewers
This also re-adds the TYPE_FETCH content policy for file existence checks from tests so they don't cause crashes. Differential Revision: https://phabricator.services.mozilla.com/D122167
This commit is contained in:
parent
46a72deb4e
commit
b408d18300
@ -50,6 +50,9 @@ var PerfTestHelpers = {
|
||||
let channel = lazy.NetUtil.newChannel({
|
||||
uri,
|
||||
loadUsingSystemPrincipal: true,
|
||||
// Avoid crashing for non-existant files. If the file not existing
|
||||
// is bad, we can deal with it in the test instead.
|
||||
contentPolicyType: Ci.nsIContentPolicy.TYPE_FETCH,
|
||||
});
|
||||
|
||||
channel.asyncOpen({
|
||||
|
@ -286,9 +286,6 @@ nsresult nsJARChannel::CreateJarInput(nsIZipReaderCache* jarCache,
|
||||
new nsJARInputThunk(reader, mJarURI, mJarEntry, jarCache != nullptr);
|
||||
rv = input->Init();
|
||||
if (NS_FAILED(rv)) {
|
||||
if (rv == NS_ERROR_FILE_NOT_FOUND) {
|
||||
CheckForBrokenChromeURL(mLoadInfo, mOriginalURI);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -488,6 +485,9 @@ nsresult nsJARChannel::OnOpenLocalFileComplete(nsresult aResult,
|
||||
MOZ_ASSERT(mIsPending);
|
||||
|
||||
if (NS_FAILED(aResult)) {
|
||||
if (aResult == NS_ERROR_FILE_NOT_FOUND) {
|
||||
CheckForBrokenChromeURL(mLoadInfo, mOriginalURI);
|
||||
}
|
||||
if (!aIsSyncCall) {
|
||||
NotifyError(aResult);
|
||||
}
|
||||
|
@ -3864,6 +3864,20 @@ void CheckForBrokenChromeURL(nsILoadInfo* aLoadInfo, nsIURI* aURI) {
|
||||
nsCString spec;
|
||||
aURI->GetSpec(spec);
|
||||
|
||||
#ifdef ANDROID
|
||||
// Various toolkit files use this and are shipped on android, but
|
||||
// info-pages.css and aboutLicense.css are not - bug 1808987
|
||||
if (StringEndsWith(spec, "info-pages.css"_ns) ||
|
||||
StringEndsWith(spec, "aboutLicense.css"_ns) ||
|
||||
// Error page CSS is also missing: bug 1810039
|
||||
StringEndsWith(spec, "aboutNetError.css"_ns) ||
|
||||
StringEndsWith(spec, "error-pages.css"_ns) ||
|
||||
// Used by an extension installation test - bug 1809650
|
||||
StringBeginsWith(spec, "resource://android/assets/web_extensions/"_ns)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// DTD files from gre may not exist when requested by tests.
|
||||
if (StringBeginsWith(spec, "resource://gre/res/dtd/"_ns)) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user