use of org.prebid.mobile.rendering.bidding.loader.BidLoader in project prebid-mobile-android by prebid.
the class RewardedAdUnitTest method createRewardedAdUnitNoEventHandler_InstanceCreatedStandaloneEventHandlerProvidedBidLoaderIsNotNull.
@Test
public void createRewardedAdUnitNoEventHandler_InstanceCreatedStandaloneEventHandlerProvidedBidLoaderIsNotNull() {
RewardedAdUnit rewardedAdUnit = new RewardedAdUnit(mContext, CONFIGURATION_ID);
Object eventHandler = WhiteBox.getInternalState(rewardedAdUnit, "mEventHandler");
BidLoader bidLoader = ((BidLoader) WhiteBox.getInternalState(rewardedAdUnit, "mBidLoader"));
assertNotNull(rewardedAdUnit);
assertTrue(eventHandler instanceof StandaloneRewardedVideoEventHandler);
assertNotNull(bidLoader);
}
use of org.prebid.mobile.rendering.bidding.loader.BidLoader in project prebid-mobile-android by prebid.
the class BannerView method initBidLoader.
private void initBidLoader() {
mBidLoader = new BidLoader(getContext(), mAdUnitConfig, mBidRequesterListener);
final VisibilityTrackerOption visibilityTrackerOption = new VisibilityTrackerOption(NativeEventTracker.EventType.IMPRESSION);
final VisibilityChecker visibilityChecker = new VisibilityChecker(visibilityTrackerOption);
mBidLoader.setBidRefreshListener(() -> {
if (mAdFailed) {
mAdFailed = false;
return true;
}
final boolean isWindowVisibleToUser = mScreenStateReceiver.isScreenOn();
return visibilityChecker.isVisibleForRefresh(this) && isWindowVisibleToUser;
});
}
use of org.prebid.mobile.rendering.bidding.loader.BidLoader in project prebid-mobile-android by prebid.
the class BannerViewTest method createPrebidBannerViewNoEventHandler_InstanceCreatedAndBidLoaderIsNotNullAndStandaloneEventHandlerProvided.
@Test
public void createPrebidBannerViewNoEventHandler_InstanceCreatedAndBidLoaderIsNotNullAndStandaloneEventHandlerProvided() throws IllegalAccessException {
BannerView bannerView = new BannerView(mMockContext, AD_UNIT_ID, AD_SIZE);
Object eventHandler = WhiteBox.field(BannerView.class, "mEventHandler").get(bannerView);
BidLoader bidLoader = ((BidLoader) WhiteBox.field(BannerView.class, "mBidLoader").get(bannerView));
assertNotNull(bannerView);
assertTrue(eventHandler instanceof StandaloneBannerEventHandler);
assertNotNull(bidLoader);
}
use of org.prebid.mobile.rendering.bidding.loader.BidLoader in project prebid-mobile-android by prebid.
the class InterstitialAdUnitTest method createInterstitialAdUnitNoEventHandler_InstanceCreatedStandaloneEventHandlerProvidedBidLoaderIsNotNull.
@Test
public void createInterstitialAdUnitNoEventHandler_InstanceCreatedStandaloneEventHandlerProvidedBidLoaderIsNotNull() {
InterstitialAdUnit interstitialAdUnit = new InterstitialAdUnit(mContext, CONFIGURATION_ID, AdUnitFormat.VIDEO);
Object eventHandler = WhiteBox.getInternalState(interstitialAdUnit, "mEventHandler");
BidLoader bidLoader = ((BidLoader) WhiteBox.getInternalState(interstitialAdUnit, "mBidLoader"));
assertNotNull(interstitialAdUnit);
assertTrue(eventHandler instanceof StandaloneInterstitialEventHandler);
assertNotNull(bidLoader);
}
Aggregations