Skip to content

Commit

Permalink
Add retry to LoadConsentForm for timeouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsimantov committed Oct 19, 2023
1 parent d8c5099 commit 465b8e1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions gma/integration_test/src/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2660,12 +2660,14 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadForm) {
EXPECT_EQ(consent_info_->GetConsentFormStatus(),
firebase::gma::ump::kConsentFormStatusAvailable);

// Load the form.
firebase::Future<void> future = consent_info_->LoadConsentForm();
// Load the form. Run this step with retry in case of timeout.
WaitForCompletion(RunWithRetry(
[&]() { return consent_info_->LoadConsentForm(); }, "LoadConsentForm",
firebase::gma::ump::kConsentFormErrorTimeout), "LoadconsentForm");

EXPECT_TRUE(future == consent_info_->LoadConsentFormLastResult());
firebase::Future<void> future = consent_info_->LoadConsentFormLastResult();

WaitForCompletion(future, "LoadConsentForm");
EXPECT_TRUE(future == consent_info_->LoadConsentFormLastResult());

EXPECT_EQ(consent_info_->GetConsentFormStatus(),
firebase::gma::ump::kConsentFormStatusAvailable);
Expand Down

0 comments on commit 465b8e1

Please sign in to comment.