Search in sources :

Example 1 with AdInterstitialDialog

use of org.prebid.mobile.rendering.interstitial.AdInterstitialDialog in project prebid-mobile-android by prebid.

the class InterstitialManagerTest method interstitialClosedAndMraidCollapsed_DoNotNotifyMraidDelegate.

@Test
public void interstitialClosedAndMraidCollapsed_DoNotNotifyMraidDelegate() throws IllegalAccessException {
    HTMLCreative mockHtmlCreative = mock(HTMLCreative.class);
    AdInterstitialDialog mockAdInterstitialDialog = mock(AdInterstitialDialog.class);
    WhiteBox.field(InterstitialManager.class, "mInterstitialDialog").set(mSpyInterstitialManager, mockAdInterstitialDialog);
    mSpyInterstitialManager.setInterstitialDisplayDelegate(mockHtmlCreative);
    when(mMockMraidDelegate.collapseMraid()).thenReturn(true);
    mSpyInterstitialManager.interstitialClosed(null);
    verify(mockAdInterstitialDialog, never()).nullifyDialog();
}
Also used : AdInterstitialDialog(org.prebid.mobile.rendering.interstitial.AdInterstitialDialog) HTMLCreative(org.prebid.mobile.rendering.models.HTMLCreative) Test(org.junit.Test)

Example 2 with AdInterstitialDialog

use of org.prebid.mobile.rendering.interstitial.AdInterstitialDialog in project prebid-mobile-android by prebid.

the class InterstitialManagerTest method interstitialClosedNullMraidExpand_NullifyDialog.

@Test
public void interstitialClosedNullMraidExpand_NullifyDialog() throws IllegalAccessException {
    AdInterstitialDialog mockAdInterstitialDialog = mock(AdInterstitialDialog.class);
    WhiteBox.field(InterstitialManager.class, "mInterstitialDialog").set(mSpyInterstitialManager, mockAdInterstitialDialog);
    when(mMockMraidDelegate.collapseMraid()).thenReturn(false);
    mSpyInterstitialManager.interstitialClosed(null);
    verify(mockAdInterstitialDialog, times(1)).nullifyDialog();
}
Also used : AdInterstitialDialog(org.prebid.mobile.rendering.interstitial.AdInterstitialDialog) Test(org.junit.Test)

Example 3 with AdInterstitialDialog

use of org.prebid.mobile.rendering.interstitial.AdInterstitialDialog in project prebid-mobile-android by prebid.

the class InterstitialManager method showInterstitialDialog.

private void showInterstitialDialog(Context context, InterstitialView interstitialView) {
    WebViewBase webViewBase = ((PrebidWebViewInterstitial) interstitialView.getCreativeView()).getWebView();
    webViewBase.setId(INTERSTITIAL_WEBVIEW_ID);
    mInterstitialDialog = new AdInterstitialDialog(context, webViewBase, interstitialView, this);
    mInterstitialDialog.show();
}
Also used : PrebidWebViewInterstitial(org.prebid.mobile.rendering.views.webview.PrebidWebViewInterstitial) WebViewBase(org.prebid.mobile.rendering.views.webview.WebViewBase) AdInterstitialDialog(org.prebid.mobile.rendering.interstitial.AdInterstitialDialog)

Aggregations

AdInterstitialDialog (org.prebid.mobile.rendering.interstitial.AdInterstitialDialog)3 Test (org.junit.Test)2 HTMLCreative (org.prebid.mobile.rendering.models.HTMLCreative)1 PrebidWebViewInterstitial (org.prebid.mobile.rendering.views.webview.PrebidWebViewInterstitial)1 WebViewBase (org.prebid.mobile.rendering.views.webview.WebViewBase)1