Bug 1563343 - Do not search for OS protocol handlers in GV; just let Gecko return ERROR_UNKNOWN_PROTOCOL. r=snorp,geckoview-reviewers,esawin

Differential Revision: https://phabricator.services.mozilla.com/D46311

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dylan Roeh 2019-10-08 19:05:09 +00:00
Родитель 2aafd36cc9
Коммит 1657764793
8 изменённых файлов: 29 добавлений и 12 удалений

Просмотреть файл

@ -4,6 +4,8 @@ head = head_docshell.js
[test_bug442584.js]
[test_browsing_context_structured_clone.js]
[test_nsDefaultURIFixup.js]
# Disabled for 1563343 -- URI fixup should be done at the app level in GV.
skip-if = os == 'android'
[test_nsDefaultURIFixup_search.js]
skip-if = os == 'android'
[test_nsDefaultURIFixup_info.js]

Просмотреть файл

@ -50,6 +50,7 @@ open class BaseSessionTest(noErrorCollector: Boolean = false) {
const val VIDEO_WEBM_PATH = "/assets/www/webm.html"
const val VIDEO_BAD_PATH = "/assets/www/badVideoPath.html"
const val UNKNOWN_HOST_URI = "http://www.test.invalid/"
const val UNKNOWN_PROTOCOL_URI = "htt://invalid"
const val FULLSCREEN_PATH = "/assets/www/fullscreen.html"
const val VIEWPORT_PATH = "/assets/www/viewport.html"
const val IFRAME_REDIRECT_LOCAL = "/assets/www/iframe_redirect_local.html"

Просмотреть файл

@ -194,6 +194,12 @@ class NavigationDelegateTest : BaseSessionTest() {
WebRequestError.ERROR_SECURITY_BAD_CERT)
}
@Test fun loadUnknownProtocol() {
testLoadEarlyError(UNKNOWN_PROTOCOL_URI,
WebRequestError.ERROR_CATEGORY_URI,
WebRequestError.ERROR_UNKNOWN_PROTOCOL)
}
@Setting(key = Setting.Key.USE_TRACKING_PROTECTION, value = "true")
@Ignore // TODO: Bug 1564373
@Test fun trackingProtection() {

Просмотреть файл

@ -1,6 +0,0 @@
[same-origin.html]
[unsupported_scheme]
expected:
if (os == "android") and not e10s: FAIL
if (os == "android") and e10s: FAIL

Просмотреть файл

@ -1,6 +0,0 @@
[same-origin.html]
[unsupported_scheme]
expected:
if (os == "android") and not e10s: FAIL
if (os == "android") and e10s: FAIL

Просмотреть файл

@ -15,6 +15,12 @@ nsExternalURLHandlerService::~nsExternalURLHandlerService() {}
NS_IMETHODIMP
nsExternalURLHandlerService::GetURLHandlerInfoFromOS(nsIURI* aURL, bool* found,
nsIHandlerInfo** info) {
if (!mozilla::jni::IsFennec()) {
// We don't want to get protocol handlers from the OS in GV; the app
// should take care of that in NavigationDelegate.onLoadRequest().
return NS_ERROR_NOT_IMPLEMENTED;
}
nsCString uriSpec;
aURL->GetSpec(uriSpec);
return nsMIMEInfoAndroid::GetMimeInfoForURL(uriSpec, found, info);

Просмотреть файл

@ -34,6 +34,12 @@ nsresult nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType,
nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char* aScheme,
bool* aExists) {
if (!mozilla::jni::IsFennec()) {
// We don't want to get protocol handlers from the OS in GV; the app
// should take care of that in NavigationDelegate.onLoadRequest().
return NS_ERROR_NOT_IMPLEMENTED;
}
*aExists = mozilla::AndroidBridge::Bridge()->GetHandlersForURL(
NS_ConvertUTF8toUTF16(aScheme));
return NS_OK;
@ -41,6 +47,12 @@ nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char* aScheme,
nsresult nsOSHelperAppService::GetProtocolHandlerInfoFromOS(
const nsACString& aScheme, bool* found, nsIHandlerInfo** info) {
if (!mozilla::jni::IsFennec()) {
// We don't want to get protocol handlers from the OS in GV; the app
// should take care of that in NavigationDelegate.onLoadRequest().
return NS_ERROR_NOT_IMPLEMENTED;
}
return nsMIMEInfoAndroid::GetMimeInfoForURL(aScheme, found, info);
}

Просмотреть файл

@ -13,6 +13,8 @@ support-files = mailcap
# Bug 676997: test consistently fails on Android
fail-if = os == "android"
[test_handlerService_store.js]
# Disabled for 1563343 -- the app should determine possible handlers in GV.
fail-if = os == "android"
support-files = handlers.json
[test_punycodeURIs.js]
# Bug 676997: test consistently fails on Android