use of org.prebid.mobile.rendering.listeners.CreativeResolutionListener in project prebid-mobile-android by prebid.
the class HTMLCreativeTest method webViewFailedToLoadTest.
@Test
public void webViewFailedToLoadTest() throws Exception {
CreativeResolutionListener mockResolutionListener = mock(CreativeResolutionListener.class);
mHtmlCreative.setResolutionListener(mockResolutionListener);
// Resolved
WhiteBox.field(HTMLCreative.class, "mResolved").set(mHtmlCreative, true);
mHtmlCreative.webViewFailedToLoad(new AdException("foo", "bar"));
verify(mockResolutionListener, never()).creativeFailed(any(AdException.class));
// Not resolved
WhiteBox.field(HTMLCreative.class, "mResolved").set(mHtmlCreative, false);
mHtmlCreative.webViewFailedToLoad(new AdException("foo", "bar"));
verify(mockResolutionListener).creativeFailed(any(AdException.class));
}
use of org.prebid.mobile.rendering.listeners.CreativeResolutionListener in project prebid-mobile-android by prebid.
the class HTMLCreativeTest method webViewReadyToDisplayTest.
@Test
public void webViewReadyToDisplayTest() throws Exception {
CreativeResolutionListener mockResolutionListener = mock(CreativeResolutionListener.class);
mHtmlCreative.setResolutionListener(mockResolutionListener);
// Resolved
WhiteBox.field(HTMLCreative.class, "mResolved").set(mHtmlCreative, true);
mHtmlCreative.webViewReadyToDisplay();
verify(mockResolutionListener, never()).creativeReady(any(AbstractCreative.class));
// Not resolved
WhiteBox.field(HTMLCreative.class, "mResolved").set(mHtmlCreative, false);
mHtmlCreative.webViewReadyToDisplay();
verify(mockResolutionListener).creativeReady(any(AbstractCreative.class));
}
Aggregations