tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 50a34d25155fd70628ee69c7d68a2509c0e3445d
parent 1a3b3e24077ff8853021724d1c76a0a1090b9309
Author: AndiAJ <andiaj@users.noreply.github.com>
Date:   Tue, 21 Oct 2025 07:05:21 +0000

Bug 1927676 - Fix verifyDownloadCompleteNotificationTest UI test r=aaronmt

The UI test was failing because the swipe action wasn't always properly performed.
The failure of performing the swipe action throws an UiObjectNotFoundException which wasn't caught, making the retry loop ineffective.

To make sure that the retry loop will run effectively, I've replaced AssertionError with Throwable.
By doing this, we'll catch all Exceptions (UiObjectNotFoundException, NullPointerException etc.) and Errors (AssertionError, OutOfMemoryError etc.)

The UI test successfully passed 100x on Firebase ✅

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

Diffstat:
Mmobile/android/fenix/app/src/androidTest/java/org/mozilla/fenix/ui/robots/NotificationRobot.kt | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mobile/android/fenix/app/src/androidTest/java/org/mozilla/fenix/ui/robots/NotificationRobot.kt b/mobile/android/fenix/app/src/androidTest/java/org/mozilla/fenix/ui/robots/NotificationRobot.kt @@ -189,6 +189,7 @@ class NotificationRobot { var retries = 0 while (itemContainingText(appName).exists() && retries++ < 3) { + Log.i(TAG, "swipeDownloadNotification: Started try #$retries to swipe $direction the download notification") // Swipe left the download system notification if (direction == "Left") { itemContainingText(appName) @@ -235,7 +236,7 @@ class NotificationRobot { } break - } catch (e: AssertionError) { + } catch (e: Throwable) { Log.i(TAG, "swipeDownloadNotification: AssertionError caught, executing fallback methods") if (i == RETRY_COUNT) { throw e