use of org.prebid.mobile.rendering.views.webview.WebViewBase 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);
}
use of org.prebid.mobile.rendering.views.webview.WebViewBase in project prebid-mobile-android by prebid.
the class HTMLCreativeTest method adSessionSuccessInitializationTest.
@Test
public void adSessionSuccessInitializationTest() throws Exception {
PrebidWebViewBase prebidWebView = new PrebidWebViewBase(mContext, mMockInterstitialManager);
WebViewBase mockWebViewBase = mock(WebViewBase.class);
BaseJSInterface baseJSInterface = mock(BaseJSInterface.class);
when(mockWebViewBase.getMRAIDInterface()).thenReturn(baseJSInterface);
WhiteBox.setInternalState(prebidWebView, "mWebView", mockWebViewBase);
mHtmlCreative.setCreativeView(prebidWebView);
mHtmlCreative.setCreativeView(prebidWebView);
HTMLCreative spyHtmlCreative = spy(mHtmlCreative);
spyHtmlCreative.display();
}
use of org.prebid.mobile.rendering.views.webview.WebViewBase 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();
}
use of org.prebid.mobile.rendering.views.webview.WebViewBase in project prebid-mobile-android by prebid.
the class MraidControllerTest method handleMraidEventWhenExpandEventAndHelperEmpty_RunTwoPartRunnable.
@Test
public void handleMraidEventWhenExpandEventAndHelperEmpty_RunTwoPartRunnable() {
HTMLCreative mockCreative = mock(HTMLCreative.class);
MraidEvent event = createMraidEvent(JSInterface.ACTION_EXPAND, "twoPart");
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));
ShadowLooper.runUiThreadTasks();
verify(mMraidController, times(1)).expand(any(WebViewBase.class), any(PrebidWebViewBase.class), eq(event));
}
use of org.prebid.mobile.rendering.views.webview.WebViewBase 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));
}
Aggregations