use of org.prebid.mobile.rendering.models.internal.MraidEvent in project prebid-mobile-android by prebid.
the class MraidControllerTest method createMraidEvent.
private MraidEvent createMraidEvent(String eventType, String helper) {
MraidEvent event = mock(MraidEvent.class);
event.mraidAction = eventType;
event.mraidActionHelper = helper;
return event;
}
use of org.prebid.mobile.rendering.models.internal.MraidEvent in project prebid-mobile-android by prebid.
the class MraidControllerTest method handleMraidEventWhenPlayVideoEvent_DisplayMraidInInterstitial.
@Test
public void handleMraidEventWhenPlayVideoEvent_DisplayMraidInInterstitial() {
MraidEvent event = createMraidEvent(JSInterface.ACTION_PLAY_VIDEO, "test");
callControllerHandler(event);
// called when displaying interstitial
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 InterstitialManagerTest method displayPrebidWebViewForMraid_CallDelegateDisplayPrebidWebViewForMRAID.
@Test
public void displayPrebidWebViewForMraid_CallDelegateDisplayPrebidWebViewForMRAID() throws Exception {
WebViewBanner mockWebView = mock(WebViewBanner.class);
MraidEvent mockEvent = mock(MraidEvent.class);
mockEvent.mraidAction = JSInterface.ACTION_EXPAND;
mockEvent.mraidActionHelper = "test";
when(mockWebView.getMraidEvent()).thenReturn(mockEvent);
mSpyInterstitialManager.displayPrebidWebViewForMraid(mockWebView, true);
verify(mMockMraidDelegate).displayPrebidWebViewForMraid(mockWebView, true, mockEvent);
}
use of org.prebid.mobile.rendering.models.internal.MraidEvent in project prebid-mobile-android by prebid.
the class BaseJSInterfaceTest method resizeTest.
@Test
public void resizeTest() throws Exception {
Field field = WhiteBox.field(BaseJSInterface.class, "mMraidEvent");
mSpyBaseJSInterface.resize();
MraidEvent event = (MraidEvent) field.get(mSpyBaseJSInterface);
assertEquals(JSInterface.ACTION_RESIZE, event.mraidAction);
verify(mMockMraidController).handleMraidEvent(eq(event), eq(mMockCreative), any(WebViewBase.class), any());
}
use of org.prebid.mobile.rendering.models.internal.MraidEvent in project prebid-mobile-android by prebid.
the class BaseJSInterfaceTest method createCalendarEventTest.
@Test
public void createCalendarEventTest() throws Exception {
Field field = WhiteBox.field(BaseJSInterface.class, "mMraidEvent");
mSpyBaseJSInterface.createCalendarEvent("test");
MraidEvent event = (MraidEvent) field.get(mSpyBaseJSInterface);
assertEquals(JSInterface.ACTION_CREATE_CALENDAR_EVENT, event.mraidAction);
assertEquals("test", event.mraidActionHelper);
verify(mMockMraidController).handleMraidEvent(eq(event), eq(mMockCreative), any(WebViewBase.class), any());
}
Aggregations