use of org.prebid.mobile.rendering.listeners.WebViewDelegate in project prebid-mobile-android by prebid.
the class PrebidWebViewBaseTest method openMRAIDExternalLinkTest.
@Test
public void openMRAIDExternalLinkTest() {
WebViewDelegate mockDelegate = mock(WebViewDelegate.class);
mPrebidWebViewBase.mWebViewDelegate = mockDelegate;
mPrebidWebViewBase.openMraidExternalLink("test");
verify(mockDelegate).webViewShouldOpenMRAIDLink(eq("test"));
}
use of org.prebid.mobile.rendering.listeners.WebViewDelegate in project prebid-mobile-android by prebid.
the class PrebidWebViewBaseTest method openExternalLinkTest.
@Test
public void openExternalLinkTest() {
WebViewDelegate mockDelegate = mock(WebViewDelegate.class);
mPrebidWebViewBase.mWebViewDelegate = mockDelegate;
mPrebidWebViewBase.openExternalLink("test");
verify(mockDelegate).webViewShouldOpenExternalLink(eq("test"));
}
use of org.prebid.mobile.rendering.listeners.WebViewDelegate in project prebid-mobile-android by prebid.
the class PrebidWebViewBannerTest method preloadedTest.
@Test
public void preloadedTest() {
WebViewDelegate mockDelegate = mock(WebViewDelegate.class);
InterstitialManager mockManager = mock(InterstitialManager.class);
mBanner.mWebViewDelegate = mockDelegate;
mBanner.mInterstitialManager = mockManager;
MraidEvent mockEvent = mock(MraidEvent.class);
when(mMockWebViewBanner.getMraidEvent()).thenReturn(mockEvent);
mBanner.preloaded(null);
verify(mockDelegate).webViewFailedToLoad(any(AdException.class));
mMockWebViewBanner.mMRAIDBridgeName = "twopart";
mBanner.preloaded(mMockWebViewBanner);
verify(mockManager).displayPrebidWebViewForMraid(eq(mMockWebViewBanner), eq(true));
mMockWebViewBanner.mMRAIDBridgeName = "else";
mBanner.preloaded(mMockWebViewBanner);
// verify render
verify(mMockWebViewBanner).setAdWidth(anyInt());
when(mMockWebViewBanner.getParent()).thenReturn(mock(ViewGroup.class));
mBanner.preloaded(mMockWebViewBanner);
verify(mMockWebViewBanner).bringToFront();
verify(mockDelegate, times(3)).webViewReadyToDisplay();
}
Aggregations