use of org.prebid.mobile.rendering.models.internal.MraidEvent in project prebid-mobile-android by prebid.
the class MraidControllerTest method expandWhenHelperNotEmpty_NewWebViewSetEvent.
@Test
public void expandWhenHelperNotEmpty_NewWebViewSetEvent() {
WebViewBase mockOldWebView = mock(WebViewBase.class);
PrebidWebViewBase mockNewWebView = mock(PrebidWebViewBase.class);
MraidEvent event = createMraidEvent(JSInterface.ACTION_EXPAND, "twoPart");
WebViewBanner mockBanner = mock(WebViewBanner.class);
when(mockNewWebView.getMraidWebView()).thenReturn(mockBanner);
when(mockOldWebView.getMraidListener()).thenReturn(mock(MraidEventsManager.MraidListener.class));
mMraidController.expand(mockOldWebView, mockNewWebView, event);
verify(mockNewWebView, times(1)).getMraidWebView();
verify(mockBanner).setMraidEvent(eq(event));
}
use of org.prebid.mobile.rendering.models.internal.MraidEvent in project prebid-mobile-android by prebid.
the class MraidControllerTest method handleMraidEventWhenExpandEventAndHelperEmpty_InitExpand.
@Test
public void handleMraidEventWhenExpandEventAndHelperEmpty_InitExpand() {
MraidEvent event = createMraidEvent(JSInterface.ACTION_EXPAND, null);
HTMLCreative mockCreative = mock(HTMLCreative.class);
WebViewBase mockOldWebView = mock(WebViewBase.class);
when(mockOldWebView.getMraidListener()).thenReturn(mock(MraidEventsManager.MraidListener.class));
when(mockOldWebView.getContext()).thenReturn(mContext);
mMraidController.handleMraidEvent(event, mockCreative, mockOldWebView, mock(PrebidWebViewBase.class));
verify(mMraidController).initMraidExpand(any(View.class), any(MraidController.DisplayCompletionListener.class), any(MraidEvent.class));
}
use of org.prebid.mobile.rendering.models.internal.MraidEvent in project prebid-mobile-android by prebid.
the class MraidControllerTest method delegateDisplayViewInInterstitialAndExpandNull_InitExpand.
@Test
public void delegateDisplayViewInInterstitialAndExpandNull_InitExpand() throws Exception {
mMraidController = new MraidController(mMockInterstitialManager);
MraidEvent mockEvent = mock(MraidEvent.class);
mockEvent.mraidAction = JSInterface.ACTION_EXPAND;
mockEvent.mraidActionHelper = "test";
InterstitialManagerMraidDelegate delegate = getMraidDelegate();
delegate.displayViewInInterstitial(mock(WebViewBase.class), true, mockEvent, mock(MraidController.DisplayCompletionListener.class));
assertNotNull(WhiteBox.getInternalState(mMraidController, "mMraidExpand"));
}
Aggregations