Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOBILE-7057: Remove OX OXB prefixes #14

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@

package org.prebid.mobile.renderingtestapp.uiAutomator.pages.bidding.gam;

import org.prebid.mobile.renderingtestapp.uiAutomator.pages.AdBasePage;
import org.prebid.mobile.renderingtestapp.uiAutomator.utils.WebViewLocator;

import java.util.concurrent.TimeUnit;

import androidx.test.espresso.web.webdriver.Locator;
import androidx.test.uiautomator.By;
import androidx.test.uiautomator.BySelector;
import androidx.test.uiautomator.UiDevice;
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;

import org.prebid.mobile.renderingtestapp.uiAutomator.pages.AdBasePage;
import org.prebid.mobile.renderingtestapp.uiAutomator.utils.WebViewLocator;

import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertTrue;

public class GamInterstitialPage extends AdBasePage<GamInterstitialPage> {
private static final int GAM_TIMEOUT = 9 * 1000;
public static final int VIDEO_DURATION_TIMEOUT = (int) TimeUnit.SECONDS.toMillis(20);

private static class Locators {
static BySelector oxbVideoCreative = By.res(TAG, "exo_content_frame");
static BySelector prebidVideoCreative = By.res(TAG, "exo_content_frame");
static WebViewLocator gamVideoCreative = new WebViewLocator(Locator.ID, "adContainer");

static BySelector prebidHtmlCreative = getWebViewSelectorVersionDepends("www.openx");
Expand All @@ -58,13 +58,13 @@ public GamInterstitialPage gamOrPrebidHtmlCreativeShouldBePresent() {
public GamInterstitialPage gamOrPrebidVideoCreativeShouldBePresent() {

boolean isCreativePresent = getGamVideoCreative() != null
|| getUiObject(Locators.oxbVideoCreative) != null;
|| getUiObject(Locators.prebidVideoCreative) != null;
assertTrue("Interstitial is not displayed", isCreativePresent);
return this;
}

/**
* Click is performed on top right corner after video duration delay in order to work with GAM and OXB end cards.
* Click is performed on top right corner after video duration delay in order to work with GAM and prebid end cards.
*/
public GamInterstitialPage closeEndCard() throws InterruptedException {
synchronized (device) {
Expand All @@ -85,15 +85,6 @@ public GamInterstitialPage closeInterstitial() {
return super.closeInterstitial();
}

public GamInterstitialPage clickInterstitial() {
final UiObject2 oxbCreative = getUiObject(Locators.prebidHtmlCreative);
BySelector creativeSelector = oxbCreative != null
? Locators.prebidHtmlCreative
: Locators.gamHtmlCreative;
clickOnView(creativeSelector, TIMEOUT * 2);
return this;
}

@Override
public GamInterstitialPage goBackOnce() {
synchronized (device) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ abstract class BaseBidInterstitialFragment : AdFragment(), InterstitialAdUnitLis
btnLoad?.isEnabled = true
}

override fun onAdDisplayed(oxbInterstitialAdUnit: InterstitialAdUnit?) {
Log.d(TAG, "onAdDisplayed() called with: oxbInterstitialAdUnit = [$oxbInterstitialAdUnit]")
override fun onAdDisplayed(interstitialAdUnit: InterstitialAdUnit?) {
Log.d(TAG, "onAdDisplayed() called with: interstitialAdUnit = [$interstitialAdUnit]")
btnAdDisplayed?.isEnabled = true
}

Expand All @@ -87,8 +87,8 @@ abstract class BaseBidInterstitialFragment : AdFragment(), InterstitialAdUnitLis
btnAdClicked?.isEnabled = true
}

override fun onAdLoaded(oxbInterstitialAdUnit: InterstitialAdUnit?) {
Log.d(TAG, "onAdLoaded() called with: oxbInterstitialAdUnit = [$oxbInterstitialAdUnit]")
override fun onAdLoaded(interstitialAdUnit: InterstitialAdUnit?) {
Log.d(TAG, "onAdLoaded() called with: interstitialAdUnit = [$interstitialAdUnit]")
btnAdLoaded?.isEnabled = true
btnLoad?.setText(R.string.text_show)
btnLoad?.isEnabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ open class GamBannerFragment : AdFragment(), BannerViewListener {
bannerView = initBanner(
configId,
eventHandler)
bannerView?.addAdditionalSizes(*getAdditionalOxbBannerSizeArray())
bannerView?.addAdditionalSizes(*getAdditionalPrebidBannerSizeArray())
bannerView?.setAutoRefreshDelay(refreshDelay)
bannerView?.setBannerListener(this)
viewContainer.addView(bannerView)
Expand Down Expand Up @@ -108,5 +108,5 @@ open class GamBannerFragment : AdFragment(), BannerViewListener {

protected open fun getGamAdSizeArray(initialSize: AdSize) = arrayOf(initialSize)

protected open fun getAdditionalOxbBannerSizeArray() = emptyArray<AdSize>()
protected open fun getAdditionalPrebidBannerSizeArray() = emptyArray<AdSize>()
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import org.prebid.mobile.rendering.bidding.data.AdSize

class GamMultisizeBannerFragment : GamBannerFragment() {

override fun getAdditionalOxbBannerSizeArray() = arrayOf(AdSize(728, 90))
override fun getAdditionalPrebidBannerSizeArray() = arrayOf(AdSize(728, 90))

override fun getGamAdSizeArray(initialSize: AdSize) =
arrayOf(initialSize, AdSize(728, 90))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ package org.prebid.mobile.renderingtestapp.plugplay.bidding.gam

import org.prebid.mobile.renderingtestapp.plugplay.bidding.base.BaseFeedFragment
import org.prebid.mobile.renderingtestapp.utils.adapters.BaseFeedAdapter
import org.prebid.mobile.renderingtestapp.utils.adapters.OXBFeedGamAdapter
import org.prebid.mobile.renderingtestapp.utils.adapters.FeedGamAdapter

class GamOustreamFeedFragment : BaseFeedFragment() {
override fun initFeedAdapter(): BaseFeedAdapter {
return OXBFeedGamAdapter(requireContext(), width, height, configId, adUnitId)
return FeedGamAdapter(requireContext(), width, height, configId, adUnitId)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PpmBannerInLayoutFragment : PpmBannerFragment() {
override val layoutRes = R.layout.fragment_bidding_banner_in_layout

override fun initAd(): Any? {
bannerView = oxBannerView
bannerView = prebidBannerView
bannerView?.setBannerListener(this)
return bannerView
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ package org.prebid.mobile.renderingtestapp.plugplay.bidding.ppm
import org.prebid.mobile.renderingtestapp.plugplay.bidding.base.BaseFeedFragment
import org.prebid.mobile.renderingtestapp.plugplay.config.AdConfiguratorDialogFragment
import org.prebid.mobile.renderingtestapp.utils.adapters.BaseFeedAdapter
import org.prebid.mobile.renderingtestapp.utils.adapters.OXBFeedAdapter
import org.prebid.mobile.renderingtestapp.utils.adapters.FeedAdapter

class PpmFeedVideoFragment : BaseFeedFragment() {

override fun initFeedAdapter(): BaseFeedAdapter {
return OXBFeedAdapter(requireContext(), width, height, configId)
return FeedAdapter(requireContext(), width, height, configId)
}

override fun configuratorMode(): AdConfiguratorDialogFragment.AdConfiguratorMode? = AdConfiguratorDialogFragment.AdConfiguratorMode.BANNER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package org.prebid.mobile.renderingtestapp.plugplay.utilities.consent
import android.content.SharedPreferences
import android.util.Log
import com.google.gson.Gson
import org.prebid.mobile.rendering.utils.logger.OXLog
import org.prebid.mobile.rendering.utils.logger.LogUtil
import org.prebid.mobile.renderingtestapp.data.ConsentConfiguration
import java.util.concurrent.Executors
import java.util.concurrent.ScheduledFuture
Expand Down Expand Up @@ -67,7 +67,7 @@ class ConsentUpdateManager(private val defaultSharedPreferences: SharedPreferenc

private fun startTimer(updateIntervalSec: Long?, updateOptionsList: List<Map<String, Any?>>?) {
if (updateIntervalSec == null || updateOptionsList == null) {
OXLog.error(TAG, "startTimer(): Failed. Provided update internal or updateOptionsList is null.")
LogUtil.error(TAG, "startTimer(): Failed. Provided update internal or updateOptionsList is null.")
return
}

Expand Down Expand Up @@ -105,7 +105,7 @@ class ConsentUpdateManager(private val defaultSharedPreferences: SharedPreferenc

private fun updateConsentPreferences(updateOptionsMap: Map<String, Any?>?) {
if (updateOptionsMap == null) {
OXLog.error(TAG, "updateConsentPreferences(): Failed. Provided options map is null")
LogUtil.error(TAG, "updateConsentPreferences(): Failed. Provided options map is null")
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object OpenRtbConfigs {
Targeting.setUserId(openRtbExtra.userId)
}
if (openRtbExtra.gender != null) {
Targeting.setUserGender(UserParameters.OXMGender.valueOf(openRtbExtra.gender))
Targeting.setUserGender(UserParameters.Gender.valueOf(openRtbExtra.gender))
}
if (openRtbExtra.buyerId != null) {
Targeting.setBuyerUid(openRtbExtra.buyerId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import org.prebid.mobile.rendering.bidding.parallel.BannerView

private const val TAG = "FeedAdapter"

open class OXBFeedAdapter(context: Context,
val width: Int,
val height: Int,
val configId: String) : BaseFeedAdapter(context) {
open class FeedAdapter(context: Context,
val width: Int,
val height: Int,
val configId: String) : BaseFeedAdapter(context) {

protected var videoView: BannerView? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import org.prebid.mobile.rendering.bidding.enums.VideoPlacementType
import org.prebid.mobile.rendering.bidding.parallel.BannerView
import org.prebid.mobile.renderingtestapp.utils.OpenRtbConfigs

class OXBFeedGamAdapter(context: Context,
width: Int,
height: Int,
configId: String,
val adUnitId: String) : OXBFeedAdapter(context, width, height, configId) {
class FeedGamAdapter(context: Context,
width: Int,
height: Int,
configId: String,
val adUnitId: String) : FeedAdapter(context, width, height, configId) {

override fun initAndLoadAdView(parent: ViewGroup?, container: FrameLayout): View? {
val eventHandler = GamBannerEventHandler(container.context, adUnitId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
app:layout_constraintTop_toTopOf="parent">

<org.prebid.mobile.rendering.bidding.parallel.BannerView
android:id="@+id/oxBannerView"
android:id="@+id/prebidBannerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:configId="@string/mock_config_id_banner_320x50"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
import android.os.Looper;
import android.view.View;

import androidx.annotation.NonNull;

import org.prebid.mobile.eventhandlers.global.Constants;
import org.prebid.mobile.rendering.bidding.data.AdSize;
import org.prebid.mobile.rendering.bidding.data.bid.Bid;
import org.prebid.mobile.rendering.bidding.interfaces.BannerEventHandler;
import org.prebid.mobile.rendering.bidding.listeners.BannerEventListener;
import org.prebid.mobile.rendering.errors.AdException;
import org.prebid.mobile.rendering.utils.logger.OXLog;
import org.prebid.mobile.rendering.utils.logger.LogUtil;

import androidx.annotation.NonNull;

/**
* This class is compatible with Prebid Rendering SDK v1.10.
Expand All @@ -50,7 +50,7 @@ public class GamBannerEventHandler implements BannerEventHandler, GamAdEventList
private final String mGamAdUnitId;

private PublisherAdViewWrapper mRequestBanner;
private PublisherAdViewWrapper mOxbProxyBanner;
private PublisherAdViewWrapper mProxyBanner;
private PublisherAdViewWrapper mEmbeddedBanner;
private PublisherAdViewWrapper mRecycledBanner;

Expand Down Expand Up @@ -106,7 +106,7 @@ public void onEvent(AdEvent adEvent) {
}
//endregion ==================== GAM AppEventsListener Implementation

//region ==================== OX EventHandler Implementation
//region ==================== EventHandler Implementation
@Override
public AdSize[] getAdSizeArray() {
if (mAdSizes == null) {
Expand All @@ -129,7 +129,7 @@ public void requestAdWithBid(Bid bid) {
mIsExpectingAppEvent = false;

if (mRequestBanner != null) {
OXLog.error(TAG, "requestAdWithBid: Failed. Request to primaryAdServer is in progress.");
LogUtil.error(TAG, "requestAdWithBid: Failed. Request to primaryAdServer is in progress.");
return;
}

Expand All @@ -156,8 +156,8 @@ public void requestAdWithBid(Bid bid) {

@Override
public void trackImpression() {
if (mOxbProxyBanner != null) {
mOxbProxyBanner.recordManualImpression();
if (mProxyBanner != null) {
mProxyBanner.recordManualImpression();
}
}

Expand All @@ -166,7 +166,7 @@ public void destroy() {
cancelTimer();
destroyGamViews();
}
//endregion ==================== OX EventHandler Implementation
//endregion ==================== EventHandler Implementation

private PublisherAdViewWrapper createPublisherAdView() {
return PublisherAdViewWrapper.newInstance(mApplicationContext, mGamAdUnitId, this, mAdSizes);
Expand All @@ -175,7 +175,7 @@ private PublisherAdViewWrapper createPublisherAdView() {
private void primaryAdReceived() {
if (mIsExpectingAppEvent) {
if (mAppEventHandler != null) {
OXLog.debug(TAG, "primaryAdReceived: AppEventTimer is not null. Skipping timer scheduling.");
LogUtil.debug(TAG, "primaryAdReceived: AppEventTimer is not null. Skipping timer scheduling.");
return;
}

Expand All @@ -193,7 +193,7 @@ else if (mRequestBanner != null) {

private void handleAppEvent() {
if (!mIsExpectingAppEvent) {
OXLog.debug(TAG, "appEventDetected: Skipping event handling. App event is not expected");
LogUtil.debug(TAG, "appEventDetected: Skipping event handling. App event is not expected");
return;
}

Expand All @@ -202,8 +202,8 @@ private void handleAppEvent() {
mRequestBanner = null;
mIsExpectingAppEvent = false;
recycleCurrentBanner();
mOxbProxyBanner = gamBannerView;
mBannerEventListener.onOXBSdkWin();
mProxyBanner = gamBannerView;
mBannerEventListener.onPrebidSdkWin();
}

private void scheduleTimer() {
Expand Down Expand Up @@ -261,9 +261,9 @@ private void recycleCurrentBanner() {
mRecycledBanner = mEmbeddedBanner;
mEmbeddedBanner = null;
}
else if (mOxbProxyBanner != null) {
mRecycledBanner = mOxbProxyBanner;
mOxbProxyBanner = null;
else if (mProxyBanner != null) {
mRecycledBanner = mProxyBanner;
mProxyBanner = null;
mRecycledBanner.setManualImpressionsEnabled(false);
}
}
Expand All @@ -272,8 +272,8 @@ private void destroyGamViews() {
if (mRequestBanner != null) {
mRequestBanner.destroy();
}
if (mOxbProxyBanner != null) {
mOxbProxyBanner.destroy();
if (mProxyBanner != null) {
mProxyBanner.destroy();
}
if (mEmbeddedBanner != null) {
mEmbeddedBanner.destroy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.prebid.mobile.rendering.bidding.interfaces.InterstitialEventHandler;
import org.prebid.mobile.rendering.bidding.listeners.InterstitialEventListener;
import org.prebid.mobile.rendering.errors.AdException;
import org.prebid.mobile.rendering.utils.logger.OXLog;
import org.prebid.mobile.rendering.utils.logger.LogUtil;

import java.lang.ref.WeakReference;

Expand Down Expand Up @@ -76,7 +76,7 @@ public void onEvent(AdEvent adEvent) {
}
//endregion ==================== GAM AppEventsListener Implementation

//region ==================== OX EventHandler Implementation
//region ==================== EventHandler Implementation
@Override
public void show() {
if (mRequestInterstitial != null && mRequestInterstitial.isLoaded()) {
Expand Down Expand Up @@ -123,7 +123,7 @@ public void trackImpression() {
public void destroy() {
cancelTimer();
}
//endregion ==================== OX EventHandler Implementation
//endregion ==================== EventHandler Implementation

private void initPublisherInterstitialAd() {
if (mRequestInterstitial != null) {
Expand All @@ -136,7 +136,7 @@ private void initPublisherInterstitialAd() {
private void primaryAdReceived() {
if (mIsExpectingAppEvent) {
if (mAppEventHandler != null) {
OXLog.debug(TAG, "primaryAdReceived: AppEventTimer is not null. Skipping timer scheduling.");
LogUtil.debug(TAG, "primaryAdReceived: AppEventTimer is not null. Skipping timer scheduling.");
return;
}

Expand All @@ -149,14 +149,14 @@ else if (!mDidNotifiedBidWin) {

private void handleAppEvent() {
if (!mIsExpectingAppEvent) {
OXLog.debug(TAG, "appEventDetected: Skipping event handling. App event is not expected");
LogUtil.debug(TAG, "appEventDetected: Skipping event handling. App event is not expected");
return;
}

cancelTimer();
mIsExpectingAppEvent = false;
mDidNotifiedBidWin = true;
mInterstitialEventListener.onOXBSdkWin();
mInterstitialEventListener.onPrebidSdkWin();
}

private void scheduleTimer() {
Expand Down
Loading