Bug 1026254 Broken chrome: URLs should result in error pages r=bsmedberg

This commit is contained in:
Neil Rashbrook 2014-06-21 00:50:58 +01:00
parent 3160ea73e4
commit 1c401dad5e
3 changed files with 4 additions and 4 deletions

View File

@ -298,7 +298,7 @@ nsChromeRegistry::ConvertChromeURL(nsIURI* aChromeURI, nsIURI* *aResult)
if (!baseURI) { if (!baseURI) {
LogMessage("No chrome package registered for chrome://%s/%s/%s", LogMessage("No chrome package registered for chrome://%s/%s/%s",
package.get(), provider.get(), path.get()); package.get(), provider.get(), path.get());
return NS_ERROR_FAILURE; return NS_ERROR_FILE_NOT_FOUND;
} }
return NS_NewURI(aResult, path, nullptr, baseURI); return NS_NewURI(aResult, path, nullptr, baseURI);

View File

@ -272,7 +272,7 @@ nsChromeRegistryChrome::GetSelectedLocale(const nsACString& aPackage,
PL_DHASH_LOOKUP)); PL_DHASH_LOOKUP));
if (PL_DHASH_ENTRY_IS_FREE(entry)) if (PL_DHASH_ENTRY_IS_FREE(entry))
return NS_ERROR_FAILURE; return NS_ERROR_FILE_NOT_FOUND;
aLocale = entry->locales.GetSelected(mSelectedLocale, nsProviderArray::LOCALE); aLocale = entry->locales.GetSelected(mSelectedLocale, nsProviderArray::LOCALE);
if (aLocale.IsEmpty()) if (aLocale.IsEmpty())
@ -560,7 +560,7 @@ nsChromeRegistryChrome::GetFlagsFromPackage(const nsCString& aPackage,
& (nsACString&) aPackage, & (nsACString&) aPackage,
PL_DHASH_LOOKUP)); PL_DHASH_LOOKUP));
if (PL_DHASH_ENTRY_IS_FREE(entry)) if (PL_DHASH_ENTRY_IS_FREE(entry))
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_FILE_NOT_FOUND;
*aFlags = entry->flags; *aFlags = entry->flags;
return NS_OK; return NS_OK;

View File

@ -28,7 +28,7 @@ function run_test() {
test_BrokenFile("chrome://test/content/test.jsm", test_BrokenFile("chrome://test/content/test.jsm",
true, true,
"NS_ERROR_NOT_AVAILABLE"); "NS_ERROR_FILE_NOT_FOUND");
// check that we can access modules' global objects even if // check that we can access modules' global objects even if
// EXPORTED_SYMBOLS is missing or ill-formed: // EXPORTED_SYMBOLS is missing or ill-formed: