Skip to content

Commit

Permalink
Merge branch 'main' into gma-ignore-nofill-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsimantov authored Jan 13, 2024
2 parents 38a6f4a + ba0b681 commit 561027a
Show file tree
Hide file tree
Showing 2 changed files with 231 additions and 262 deletions.
34 changes: 11 additions & 23 deletions gma/integration_test/src/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3026,7 +3026,7 @@ TEST_F(FirebaseGmaUmpTest, TestUmpCleanupRaceCondition) {

TEST_F(FirebaseGmaUmpTest, TestUmpCallbacksOnWrongInstance) {
// Ensure that if ConsentInfo is deleted and then recreated, stale
// callbacks don't call into the new instance.
// callbacks don't call into the new instance and cause crashes.
using firebase::gma::ump::ConsentFormStatus;
using firebase::gma::ump::ConsentRequestParameters;
using firebase::gma::ump::ConsentStatus;
Expand All @@ -3038,33 +3038,21 @@ TEST_F(FirebaseGmaUmpTest, TestUmpCallbacksOnWrongInstance) {
params.debug_settings.debug_device_ids = kTestDeviceIDs;
params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId());

firebase::Future<void> future_request =
consent_info_->RequestConsentInfoUpdate(params);
firebase::Future<void> future_load = consent_info_->LoadConsentForm();
firebase::Future<void> future_show =
consent_info_->ShowConsentForm(app_framework::GetWindowController());
firebase::Future<void> future_load_and_show =
consent_info_->LoadAndShowConsentFormIfRequired(
app_framework::GetWindowController());
firebase::Future<void> future_privacy = consent_info_->ShowPrivacyOptionsForm(
app_framework::GetWindowController());
consent_info_->RequestConsentInfoUpdate(params);
consent_info_->LoadConsentForm();
// In automated tests, only check RequestConsentInfoUpdate and LoadConsentForm
// as the rest may show UI.
if (ShouldRunUITests()) {
consent_info_->ShowConsentForm(app_framework::GetWindowController());
consent_info_->LoadAndShowConsentFormIfRequired(
app_framework::GetWindowController());
consent_info_->ShowPrivacyOptionsForm(app_framework::GetWindowController());
}

TerminateUmp(kNoReset);

EXPECT_EQ(future_request.status(), firebase::kFutureStatusInvalid);
EXPECT_EQ(future_load.status(), firebase::kFutureStatusInvalid);
EXPECT_EQ(future_show.status(), firebase::kFutureStatusInvalid);
EXPECT_EQ(future_load_and_show.status(), firebase::kFutureStatusInvalid);
EXPECT_EQ(future_privacy.status(), firebase::kFutureStatusInvalid);

InitializeUmp(kNoReset);

EXPECT_EQ(future_request.status(), firebase::kFutureStatusInvalid);
EXPECT_EQ(future_load.status(), firebase::kFutureStatusInvalid);
EXPECT_EQ(future_show.status(), firebase::kFutureStatusInvalid);
EXPECT_EQ(future_load_and_show.status(), firebase::kFutureStatusInvalid);
EXPECT_EQ(future_privacy.status(), firebase::kFutureStatusInvalid);

// Give the operations time to complete.
ProcessEvents(5000);
}
Expand Down
Loading

0 comments on commit 561027a

Please sign in to comment.