2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

Bug 1855516 - Call disableExtensionProcessSpawning() when the user clicks the "continue without add-ons" button

This commit is contained in:
William Durand 2023-09-27 23:17:23 +02:00 committed by mergify[bot]
parent 9b599dc07a
commit 9353b6d87e
2 changed files with 5 additions and 1 deletions

View File

@ -53,10 +53,11 @@ class ExtensionProcessDisabledController(
* Present a dialog to the user notifying of extension process spawning disabled and also asking
* whether they would like to continue trying or disable extensions. If the user chooses to retry,
* enable the extension process spawning with [WebExtensionController.enableExtensionProcessSpawning].
* Otherwise, call [WebExtensionController.disableExtensionProcessSpawning].
*
* @param context to show the AlertDialog
* @param store The [BrowserStore] which holds the state for showing the dialog
* @param webExtensionController to call when a user enables the process spawning
* @param webExtensionController to call when the user enables or disables the process spawning
* @param builder to use for creating the dialog which can be styled as needed
* @param appName to be added to the message. Necessary to be added as a param for testing
*/
@ -84,6 +85,7 @@ class ExtensionProcessDisabledController(
onDismissDialog?.invoke()
}
findViewById<Button>(R.id.negative)?.setOnClickListener {
engine.disableExtensionProcessSpawning()
Addons.extensionsProcessUiDisable.add()
store.dispatch(ExtensionProcessDisabledPopupAction(false))
onDismissDialog?.invoke()

View File

@ -63,6 +63,7 @@ class ExtensionProcessDisabledControllerTest {
store.waitUntilIdle()
verify(engine).enableExtensionProcessSpawning()
verify(engine, never()).disableExtensionProcessSpawning()
assertFalse(store.state.showExtensionProcessDisabledPopup)
verify(dialog).dismiss()
}
@ -97,6 +98,7 @@ class ExtensionProcessDisabledControllerTest {
assertFalse(store.state.showExtensionProcessDisabledPopup)
verify(engine, never()).enableExtensionProcessSpawning()
verify(engine).disableExtensionProcessSpawning()
verify(dialog).dismiss()
}