use of org.prebid.mobile.rendering.views.AdViewManager in project prebid-mobile-android by prebid.
the class InterstitialVideoTest method whenRemainingTimePresent_UseRemainingTime.
@Test
public void whenRemainingTimePresent_UseRemainingTime() throws Exception {
Context context = mock(Context.class);
AdViewManager adViewManager = new AdViewManager(context, mock(AdViewManagerListener.class), mMockAdView, mock(InterstitialManager.class));
AdConfiguration adConfiguration = adViewManager.getAdConfiguration();
adConfiguration.setVideoSkipOffset(10);
AbstractCreative mockCreative = mock(AbstractCreative.class);
VideoCreativeModel mockModel = mock(VideoCreativeModel.class);
when(mockModel.getSkipOffset()).thenReturn(20L);
when(mockCreative.getCreativeModel()).thenReturn(mockModel);
WhiteBox.field(AdViewManager.class, "mCurrentCreative").set(adViewManager, mockCreative);
when(mMockAdView.getMediaOffset()).thenReturn(adViewManager.getSkipOffset());
mSpyInterstitialVideo.setRemainingTimeInMs(3000);
mSpyInterstitialVideo.scheduleShowCloseBtnTask(mMockAdView, 3000);
verify(mSpyInterstitialVideo).scheduleTimer(3L * 1000);
}
use of org.prebid.mobile.rendering.views.AdViewManager in project prebid-mobile-android by prebid.
the class InterstitialVideoTest method whenAllOffsetsPresent_UseSscOffset.
@Test
public void whenAllOffsetsPresent_UseSscOffset() throws Exception {
Context context = mock(Context.class);
AdViewManager adViewManager = new AdViewManager(context, mock(AdViewManagerListener.class), mMockAdView, mMockInterstitialManager);
AdConfiguration adConfiguration = adViewManager.getAdConfiguration();
adConfiguration.setVideoSkipOffset(10000);
AbstractCreative mockCreative = mock(AbstractCreative.class);
VideoCreativeModel mockModel = mock(VideoCreativeModel.class);
when(mockModel.getSkipOffset()).thenReturn(20000L);
when(mockCreative.getCreativeModel()).thenReturn(mockModel);
WhiteBox.field(AdViewManager.class, "mCurrentCreative").set(adViewManager, mockCreative);
when(mMockAdView.getMediaOffset()).thenReturn(adViewManager.getSkipOffset());
mSpyInterstitialVideo.scheduleShowCloseBtnTask(mMockAdView);
verify(mSpyInterstitialVideo).scheduleTimer(10L * 1000);
}
use of org.prebid.mobile.rendering.views.AdViewManager in project prebid-mobile-android by prebid.
the class DisplayView method displayHtmlAd.
private void displayHtmlAd(BidResponse response) throws AdException {
mAdViewManager = new AdViewManager(getContext(), mAdViewManagerListener, this, mInterstitialManager);
mAdViewManager.loadBidTransaction(mAdUnitConfiguration, response);
mEventForwardingReceiver = new EventForwardingLocalBroadcastReceiver(mAdUnitConfiguration.getBroadcastId(), mBroadcastListener);
mEventForwardingReceiver.register(getContext(), mEventForwardingReceiver);
}
use of org.prebid.mobile.rendering.views.AdViewManager in project prebid-mobile-android by prebid.
the class InterstitialView method setAdViewManagerValues.
protected void setAdViewManagerValues() throws AdException {
mAdViewManager = new AdViewManager(getContext(), mOnAdViewManagerListener, this, mInterstitialManager);
AdConfiguration adConfiguration = mAdViewManager.getAdConfiguration();
adConfiguration.setAutoRefreshDelay(0);
}
use of org.prebid.mobile.rendering.views.AdViewManager in project prebid-mobile-android by prebid.
the class InterstitialVideoTest method whenVastAndSscOffsetPresent_UseSscOffset.
@Test
public void whenVastAndSscOffsetPresent_UseSscOffset() throws Exception {
Context context = mock(Context.class);
AdViewManager adViewManager = new AdViewManager(context, mock(AdViewManagerListener.class), mMockAdView, mMockInterstitialManager);
AdConfiguration adConfiguration = adViewManager.getAdConfiguration();
adConfiguration.setVideoSkipOffset(10000);
AbstractCreative mockCreative = mock(AbstractCreative.class);
VideoCreativeModel mockModel = mock(VideoCreativeModel.class);
when(mockModel.getSkipOffset()).thenReturn(20000L);
when(mockCreative.getCreativeModel()).thenReturn(mockModel);
WhiteBox.field(AdViewManager.class, "mCurrentCreative").set(adViewManager, mockCreative);
when(mMockAdView.getMediaOffset()).thenReturn(adViewManager.getSkipOffset());
mSpyInterstitialVideo.scheduleShowCloseBtnTask(mMockAdView);
verify(mSpyInterstitialVideo).scheduleTimer(10L * 1000);
}
Aggregations