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

UOE-7370: Call is not going to yahoo SSP in case of client side video #334

Open
wants to merge 7 commits into
base: nightly5.x
Choose a base branch
from
Open
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
22 changes: 22 additions & 0 deletions src_new/adapters/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,8 @@ function setPrebidConfig(){
refThis.assignCurrencyConfigIfRequired(prebidConfig);
refThis.assignSchainConfigIfRequired(prebidConfig);
refThis.assignSingleRequestConfigForBidders(prebidConfig);
// Check for yahoossp bidder and add property {mode: 'all'} to setConfig
refThis.checkForYahooSSPBidder(prebidConfig);
// Adding a hook for publishers to modify the Prebid Config we have generated
util.handleHook(CONSTANTS.HOOKS.PREBID_SET_CONFIG, [ prebidConfig ]);
//todo: stop supporting this hook let pubs use pbjs.requestBids hook
Expand Down Expand Up @@ -975,6 +977,26 @@ function getFloorsConfiguration(prebidConfig){

exports.getFloorsConfiguration = getFloorsConfiguration;

function checkForYahooSSPBidder(prebidConfig){
var isYahooAlias = false;
var isYahooSSP = CONF.adapters.hasOwnProperty(CONSTANTS.YAHOOSSP);

if(!isYahooSSP) {
for(var bidder in CONF.alias) {
if(CONFIG.getAdapterNameForAlias(bidder) == CONSTANTS.YAHOOSSP) {
isYahooAlias = true;
}
}
}
if(isYahooSSP || isYahooAlias) {
prebidConfig[CONSTANTS.YAHOOSSP]={
mode: "all"
}
}
}

exports.checkForYahooSSPBidder = checkForYahooSSPBidder;

function getPbjsAdServerTargetingConfig(){
// Todo: Handle send-all bids feature enabled case
// we will need to add bidder specific keys?? do we?
Expand Down
2 changes: 2 additions & 0 deletions src_new/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,5 @@ exports.BID_STATUS = {
}
// Add list of PubMatic aliases here.
exports.PUBMATIC_ALIASES = ["pubmatic2"];

exports.YAHOOSSP = "yahoossp";
44 changes: 44 additions & 0 deletions test/adapters/prebid.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,50 @@ describe('ADAPTER: Prebid', function() {
})
});

// Test cases for yahoo ssp setconfig property
describe("set config for YahooSSP Bidder",function(){
var prebidConfig = {};
var expectedResult = {
mode: "all"
};
beforeEach(function(done){
CONF.alias = {
"yahoossp-alias": "yahoossp"
};
CONF.adapters["yahoossp-alias"] = {
kgp: "_AU_@_W_x_H_",
rev_share: "0.0",
throttle: "100",
display: 0,
klm: {
"/43743431/DMDemo@728x90": {
pos: "placement1",
dcn: "site1"
}
}
};
done();
});

afterEach(function(done){
delete CONF.alias["yahoossp-alias"];
delete CONF.adapters["yahoossp-alias"];
prebidConfig = {};
done();
});

it("should be a function",function(done){
PREBID.checkForYahooSSPBidder.should.be.a("function");
done();
});

it("should set mode property to all when we have yahoossp bidder or alias",function(done){
PREBID.checkForYahooSSPBidder(prebidConfig);
expect(prebidConfig.yahoossp).to.be.deep.equal(expectedResult);
done();
});
});

// Test cases only for floor module
describe("#setPrebidConfig", function(){
var floorObj = {};
Expand Down