use of org.prebid.mobile.rendering.views.webview.PrebidWebViewBase 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.PrebidWebViewBase in project prebid-mobile-android by prebid.
the class HTMLCreativeTest method createOmAdSessionTest.
@Test
public void createOmAdSessionTest() throws IllegalAccessException {
PrebidWebViewBase mockWebView = mock(PrebidWebViewBase.class);
when(mockWebView.getWebView()).thenReturn(mock(WebViewBase.class));
mHtmlCreative.setCreativeView(mockWebView);
mHtmlCreative.createOmAdSession();
verify(mMockOmAdSessionManager).initWebAdSessionManager(any(WebViewBase.class), any());
verify(mMockOmAdSessionManager).registerAdView(any(View.class));
verify(mMockOmAdSessionManager).startAdSession();
reset(mMockOmAdSessionManager);
mHtmlCreative.mWeakOmAdSessionManager = new WeakReference<>(null);
mHtmlCreative.createOmAdSession();
verify(mMockOmAdSessionManager, never()).startAdSession();
mHtmlCreative.setCreativeView(null);
mHtmlCreative.createOmAdSession();
verify(mMockOmAdSessionManager, never()).startAdSession();
}
use of org.prebid.mobile.rendering.views.webview.PrebidWebViewBase in project prebid-mobile-android by prebid.
the class HTMLCreativeViewTest method testSetMediaUrl.
@Test
public void testSetMediaUrl() throws Exception {
PrebidWebViewBase mockHTMLCreativeView = new PrebidWebViewBase(mMockContext, mock(InterstitialManager.class));
// mockHTMLCreativeView.start();
assertNotNull(mockHTMLCreativeView);
}
use of org.prebid.mobile.rendering.views.webview.PrebidWebViewBase in project prebid-mobile-android by prebid.
the class BaseJSInterface method notifyMraidEventHandler.
private void notifyMraidEventHandler() {
mOrientationBroadcastReceiver.setMraidAction(mMraidEvent.mraidAction);
HTMLCreative htmlCreative = ((PrebidWebViewBase) mAdBaseView.getPreloadedListener()).getCreative();
mAdBaseView.post(new MraidEventHandlerNotifierRunnable(htmlCreative, mAdBaseView, mMraidEvent, mJsExecutor));
}
Aggregations