Search in sources :

Example 1 with AdBaseDialog

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

the class WebViewBaseTest method setGetDialogTest.

@Test
public void setGetDialogTest() {
    AdBaseDialog mockDialog = mock(AdBaseDialog.class);
    assertNull(mWebViewBase.getDialog());
    mWebViewBase.setDialog(mockDialog);
    assertEquals(mockDialog, mWebViewBase.getDialog());
}
Also used : AdBaseDialog(org.prebid.mobile.rendering.interstitial.AdBaseDialog) Test(org.junit.Test)

Example 2 with AdBaseDialog

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

the class MraidControllerTest method handleMraidEventWhenOrientationChangeEvent_CallOnSetOrientationProperties.

@Test
public void handleMraidEventWhenOrientationChangeEvent_CallOnSetOrientationProperties() throws IllegalAccessException, AdException {
    MraidExpand mockMraidExpand = mock(MraidExpand.class);
    AdBaseDialog mockDialog = mock(AdBaseDialog.class);
    when(mockMraidExpand.getInterstitialViewController()).thenReturn(mockDialog);
    WhiteBox.field(MraidController.class, "mMraidExpand").set(mMraidController, mockMraidExpand);
    callControllerHandler(createMraidEvent(JSInterface.ACTION_ORIENTATION_CHANGE, null));
    verify(mockDialog).handleSetOrientationProperties();
}
Also used : AdBaseDialog(org.prebid.mobile.rendering.interstitial.AdBaseDialog) Test(org.junit.Test)

Example 3 with AdBaseDialog

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

the class MraidExpandTest method nullifyDialogTest.

@Test
public void nullifyDialogTest() throws IllegalAccessException {
    AdBaseDialog mockDialog = mock(AdBaseDialog.class);
    WhiteBox.field(MraidExpand.class, "mExpandedDialog").set(mMraidExpand, mockDialog);
    mMraidExpand.nullifyDialog();
    verify(mockDialog).cleanup();
    verify(mockDialog).cancel();
}
Also used : AdBaseDialog(org.prebid.mobile.rendering.interstitial.AdBaseDialog) Test(org.junit.Test)

Example 4 with AdBaseDialog

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

the class InterstitialManagerTest method addOldViewToBackStackValidIntController_PushDisplayViewToStack.

@Test
public void addOldViewToBackStackValidIntController_PushDisplayViewToStack() throws IllegalAccessException {
    WebViewBase mockWebViewBase = mock(WebViewBase.class);
    Stack<View> mockViewStack = spy(new Stack<>());
    AdBaseDialog mockInterstitialViewController = mock(AdBaseDialog.class);
    View mockDisplayView = mock(View.class);
    WhiteBox.field(InterstitialManager.class, "mViewStack").set(mSpyInterstitialManager, mockViewStack);
    when(mockInterstitialViewController.getDisplayView()).thenReturn(mockDisplayView);
    mSpyInterstitialManager.addOldViewToBackStack(mockWebViewBase, "test", mockInterstitialViewController);
    verify(mockViewStack).push(mockDisplayView);
}
Also used : WebViewBase(org.prebid.mobile.rendering.views.webview.WebViewBase) AdBaseDialog(org.prebid.mobile.rendering.interstitial.AdBaseDialog) InterstitialView(org.prebid.mobile.rendering.bidding.display.InterstitialView) View(android.view.View) VideoView(org.prebid.mobile.rendering.bidding.display.VideoView) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)4 AdBaseDialog (org.prebid.mobile.rendering.interstitial.AdBaseDialog)4 View (android.view.View)1 InterstitialView (org.prebid.mobile.rendering.bidding.display.InterstitialView)1 VideoView (org.prebid.mobile.rendering.bidding.display.VideoView)1 WebViewBase (org.prebid.mobile.rendering.views.webview.WebViewBase)1