use of org.prebid.mobile.rendering.bidding.display.InterstitialView in project prebid-mobile-android by prebid.
the class AdViewManagerTest method testAdViewManager.
@Test
public void testAdViewManager() throws Exception {
AdViewManagerListener mockAdViewListener = mock(AdViewManagerListener.class);
InterstitialView mockAdView = mock(InterstitialView.class);
AdViewManager adViewManager = new AdViewManager(mContext, mockAdViewListener, mockAdView, mMockInterstitialManager);
assertNotNull(adViewManager);
}
use of org.prebid.mobile.rendering.bidding.display.InterstitialView in project prebid-mobile-android by prebid.
the class AdViewManagerTest method testAdViewManagerNullParams.
@Test
public void testAdViewManagerNullParams() {
InterstitialView mockAdView = mock(InterstitialView.class);
AdViewManager adViewManager = null;
AdException err = null;
try {
adViewManager = new AdViewManager(mContext, null, mockAdView, mMockInterstitialManager);
} catch (Exception e) {
err = new AdException(AdException.INTERNAL_ERROR, e.getMessage());
}
assertNotNull(err);
assertNull(adViewManager);
}
use of org.prebid.mobile.rendering.bidding.display.InterstitialView in project prebid-mobile-android by prebid.
the class InterstitialManagerTest method displayViewAsInterstitialSuccess_ShowInterstitialAdView.
@Test
@LooperMode(LooperMode.Mode.PAUSED)
public void displayViewAsInterstitialSuccess_ShowInterstitialAdView() {
VideoCreative mockVideoCreative = mock(VideoCreative.class);
when(mockVideoCreative.isResolved()).thenReturn(true);
BaseJSInterface mockJsInterface = mock(BaseJSInterface.class);
when(mockJsInterface.getJsExecutor()).thenReturn(mock(JsExecutor.class));
WebViewBase mockWebViewBase = mock(WebViewBase.class);
when(mockWebViewBase.getMRAIDInterface()).thenReturn(mockJsInterface);
PrebidWebViewInterstitial mockPrebidWebViewInterstitial = mock(PrebidWebViewInterstitial.class);
when(mockPrebidWebViewInterstitial.getWebView()).thenReturn(mockWebViewBase);
InterstitialView mockInterstitialView = mock(InterstitialView.class);
when(mockInterstitialView.getCreativeView()).thenReturn(mockPrebidWebViewInterstitial);
mSpyInterstitialManager.displayAdViewInInterstitial(mContext, mockInterstitialView);
verify(mMockAdViewDelegate).showInterstitial();
}
use of org.prebid.mobile.rendering.bidding.display.InterstitialView in project prebid-mobile-android by prebid.
the class AdViewManagerTest method testAdViewManagerNullAdViewListener.
@Test
public void testAdViewManagerNullAdViewListener() {
InterstitialView mockAdView = mock(InterstitialView.class);
AdViewManager adViewManager = null;
AdException err = null;
try {
adViewManager = new AdViewManager(mContext, null, mockAdView, mMockInterstitialManager);
} catch (AdException e) {
err = e;
}
assertNotNull(err);
assertNull(adViewManager);
assertEquals(AdException.INTERNAL_ERROR + ": AdViewManagerListener is null", err.getMessage());
}
use of org.prebid.mobile.rendering.bidding.display.InterstitialView in project prebid-mobile-android by prebid.
the class InterstitialManager method displayAdViewInInterstitial.
// Note: The context should be the Activity this view will display on top of
public void displayAdViewInInterstitial(Context context, View view) {
if (!(context instanceof Activity)) {
LogUtil.error(TAG, "displayAdViewInInterstitial(): Can not display interstitial without activity context");
return;
}
if (view instanceof InterstitialView) {
// TODO: 13.08.2020 Remove casts to specific view
InterstitialView interstitialView = ((InterstitialView) view);
show();
showInterstitialDialog(context, interstitialView);
}
}
Aggregations