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

Bug 1840581 - Add condition before switching to private browsing

This commit is contained in:
AndiAJ 2023-06-27 13:04:30 +03:00 committed by mergify[bot]
parent 53cc9846d8
commit 8fa7e645f0

View File

@ -625,11 +625,18 @@ class HomeScreenRobot {
}
fun togglePrivateBrowsingMode() {
mDevice.findObject(UiSelector().resourceId("$packageName:id/privateBrowsingButton"))
.waitForExists(
waitingTime,
)
privateBrowsingButton.click()
if (
!itemWithResIdAndDescription(
"$packageName:id/privateBrowsingButton",
"Disable private browsing",
).exists()
) {
mDevice.findObject(UiSelector().resourceId("$packageName:id/privateBrowsingButton"))
.waitForExists(
waitingTime,
)
privateBrowsingButton.click()
}
}
fun triggerPrivateBrowsingShortcutPrompt(interact: AddToHomeScreenRobot.() -> Unit): AddToHomeScreenRobot.Transition {