Skip to content

Commit 74c6594

Browse files
committed
banner view wait for listeners in itest
1 parent 5a9e5d7 commit 74c6594

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

admob/integration_test/src/integration_test.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,9 @@ TEST_F(FirebaseAdMobTest, TestBannerView) {
636636
app_framework::ProcessEvents(2000);
637637

638638
WaitForCompletion(banner->Destroy(), "Destroy BannerView");
639+
640+
LogDebug("And again to ensure destruction callbacks are recorded.");
641+
app_framework::ProcessEvents(2000);
639642
banner->SetBoundingBoxListener(nullptr);
640643
delete banner;
641644

@@ -734,6 +737,9 @@ TEST_F(FirebaseAdMobTest, TestBannerViewAdOpenedAdClosed) {
734737
app_framework::ProcessEvents(1000);
735738
}
736739

740+
LogDebug("Waiting for a moment to ensure all callbacks are recorded.");
741+
app_framework::ProcessEvents(2000);
742+
737743
// Ensure all of the expected events were triggered on Android.
738744
EXPECT_EQ(ad_listener.num_on_ad_clicked_, 1);
739745
EXPECT_EQ(ad_listener.num_on_ad_impression_, 1);

admob/src/android/interstitial_ad_internal_android.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ Future<LoadAdResult> InterstitialAdInternalAndroid::LoadAd(
101101

102102
if (!initialized_) {
103103
SafeFutureHandle<LoadAdResult> handle =
104-
future_data_.future_impl.SafeAlloc<LoadAdResult>(kInterstitialAdFnLoadAd, LoadAdResult());
104+
future_data_.future_impl.SafeAlloc<LoadAdResult>(
105+
kInterstitialAdFnLoadAd, LoadAdResult());
105106
CompleteFuture(kAdMobErrorUninitialized, kAdUninitializedErrorMessage,
106107
handle, &future_data_, LoadAdResult());
107108
return MakeFuture(&future_data_.future_impl, handle);

0 commit comments

Comments
 (0)