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());
}
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();
}
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();
}
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);
}
Aggregations