Bug 1673763 - Do not switch processes when loading error pages on Android r=geckoview-reviewers,nika,jonalmeida

Differential Revision: https://phabricator.services.mozilla.com/D186065
This commit is contained in:
owlishDeveloper 2023-08-15 18:43:38 +00:00
Родитель 54a89b94cd
Коммит 5637e974b1
3 изменённых файлов: 22 добавлений и 14 удалений

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

@ -77,13 +77,10 @@ skip-if = true
skip-if = toolkit != "cocoa" || headless # Headless: bug 1410525
support-files = file_bug511449.html
[test_bug529119-1.html]
skip-if =
fission && os == "android" # Bug 1827321
[test_bug529119-2.html]
skip-if =
http3
http2
fission && os == "android" # Bug 1827321
[test_bug530396.html]
support-files = bug530396-noref.sjs bug530396-subframe.html
skip-if =

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

@ -576,6 +576,17 @@ Result<NavigationIsolationOptions, nsresult> IsolationOptionsForNavigation(
}
}
#ifdef MOZ_WIDGET_ANDROID
// If we're loading an error page on android, it must complete within the same
// process as the errored page load would complete in due to code expecting
// that behavior. See bug 1673763.
if (aLoadStateLoadType == LOAD_ERROR_PAGE) {
MOZ_LOG(gProcessIsolationLog, LogLevel::Verbose,
("Forcing error page load to complete in the current process"));
behavior = IsolationBehavior::Anywhere;
}
#endif
// If we're loading for a specific extension, we'll need to perform a
// BCG-switching load to get our toplevel extension window in the correct
// BrowsingContextGroup.

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

@ -228,24 +228,24 @@ class NavigationDelegateTest : BaseSessionTest() {
}
@Test fun loadFileNotFound() {
// TODO: Bug 1673954
assumeThat(sessionRule.env.isFission, equalTo(false))
testLoadExpectError(
"file:///test.mozilla",
WebRequestError.ERROR_CATEGORY_URI,
WebRequestError.ERROR_FILE_NOT_FOUND,
)
val promise = mainSession.evaluatePromiseJS("document.addCertException(false)")
var exceptionCaught = false
try {
val result = promise.value as Boolean
assertThat("Promise should not resolve", result, equalTo(false))
} catch (e: GeckoSessionTestRule.RejectedPromiseException) {
exceptionCaught = true
// This is temporarily disabled on Fission. See bug 1673954
if (!sessionRule.env.isFission) {
val promise = mainSession.evaluatePromiseJS("document.addCertException(false)")
var exceptionCaught = false
try {
val result = promise.value as Boolean
assertThat("Promise should not resolve", result, equalTo(false))
} catch (e: GeckoSessionTestRule.RejectedPromiseException) {
exceptionCaught = true
}
assertThat("document.addCertException failed with exception", exceptionCaught, equalTo(true))
}
assertThat("document.addCertException failed with exception", exceptionCaught, equalTo(true))
}
@Test fun loadUnknownHost() {