use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class PrebidBannerAdapter method initDisplayView.
private void initDisplayView(Context context, String responseId) {
try {
AdConfiguration adUnitConfiguration = new AdConfiguration();
adUnitConfiguration.setAdUnitIdentifierType(AdConfiguration.AdUnitIdentifierType.BANNER);
mDisplayView = new DisplayView(context, mDisplayViewListener, adUnitConfiguration, responseId);
} catch (AdException e) {
MoPubLog.log(MoPubLog.AdapterLogEvent.LOAD_FAILED, TAG);
mLoadListener.onAdLoadFailed(MoPubErrorCode.ADAPTER_CONFIGURATION_ERROR);
}
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class InterstitialVideoTest method whenVastAndSscOffsetPresent_UseSscOffset.
@Test
public void whenVastAndSscOffsetPresent_UseSscOffset() throws Exception {
Context context = mock(Context.class);
AdViewManager adViewManager = new AdViewManager(context, mock(AdViewManagerListener.class), mMockAdView, mMockInterstitialManager);
AdConfiguration adConfiguration = adViewManager.getAdConfiguration();
adConfiguration.setVideoSkipOffset(10000);
AbstractCreative mockCreative = mock(AbstractCreative.class);
VideoCreativeModel mockModel = mock(VideoCreativeModel.class);
when(mockModel.getSkipOffset()).thenReturn(20000L);
when(mockCreative.getCreativeModel()).thenReturn(mockModel);
WhiteBox.field(AdViewManager.class, "mCurrentCreative").set(adViewManager, mockCreative);
when(mMockAdView.getMediaOffset()).thenReturn(adViewManager.getSkipOffset());
mSpyInterstitialVideo.scheduleShowCloseBtnTask(mMockAdView);
verify(mSpyInterstitialVideo).scheduleTimer(10L * 1000);
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class PrebidWebViewInterstitialTest method loadHTMLTest.
@Test
public void loadHTMLTest() throws IOException {
mPrebidWebViewInterstitial.mCreative = mock(HTMLCreative.class);
CreativeModel mockModel = mock(CreativeModel.class);
when(mPrebidWebViewInterstitial.mCreative.getCreativeModel()).thenReturn(mockModel);
when(mockModel.getHtml()).thenReturn(ResourceUtils.convertResourceToString("ad_contains_iframe"));
when(mockModel.getAdConfiguration()).thenReturn(new AdConfiguration());
mPrebidWebViewInterstitial.loadHTML(mAdHTML, 100, 200);
assertNotNull(mPrebidWebViewInterstitial.mWebView);
assertEquals("WebViewInterstitial", mPrebidWebViewInterstitial.mWebView.mMRAIDBridgeName);
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class VideoCreativeModelTest method setup.
@Before
public void setup() {
AdConfiguration adConfiguration = mock(AdConfiguration.class);
mMockOmEventTracker = mock(OmEventTracker.class);
mMockTrackingManager = mock(TrackingManager.class);
mVideoCreativeModel = new VideoCreativeModel(mMockTrackingManager, mMockOmEventTracker, adConfiguration);
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class VideoCreativeTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
mContext = Robolectric.buildActivity(Activity.class).create().get();
AdConfiguration mockConfig = mock(AdConfiguration.class);
when(mMockModel.getAdConfiguration()).thenReturn(mockConfig);
mVideoCreative = new VideoCreative(mContext, mMockModel, mMockOmAdSessionManager, mMockInterstitialManager);
mVideoCreative.mVideoCreativeView = mMockVideoCreativeView;
}
Aggregations