Skip to content

Commit 9bc8992

Browse files
committed
fix tests
1 parent 04c30d2 commit 9bc8992

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/impl/FirebaseAppDistributionImpl.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,18 +374,20 @@ private void doStartFeedback(CharSequence infoText, @Nullable Uri screenshotUri)
374374
.signInTester()
375375
.addOnFailureListener(
376376
taskExecutor,
377-
e ->
378-
LogWrapper.getInstance()
379-
.e("Failed to sign in tester. Could not collect feedback.", e))
377+
e -> {
378+
feedbackInProgress.set(false);
379+
LogWrapper.getInstance()
380+
.e("Failed to sign in tester. Could not collect feedback.", e);
381+
})
380382
.onSuccessTask(
381383
taskExecutor,
382384
unused ->
383385
releaseIdentifier
384386
.identifyRelease()
385387
.addOnFailureListener(
386388
e -> {
387-
LogWrapper.getInstance().e("Failed to identify release", e);
388389
feedbackInProgress.set(false);
390+
LogWrapper.getInstance().e("Failed to identify release", e);
389391
Toast.makeText(
390392
firebaseApp.getApplicationContext(),
391393
R.string.feedback_unidentified_release,
@@ -398,9 +400,9 @@ private void doStartFeedback(CharSequence infoText, @Nullable Uri screenshotUri)
398400
launchFeedbackActivity(releaseName, infoText, screenshotUri)
399401
.addOnFailureListener(
400402
e -> {
403+
feedbackInProgress.set(false);
401404
LogWrapper.getInstance()
402405
.e("Failed to launch feedback flow", e);
403-
feedbackInProgress.set(false);
404406
Toast.makeText(
405407
firebaseApp.getApplicationContext(),
406408
R.string.feedback_launch_failed,

firebase-appdistribution/src/test/java/com/google/firebase/appdistribution/impl/FirebaseAppDistributionServiceImplTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ public void startFeedback_signInTesterFails_logsAndSetsInProgressToFalse()
758758
TestUtils.awaitAsyncOperations(taskExecutor);
759759

760760
assertThat(firebaseAppDistribution.isFeedbackInProgress()).isFalse();
761-
assertLoggedError("Failed to launch feedback flow", exception);
761+
assertLoggedError("Failed to sign in tester", exception);
762762
}
763763

764764
@Test
@@ -772,7 +772,7 @@ public void startFeedback_cantIdentifyRelease_logsAndSetsInProgressToFalse()
772772
TestUtils.awaitAsyncOperations(taskExecutor);
773773

774774
assertThat(firebaseAppDistribution.isFeedbackInProgress()).isFalse();
775-
assertLoggedError("Failed to launch feedback flow", exception);
775+
assertLoggedError("Failed to identify release", exception);
776776
}
777777

778778
private static void assertLoggedError(String partialMessage, Throwable e) {

0 commit comments

Comments
 (0)