mk9-prebid
Version:
Header Bidding Management Library
1,591 lines (1,555 loc) • 112 kB
JavaScript
import { expect } from 'chai';
import { spec, getWidthAndHeightFromVideoObject, playerSizeIsNestedArray, defaultSize } from 'modules/ozoneBidAdapter.js';
import { config } from 'src/config.js';
import {Renderer} from '../../../src/Renderer.js';
import {getGranularityKeyName, getGranularityObject} from '../../../modules/ozoneBidAdapter.js';
import * as utils from '../../../src/utils.js';
const OZONEURI = 'https://elb.the-ozone-project.com/openrtb2/auction';
const BIDDER_CODE = 'ozone';
/*
NOTE - use firefox console to deep copy the objects to use here
*/
var originalPropertyBag = {'pageId': null};
var validBidRequests = [
{
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: { publisherId: '9876abcd12-3', customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}], placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { id: '2899ec066a91ff8', tagid: 'undefined', secure: 1, banner: { format: [{ w: 300, h: 250 }, { w: 300, h: 600 }], h: 250, topframe: 1, w: 300 } } ] },
sizes: [[300, 250], [300, 600]],
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
}
];
var validBidRequestsNoCustomData = [
{
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: { publisherId: '9876abcd12-3', placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { id: '2899ec066a91ff8', tagid: 'undefined', secure: 1, banner: { format: [{ w: 300, h: 250 }, { w: 300, h: 600 }], h: 250, topframe: 1, w: 300 } } ] },
sizes: [[300, 250], [300, 600]],
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
}
];
var validBidRequestsMulti = [
{
testId: 1,
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: { publisherId: '9876abcd12-3', customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}], placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { id: '2899ec066a91ff8', tagid: 'undefined', secure: 1, banner: { format: [{ w: 300, h: 250 }, { w: 300, h: 600 }], h: 250, topframe: 1, w: 300 } } ] },
sizes: [[300, 250], [300, 600]],
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
},
{
testId: 2,
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff0',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c0',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: { publisherId: '9876abcd12-3', customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}], placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { id: '2899ec066a91ff8', tagid: 'undefined', secure: 1, banner: { format: [{ w: 300, h: 250 }, { w: 300, h: 600 }], h: 250, topframe: 1, w: 300 } } ] },
sizes: [[300, 250], [300, 600]],
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
}
];
// use 'pubcid', 'tdid', 'id5id', 'parrableId', 'idl_env', 'criteoId'
// see http://prebid.org/dev-docs/modules/userId.html
var validBidRequestsWithUserIdData = [
{
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: { publisherId: '9876abcd12-3', customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}], placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { id: '2899ec066a91ff8', tagid: 'undefined', secure: 1, banner: { format: [{ w: 300, h: 250 }, { w: 300, h: 600 }], h: 250, topframe: 1, w: 300 } } ] },
sizes: [[300, 250], [300, 600]],
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87',
userId: {
'pubcid': '12345678',
'tdid': '1111tdid',
'id5id': { uid: '1111', ext: { linkType: 2, abTestingControlGroup: false } },
'criteoId': '1111criteoId',
'idl_env': 'liverampId',
'lipb': {'lipbid': 'lipbidId123'},
'parrableId': {'eid': '01.5678.parrableid'},
'sharedid': {'id': '01EAJWWNEPN3CYMM5N8M5VXY22', 'third': '01EAJWWNEPN3CYMM5N8M5VXY22'}
},
userIdAsEids: [
{
'source': 'pubcid.org',
'uids': [
{
'id': '12345678',
'atype': 1
}
]
},
{
'source': 'adserver.org',
'uids': [{
'id': '1111tdid',
'atype': 1,
'ext': {
'rtiPartner': 'TDID'
}
}]
},
{
'source': 'id5-sync.com',
'uids': [{
'id': 'ID5-someId',
'atype': 1,
}]
},
{
'source': 'criteoId',
'uids': [{
'id': '1111criteoId',
'atype': 1,
}]
},
{
'source': 'idl_env',
'uids': [{
'id': 'liverampId',
'atype': 1,
}]
},
{
'source': 'lipb',
'uids': [{
'id': {'lipbid': 'lipbidId123'},
'atype': 1,
}]
},
{
'source': 'parrableId',
'uids': [{
'id': {'eid': '01.5678.parrableid'},
'atype': 1,
}]
}
]
}
];
var validBidRequestsMinimal = [
{
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
params: { publisherId: '9876abcd12-3', placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { id: '2899ec066a91ff8', tagid: 'undefined', secure: 1, banner: { format: [{ w: 300, h: 250 }, { w: 300, h: 600 }], h: 250, topframe: 1, w: 300 } } ] },
sizes: [[300, 250], [300, 600]],
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
}
];
var validBidRequestsNoSizes = [
{
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: { publisherId: '9876abcd12-3', customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}], placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { id: '2899ec066a91ff8', tagid: 'undefined', secure: 1, banner: { format: [{ w: 300, h: 250 }, { w: 300, h: 600 }], h: 250, topframe: 1, w: 300 } } ] },
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
}
];
var validBidRequestsWithBannerMediaType = [
{
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: { publisherId: '9876abcd12-3', customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}], placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { id: '2899ec066a91ff8', tagid: 'undefined', secure: 1, banner: { format: [{ w: 300, h: 250 }, { w: 300, h: 600 }], h: 250, topframe: 1, w: 300 } } ] },
mediaTypes: {banner: {sizes: [[300, 250], [300, 600]]}},
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
}
];
var validBidRequestsWithNonBannerMediaTypesAndValidOutstreamVideo = [
{
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: { publisherId: '9876abcd12-3', customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}], placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { id: '2899ec066a91ff8', tagid: 'undefined', secure: 1, video: {skippable: true, playback_method: ['auto_play_sound_off'], targetDiv: 'some-different-div-id-to-my-adunitcode'} } ] },
mediaTypes: {video: {mimes: ['video/mp4'], 'context': 'outstream', 'sizes': [640, 480], playerSize: [640, 480]}, native: {info: 'dummy data'}},
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
}
];
var validBidRequests1OutstreamVideo2020 = [
{
'bidder': 'ozone',
'testname': 'validBidRequests1OutstreamVideo2020',
'params': {
'publisherId': 'OZONERUP0001',
'placementId': '8000000009',
'siteId': '4204204201',
'video': {
'skippable': true,
'playback_method': [
'auto_play_sound_off'
]
},
'customData': [
{
'settings': {},
'targeting': {
'sens': 'f',
'pt1': '/uk',
'pt2': 'uk',
'pt3': 'network-front',
'pt4': 'ng',
'pt5': [
'uk'
],
'pt7': 'desktop',
'pt8': [
'tfmqxwj7q',
'penl4dfdk',
'sek9ghqwi'
],
'pt9': '|k0xw2vqzp33kklb3j5w4|||'
}
}
],
'userId': {
'pubcid': '2ada6ae6-aeca-4e07-8922-a99b3aaf8a56'
},
'userIdAsEids': [
{
'source': 'pubcid.org',
'uids': [
{
'id': '2ada6ae6-aeca-4e07-8922-a99b3aaf8a56',
'atype': 1
}
]
}
]
},
'mediaTypes': {
'video': {
'playerSize': [
[
640,
480
]
],
'mimes': [
'video/mp4'
],
'context': 'outstream'
}
},
'adUnitCode': 'video-ad',
'transactionId': '02c1ea7d-0bf2-451b-a122-1420040d1cf8',
'sizes': [
[
640,
480
]
],
'bidId': '2899ec066a91ff8',
'bidderRequestId': '1c1586b27a1b5c8',
'auctionId': '0456c9b7-5ab2-4fec-9e10-f418d3d1f04c',
'src': 'client',
'bidRequestsCount': 1,
'bidderRequestsCount': 1,
'bidderWinsCount': 0
}
];
// WHEN sent as bidderRequest to buildRequests you should send the child: .bidderRequest
var validBidderRequest1OutstreamVideo2020 = {
bidderRequest: {
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
auctionStart: 1536838908986,
bidderCode: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
bids: [
{
'bidder': 'ozone',
'params': {
'publisherId': 'OZONERUP0001',
'placementId': '8000000009',
'siteId': '4204204201',
'video': {
'skippable': true,
'playback_method': [
'auto_play_sound_off'
]
},
'customData': [
{
'settings': {},
'targeting': {
'sens': 'f',
'pt1': '/uk',
'pt2': 'uk',
'pt3': 'network-front',
'pt4': 'ng',
'pt5': [
'uk'
],
'pt7': 'desktop',
'pt8': [
'tfmqxwj7q',
'penl4dfdk',
'uayf5jmv3',
'sek9ghqwi'
],
'pt9': '|k0xw2vqzp33kklb3j5w4|||'
}
}
]
},
'userId': {
'id5id': { uid: '1111', ext: { linkType: 2, abTestingControlGroup: false } },
'pubcid': '2ada6ae6-aeca-4e07-8922-a99b3aaf8a56'
},
'userIdAsEids': [
{
'source': 'id5-sync.com',
'uids': [
{
'id': 'ID5-ZHMOpSv9CkZNiNd1oR4zc62AzCgSS73fPjmQ6Od7OA',
'atype': 1
}
]
},
{
'source': 'pubcid.org',
'uids': [
{
'id': '2ada6ae6-aeca-4e07-8922-a99b3aaf8a56',
'atype': 1
}
]
}
],
'mediaTypes': {
'video': {
'playerSize': [
[
640,
480
]
],
'mimes': [
'video/mp4'
],
'context': 'outstream'
}
},
'adUnitCode': 'video-ad',
'transactionId': 'ec20cc65-de38-4410-b5b3-50de5b7df66a',
'sizes': [
[
640,
480
]
],
'bidId': '2899ec066a91ff8',
'bidderRequestId': '1c1586b27a1b5c8',
'auctionId': '0456c9b7-5ab2-4fec-9e10-f418d3d1f04c',
'src': 'client',
'bidRequestsCount': 1,
'bidderRequestsCount': 1,
'bidderWinsCount': 0
}],
doneCbCallCount: 1,
start: 1536838908987,
timeout: 3000
}
};
// WHEN sent as bidderRequest to buildRequests you should send the child: .bidderRequest
var validBidderRequest = {
bidderRequest: {
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
auctionStart: 1536838908986,
bidderCode: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
bids: [{
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: { publisherId: '9876abcd12-3', customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}], placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { banner: { topframe: 1, w: 300, h: 250, format: [{ w: 300, h: 250 }, { w: 300, h: 600 }] }, id: '2899ec066a91ff8', secure: 1, tagid: 'undefined' } ] },
sizes: [[300, 250], [300, 600]],
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
}],
doneCbCallCount: 1,
start: 1536838908987,
timeout: 3000
}
};
// bidder request with GDPR - change the values for testing:
// gdprConsent.gdprApplies (true/false)
// gdprConsent.vendorData.purposeConsents (make empty, make null, remove it)
// gdprConsent.vendorData.vendorConsents (remove 524, remove all, make the element null, remove it)
// WHEN sent as bidderRequest to buildRequests you should send the child: .bidderRequest
var bidderRequestWithFullGdpr = {
bidderRequest: {
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
auctionStart: 1536838908986,
bidderCode: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
bids: [{
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: { publisherId: '9876abcd12-3', customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}], placementId: '1310000099', siteId: '1234567890', id: 'fea37168-78f1-4a23-a40e-88437a99377e', auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99', imp: [ { banner: { topframe: 1, w: 300, h: 250, format: [{ w: 300, h: 250 }, { w: 300, h: 600 }] }, id: '2899ec066a91ff8', secure: 1, tagid: 'undefined' } ] },
sizes: [[300, 250], [300, 600]],
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
}],
doneCbCallCount: 1,
start: 1536838908987,
timeout: 3000,
gdprConsent: {
'consentString': 'BOh7mtYOh7mtYAcABBENCU-AAAAncgPIXJiiAoao0PxBFkgCAC8ACIAAQAQQAAIAAAIAAAhBGAAAQAQAEQgAAAAAAABAAAAAAAAAAAAAAACAAAAAAAACgAAAAABAAAAQAAAAAAA',
'vendorData': {
'metadata': 'BOh7mtYOh7mtYAcABBENCU-AAAAncgPIXJiiAoao0PxBFkgCAC8ACIAAQAQQAAIAAAIAAAhBGAAAQAQAEQgAAAAAAABAAAAAAAAAAAAAAACAAAAAAAACgAAAAABAAAAQAAAAAAA',
'gdprApplies': true,
'hasGlobalScope': false,
'cookieVersion': '1',
'created': '2019-05-31T12:46:48.825',
'lastUpdated': '2019-05-31T12:46:48.825',
'cmpId': '28',
'cmpVersion': '1',
'consentLanguage': 'en',
'consentScreen': '1',
'vendorListVersion': 148,
'maxVendorId': 631,
'purposeConsents': {
'1': true,
'2': true,
'3': true,
'4': true,
'5': true
},
'vendorConsents': {
'468': true,
'522': true,
'524': true, /* 524 is ozone */
'565': true,
'591': true
}
},
'gdprApplies': true
}, }
};
var gdpr1 = {
'consentString': 'BOh7mtYOh7mtYAcABBENCU-AAAAncgPIXJiiAoao0PxBFkgCAC8ACIAAQAQQAAIAAAIAAAhBGAAAQAQAEQgAAAAAAABAAAAAAAAAAAAAAACAAAAAAAACgAAAAABAAAAQAAAAAAA',
'vendorData': {
'metadata': 'BOh7mtYOh7mtYAcABBENCU-AAAAncgPIXJiiAoao0PxBFkgCAC8ACIAAQAQQAAIAAAIAAAhBGAAAQAQAEQgAAAAAAABAAAAAAAAAAAAAAACAAAAAAAACgAAAAABAAAAQAAAAAAA',
'gdprApplies': true,
'hasGlobalScope': false,
'cookieVersion': '1',
'created': '2019-05-31T12:46:48.825',
'lastUpdated': '2019-05-31T12:46:48.825',
'cmpId': '28',
'cmpVersion': '1',
'consentLanguage': 'en',
'consentScreen': '1',
'vendorListVersion': 148,
'maxVendorId': 631,
'purposeConsents': {
'1': true,
'2': true,
'3': true,
'4': true,
'5': true
},
'vendorConsents': {
'468': true,
'522': true,
'524': true, /* 524 is ozone */
'565': true,
'591': true
}
},
'gdprApplies': true
};
// simulating the Mirror
var bidderRequestWithPartialGdpr = {
bidderRequest: {
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
auctionStart: 1536838908986,
bidderCode: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
bids: [{
adUnitCode: 'div-gpt-ad-1460505748561-0',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
bidId: '2899ec066a91ff8',
bidRequestsCount: 1,
bidder: 'ozone',
bidderRequestId: '1c1586b27a1b5c8',
crumbs: {pubcid: '203a0692-f728-4856-87f6-9a25a6b63715'},
params: {
publisherId: '9876abcd12-3',
customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}],
placementId: '1310000099',
siteId: '1234567890',
id: 'fea37168-78f1-4a23-a40e-88437a99377e',
auctionId: '27dcb421-95c6-4024-a624-3c03816c5f99',
imp: [{
banner: {topframe: 1, w: 300, h: 250, format: [{w: 300, h: 250}, {w: 300, h: 600}]},
id: '2899ec066a91ff8',
secure: 1,
tagid: 'undefined'
}]
},
sizes: [[300, 250], [300, 600]],
transactionId: '2e63c0ed-b10c-4008-aed5-84582cecfe87'
}],
doneCbCallCount: 1,
start: 1536838908987,
timeout: 3000,
gdprConsent: {
'consentString': 'BOh7mtYOh7mtYAcABBENCU-AAAAncgPIXJiiAoao0PxBFkgCAC8ACIAAQAQQAAIAAAIAAAhBGAAAQAQAEQgAAAAAAABAAAAAAAAAAAAAAACAAAAAAAACgAAAAABAAAAQAAAAAAA',
'gdprApplies': true,
'vendorData': {
'metadata': 'BOh7mtYOh7mtYAcABBENCU-AAAAncgPIXJiiAoao0PxBFkgCAC8ACIAAQAQQAAIAAAIAAAhBGAAAQAQAEQgAAAAAAABAAAAAAAAAAAAAAACAAAAAAAACgAAAAABAAAAQAAAAAAA',
'gdprApplies': true
}
}
}
};
// make sure the impid matches the request bidId
var validResponse = {
'body': {
'id': 'd6198807-7a53-4141-b2db-d2cb754d68ba',
'seatbid': [
{
'bid': [
{
'id': '677903815252395017',
'impid': '2899ec066a91ff8',
'price': 0.5,
'adm': '<script src="https://fra1-ib.adnxs.com/ab?e=wqT_3QLXB6DXAwAAAwDWAAUBCNDh6dwFENjt4vTs9Y6bWhjxtI3siuOTmREqNgkAAAECCOA_EQEHNAAA4D8ZAAAAgOtR4D8hERIAKREJADERG6gwsqKiBjjtSEDtSEgCUI3J-y5YnPFbYABotc95eMuOBYABAYoBA1VTRJIBAQbwUpgBrAKgAdgEqAEBsAEAuAECwAEDyAEC0AEA2AEA4AEA8AEAigI7dWYoJ2EnLCAyNTI5ODg1LCAxNTM2ODQ4MDgwKTt1ZigncicsIDk4NDkzNTgxNh4A8JySAv0BIWJ6YWpPQWl1c0s0S0VJM0oteTRZQUNDYzhWc3dBRGdBUUFSSTdVaFFzcUtpQmxnQVlQX19fXzhQYUFCd0FYZ0JnQUVCaUFFQmtBRUJtQUVCb0FFQnFBRURzQUVBdVFFcGk0aURBQURnUDhFQktZdUlnd0FBNERfSkFUMDR0TTFxYXZFXzJRRUFBQUFBQUFEd1AtQUJBUFVCBQ8oSmdDQUtBQ0FMVUMFEARMMAkI8FBNQUNBY2dDQWRBQ0FkZ0NBZUFDQU9nQ0FQZ0NBSUFEQVpBREFKZ0RBYWdEcnJDdUNyb0RDVVpTUVRFNk16WTROT0FER2cuLpoCPSFLQXVvRkE2AAFwblBGYklBUW9BRG9KUmxKQk1Ub3pOamcwUUJwSkENAfBAOEQ4LsICL2h0dHA6Ly9wcmViaWQub3JnL2Rldi1kb2NzL2dldHRpbmctc3RhcnRlZC5odG1s2AIA4AKtmEjqAiINOthkZW1vLnRoZS1vem9uZS1wcm9qZWN0LmNvbS_yAhMKD0NVU1RPTV9NT0RFTF9JRBIA8gIaChZDLhYAIExFQUZfTkFNRQEdCB4KGjIzAPCHTEFTVF9NT0RJRklFRBIAgAMAiAMBkAMAmAMUoAMBqgMAwAOsAsgDANgDAOADAOgDAPgDA4AEAJIECS9vcGVucnRiMpgEAKIECTEyNy4wLjAuMagEALIEDAgAEAAYACAAMAA4ALgEAMAEAMgEANIEDjkzMjUjRlJBMTozNjg02gQCCAHgBADwBEHvIIgFAZgFAKAF_xEBsAGqBSRkNjE5ODgwNy03YTUzLTQxNDEtYjJkYi1kMmNiNzU0ZDY4YmHABQDJBWlQFPA_0gUJCQkMpAAA2AUB4AUB8AWZ9CH6BQQIABAAkAYAmAYAuAYAwQYAAAAAAAAAAMgGAA..&s=ab84b182eef7d9b4e58c74fe8987705c25ed803c&referrer=http%3A%2F%2Fdemo.the-ozone-project.com%2F&pp=${AUCTION_PRICE}"></script>',
'adid': '98493581',
'adomain': [
'http://prebid.org'
],
'iurl': 'https://fra1-ib.adnxs.com/cr?id=98493581',
'cid': '9325',
'crid': '98493581',
'cat': [
'IAB3-1'
],
'w': 300,
'h': 600,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'appnexus': {
'brand_id': 555545,
'auction_id': 6500448734132353000,
'bidder_id': 2,
'bid_ad_type': 0
}
}
}
}
],
'seat': 'appnexus'
}
],
'cur': 'GBP', /* NOTE - this is where cur is, not in the seatbids. */
'ext': {
'responsetimemillis': {
'appnexus': 47,
'openx': 30
}
},
'timing': {
'start': 1536848078.089177,
'end': 1536848078.142203,
'TimeTaken': 0.05302619934082031
}
},
'headers': {}
};
var validResponse2Bids = {
'body': {
'id': 'd6198807-7a53-4141-b2db-d2cb754d68ba',
'seatbid': [
{
'bid': [
{
'id': '677903815252395017',
'impid': '2899ec066a91ff8',
'price': 0.5,
'adm': '<script src="https://fra1-ib.adnxs.com/ab?e=wqT_3QLXB6DXAwAAAwDWAAUBCNDh6dwFENjt4vTs9Y6bWhjxtI3siuOTmREqNgkAAAECCOA_EQEHNAAA4D8ZAAAAgOtR4D8hERIAKREJADERG6gwsqKiBjjtSEDtSEgCUI3J-y5YnPFbYABotc95eMuOBYABAYoBA1VTRJIBAQbwUpgBrAKgAdgEqAEBsAEAuAECwAEDyAEC0AEA2AEA4AEA8AEAigI7dWYoJ2EnLCAyNTI5ODg1LCAxNTM2ODQ4MDgwKTt1ZigncicsIDk4NDkzNTgxNh4A8JySAv0BIWJ6YWpPQWl1c0s0S0VJM0oteTRZQUNDYzhWc3dBRGdBUUFSSTdVaFFzcUtpQmxnQVlQX19fXzhQYUFCd0FYZ0JnQUVCaUFFQmtBRUJtQUVCb0FFQnFBRURzQUVBdVFFcGk0aURBQURnUDhFQktZdUlnd0FBNERfSkFUMDR0TTFxYXZFXzJRRUFBQUFBQUFEd1AtQUJBUFVCBQ8oSmdDQUtBQ0FMVUMFEARMMAkI8FBNQUNBY2dDQWRBQ0FkZ0NBZUFDQU9nQ0FQZ0NBSUFEQVpBREFKZ0RBYWdEcnJDdUNyb0RDVVpTUVRFNk16WTROT0FER2cuLpoCPSFLQXVvRkE2AAFwblBGYklBUW9BRG9KUmxKQk1Ub3pOamcwUUJwSkENAfBAOEQ4LsICL2h0dHA6Ly9wcmViaWQub3JnL2Rldi1kb2NzL2dldHRpbmctc3RhcnRlZC5odG1s2AIA4AKtmEjqAiINOthkZW1vLnRoZS1vem9uZS1wcm9qZWN0LmNvbS_yAhMKD0NVU1RPTV9NT0RFTF9JRBIA8gIaChZDLhYAIExFQUZfTkFNRQEdCB4KGjIzAPCHTEFTVF9NT0RJRklFRBIAgAMAiAMBkAMAmAMUoAMBqgMAwAOsAsgDANgDAOADAOgDAPgDA4AEAJIECS9vcGVucnRiMpgEAKIECTEyNy4wLjAuMagEALIEDAgAEAAYACAAMAA4ALgEAMAEAMgEANIEDjkzMjUjRlJBMTozNjg02gQCCAHgBADwBEHvIIgFAZgFAKAF_xEBsAGqBSRkNjE5ODgwNy03YTUzLTQxNDEtYjJkYi1kMmNiNzU0ZDY4YmHABQDJBWlQFPA_0gUJCQkMpAAA2AUB4AUB8AWZ9CH6BQQIABAAkAYAmAYAuAYAwQYAAAAAAAAAAMgGAA..&s=ab84b182eef7d9b4e58c74fe8987705c25ed803c&referrer=http%3A%2F%2Fdemo.the-ozone-project.com%2F&pp=${AUCTION_PRICE}"></script>',
'adid': '98493581',
'adomain': [
'http://prebid.org'
],
'iurl': 'https://fra1-ib.adnxs.com/cr?id=98493581',
'cid': '9325',
'crid': '98493581',
'cat': [
'IAB3-1'
],
'w': 300,
'h': 600,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'appnexus': {
'brand_id': 555545,
'auction_id': 6500448734132353000,
'bidder_id': 2,
'bid_ad_type': 0
}
}
}
},
{
'id': '677903815252395010',
'impid': '2899ec066a91ff0',
'price': 0.9,
'adm': '<script src="test"></script>',
'adid': '98493580',
'adomain': [
'http://prebid.org'
],
'iurl': 'https://fra1-ib.adnxs.com/cr?id=98493581',
'cid': '9320',
'crid': '98493580',
'cat': [
'IAB3-1'
],
'w': 300,
'h': 600,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'appnexus': {
'brand_id': 555540,
'auction_id': 6500448734132353000,
'bidder_id': 2,
'bid_ad_type': 0
}
}
}
} ],
'seat': 'appnexus'
}
],
'cur': 'GBP', /* NOTE - this is where cur is, not in the seatbids. */
'ext': {
'responsetimemillis': {
'appnexus': 47,
'openx': 30
}
},
'timing': {
'start': 1536848078.089177,
'end': 1536848078.142203,
'TimeTaken': 0.05302619934082031
}
},
'headers': {}
};
/*
A bidder returns a bid for both sizes in an adunit
*/
var validResponse2BidsSameAdunit = {
'body': {
'id': 'd6198807-7a53-4141-b2db-d2cb754d68ba',
'seatbid': [
{
'bid': [
{
'id': '677903815252395017',
'impid': '2899ec066a91ff8',
'price': 0.5,
'adm': '<script src="src-1"></script>',
'adid': '98493581',
'adomain': [
'http://prebid.org'
],
'iurl': 'https://fra1-ib.adnxs.com/cr?id=98493581',
'cid': '9325',
'crid': '98493581',
'cat': [
'IAB3-1'
],
'w': 300,
'h': 600,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'appnexus': {
'brand_id': 555545,
'auction_id': 6500448734132353000,
'bidder_id': 2,
'bid_ad_type': 0
}
}
}
},
{
'id': '677903815252395010',
'impid': '2899ec066a91ff8',
'price': 0.9,
'adm': '<script src="src-2"></script>',
'adid': '98493580',
'adomain': [
'http://prebid.org'
],
'iurl': 'https://fra1-ib.adnxs.com/cr?id=98493581',
'cid': '9320',
'crid': '98493580',
'cat': [
'IAB3-1'
],
'w': 300,
'h': 250,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'appnexus': {
'brand_id': 555540,
'auction_id': 6500448734132353000,
'bidder_id': 2,
'bid_ad_type': 0
}
}
}
} ],
'seat': 'ozappnexus'
}
],
'cur': 'GBP', /* NOTE - this is where cur is, not in the seatbids. */
'ext': {
'responsetimemillis': {
'appnexus': 47,
'openx': 30
}
},
'timing': {
'start': 1536848078.089177,
'end': 1536848078.142203,
'TimeTaken': 0.05302619934082031
}
},
'headers': {}
};
/*
SPECIAL CONSIDERATION FOR VIDEO TESTS:
DO NOT USE _validVideoResponse directly - the interpretResponse function will modify it (adding a renderer!!!) so all
subsequent calls will already have a renderer attached!!!
*/
function getCleanValidVideoResponse() {
return JSON.parse(JSON.stringify(_validVideoResponse));
}
var _validVideoResponse = {
'body': {
'id': 'd6198807-7a53-4141-b2db-d2cb754d68ba',
'seatbid': [
{
'bid': [
{
'id': '2899ec066a91ff8',
'impid': '2899ec066a91ff8',
'price': 31.7,
'adm': '<VAST ...></VAST>',
'adomain': [
'sarr.properties'
],
'crid': 'ozone-655',
'cat': [
'IAB21'
],
'w': 640,
'h': 360,
'ext': {
'prebid': {
'type': 'video'
}
},
'adId': '2899ec066a91ff8-2',
'cpm': 31.7,
'bidId': '2899ec066a91ff8',
'requestId': '2899ec066a91ff8',
'width': 640,
'height': 360,
'ad': '<VAST ...></VAST>',
'netRevenue': true,
'creativeId': 'ozone-655',
'currency': 'USD',
'ttl': 300,
'adserverTargeting': {
'oz_ozbeeswax': 'ozbeeswax',
'oz_ozbeeswax_pb': '31.7',
'oz_ozbeeswax_crid': 'ozone-655',
'oz_ozbeeswax_adv': 'sarr.properties',
'oz_ozbeeswax_imp_id': '49d16ccc28663a8',
'oz_ozbeeswax_adId': '49d16ccc28663a8-2',
'oz_ozbeeswax_pb_r': '20.00',
'oz_ozbeeswax_omp': '1',
'oz_ozbeeswax_vid': 'outstream',
'oz_auc_id': 'efa7fea0-7e87-4811-be86-fefb38c35fbb',
'oz_winner': 'ozbeeswax',
'oz_response_id': 'efa7fea0-7e87-4811-be86-fefb38c35fbb',
'oz_winner_auc_id': '49d16ccc28663a8',
'oz_winner_imp_id': '49d16ccc28663a8',
'oz_pb_v': '2.4.0',
'hb_bidder': 'ozone',
'hb_adid': '49d16ccc28663a8-2',
'hb_pb': '20.00',
'hb_size': '640x360',
'hb_source': 'client',
'hb_format': 'banner'
},
'originalCpm': 31.7,
'originalCurrency': 'USD'
}
],
'seat': 'ozbeeswax'
}
],
'ext': {
'responsetimemillis': {
'beeswax': 9,
'openx': 43,
'ozappnexus': 31,
'ozbeeswax': 7
}
},
'timing': {
'start': 1536848078.089177,
'end': 1536848078.142203,
'TimeTaken': 0.05302619934082031
}
},
'headers': {}
};
var validBidResponse1adWith2Bidders = {
'body': {
'id': '91221f96-b931-4acc-8f05-c2a1186fa5ac',
'seatbid': [
{
'bid': [
{
'id': 'd6198807-7a53-4141-b2db-d2cb754d68ba',
'impid': '2899ec066a91ff8',
'price': 0.36754,
'adm': '<script>removed</script>',
'adid': '134928661',
'adomain': [
'somecompany.com'
],
'iurl': 'https:\/\/ams1-ib.adnxs.com\/cr?id=134928661',
'cid': '8825',
'crid': '134928661',
'cat': [
'IAB8-15',
'IAB8-16',
'IAB8-4',
'IAB8-1',
'IAB8-14',
'IAB8-6',
'IAB8-13',
'IAB8-3',
'IAB8-17',
'IAB8-12',
'IAB8-8',
'IAB8-7',
'IAB8-2',
'IAB8-9',
'IAB8',
'IAB8-11'
],
'w': 300,
'h': 250,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'appnexus': {
'brand_id': 14640,
'auction_id': 1.8369641905139e+18,
'bidder_id': 2,
'bid_ad_type': 0
}
}
}
}
],
'seat': 'appnexus'
},
{
'bid': [
{
'id': '75665207-a1ca-49db-ba0e-a5e9c7d26f32',
'impid': '37fff511779365a',
'price': 1.046,
'adm': '<div>removed</div>',
'adomain': [
'kx.com'
],
'crid': '13005',
'w': 300,
'h': 250,
'ext': {
'prebid': {
'type': 'banner'
}
}
}
],
'seat': 'openx'
}
],
'ext': {
'responsetimemillis': {
'appnexus': 91,
'openx': 109,
'ozappnexus': 46,
'ozbeeswax': 2,
'pangaea': 91
}
}
},
'headers': {}
};
/*
testing 2 ads, 2 bidders, one bidder bids for both slots in one adunit
*/
var multiRequest1 = [
{
'bidder': 'ozone',
'params': {
'publisherId': 'OZONERUP0001',
'siteId': '4204204201',
'placementId': '0420420421',
'customData': [
{
'settings': {},
'targeting': {
'sens': 'f',
'pt1': '/uk',
'pt2': 'uk',
'pt3': 'network-front',
'pt4': 'ng',
'pt5': [
'uk'
],
'pt7': 'desktop',
'pt8': [
'tfmqxwj7q',
'penl4dfdk',
'uayf5jmv3',
't8nyiude5',
'sek9ghqwi'
],
'pt9': '|k0xw2vqzp33kklb3j5w4|||'
}
}
]
},
'mediaTypes': {
'banner': {
'sizes': [
[
300,
250
],
[
300,
600
]
]
}
},
'adUnitCode': 'mpu',
'transactionId': '6480bac7-31b5-4723-9145-ad8966660651',
'sizes': [
[
300,
250
],
[
300,
600
]
],
'bidId': '2d30e86db743a8',
'bidderRequestId': '1d03a1dfc563fc',
'auctionId': '592ee33b-fb2e-4c00-b2d5-383e99cac57f',
'src': 'client',
'bidRequestsCount': 1,
'bidderRequestsCount': 1,
'bidderWinsCount': 0
},
{
'bidder': 'ozone',
'params': {
'publisherId': 'OZONERUP0001',
'siteId': '4204204201',
'placementId': '0420420421',
'customData': [
{
'settings': {},
'targeting': {
'sens': 'f',
'pt1': '/uk',
'pt2': 'uk',
'pt3': 'network-front',
'pt4': 'ng',
'pt5': [
'uk'
],
'pt7': 'desktop',
'pt8': [
'tfmqxwj7q',
'penl4dfdk',
't8nxz6qzd',
't8nyiude5',
'sek9ghqwi'
],
'pt9': '|k0xw2vqzp33kklb3j5w4|||'
}
}
]
},
'mediaTypes': {
'banner': {
'sizes': [
[
728,
90
],
[
970,
250
]
]
}
},
'adUnitCode': 'leaderboard',
'transactionId': 'a49988e6-ae7c-46c4-9598-f18db49892a0',
'sizes': [
[
728,
90
],
[
970,
250
]
],
'bidId': '3025f169863b7f8',
'bidderRequestId': '1d03a1dfc563fc',
'auctionId': '592ee33b-fb2e-4c00-b2d5-383e99cac57f',
'src': 'client',
'bidRequestsCount': 1,
'bidderRequestsCount': 1,
'bidderWinsCount': 0
}
];
// WHEN sent as bidderRequest to buildRequests you should send the child: .bidderRequest
var multiBidderRequest1 = {
bidderRequest: {
'bidderCode': 'ozone',
'auctionId': '592ee33b-fb2e-4c00-b2d5-383e99cac57f',
'bidderRequestId': '1d03a1dfc563fc',
'bids': [
{
'bidder': 'ozone',
'params': {
'publisherId': 'OZONERUP0001',
'siteId': '4204204201',
'placementId': '0420420421',
'customData': [
{
'settings': {},
'targeting': {
'sens': 'f',
'pt1': '/uk',
'pt2': 'uk',
'pt3': 'network-front',
'pt4': 'ng',
'pt5': [
'uk'
],
'pt7': 'desktop',
'pt8': [
'tfmqxwj7q',
'txeh7uyo0',
't8nxz6qzd',
't8nyiude5',
'sek9ghqwi'
],
'pt9': '|k0xw2vqzp33kklb3j5w4|||'
}
}
]
},
'mediaTypes': {
'banner': {
'sizes': [
[
300,
250
],
[
300,
600
]
]
}
},
'adUnitCode': 'mpu',
'transactionId': '6480bac7-31b5-4723-9145-ad8966660651',
'sizes': [
[
300,
250
],
[
300,
600
]
],
'bidId': '2d30e86db743a8',
'bidderRequestId': '1d03a1dfc563fc',
'auctionId': '592ee33b-fb2e-4c00-b2d5-383e99cac57f',
'src': 'client',
'bidRequestsCount': 1,
'bidderRequestsCount': 1,
'bidderWinsCount': 0
},
{
'bidder': 'ozone',
'params': {
'publisherId': 'OZONERUP0001',
'siteId': '4204204201',
'placementId': '0420420421',
'customData': [
{
'settings': {},
'targeting': {
'sens': 'f',
'pt1': '/uk',
'pt2': 'uk',
'pt3': 'network-front',
'pt4': 'ng',
'pt5': [
'uk'
],
'pt7': 'desktop',
'pt8': [
'tfmqxwj7q',
'penl4dfdk',
't8nxz6qzd',
't8nyiude5',
'sek9ghqwi'
],
'pt9': '|k0xw2vqzp33kklb3j5w4|||'
}
}
]
},
'mediaTypes': {
'banner': {
'sizes': [
[
728,
90
],
[
970,
250
]
]
}
},
'adUnitCode': 'leaderboard',
'transactionId': 'a49988e6-ae7c-46c4-9598-f18db49892a0',
'sizes': [
[
728,
90
],
[
970,
250
]
],
'bidId': '3025f169863b7f8',
'bidderRequestId': '1d03a1dfc563fc',
'auctionId': '592ee33b-fb2e-4c00-b2d5-383e99cac57f',
'src': 'client',
'bidRequestsCount': 1,
'bidderRequestsCount': 1,
'bidderWinsCount': 0
}
],
'auctionStart': 1592918645574,
'timeout': 3000,
'refererInfo': {
'referer': 'http://ozone.ardm.io/adapter/2.4.0/620x350-switch.html?guardian=true&pbjs_debug=true',
'reachedTop': true,
'numIframes': 0,
'stack': [
'http://ozone.ardm.io/adapter/2.4.0/620x350-switch.html?guardian=true&pbjs_debug=true'
]
},
'gdprConsent': {
'consentString': 'BOvy5sFO1dBa2AKAiBENDP-AAAAwVrv7_77-_9f-_f__9uj3Gr_v_f__32ccL5tv3h_7v-_7fi_-0nV4u_1tft9ydk1-5ctDztp507iakiPHmqNeb9n_mz1eZpRP58E09j53z7Ew_v8_v-b7BCPN_Y3v-8K96kA',
'vendorData': {
'metadata': 'BOvy5sFO1dBa2AKAiBENDPA',
'gdprApplies': true,
'hasGlobalConsent': false,
'hasGlobalScope': false,
'purposeConsents': {
'1': true,
'2': true,
'3': true,
'4': true,
'5': true
},
'vendorConsents': {
'1': true,
'2': true,
'3': false,
'4': true,
'5': true
}
},
'gdprApplies': true
},
'start': 1592918645578
}
};
var multiResponse1 = {
'body': {
'id': '592ee33b-fb2e-4c00-b2d5-383e99cac57f',
'seatbid': [
{
'bid': [
{
'id': '4419718600113204943',
'impid': '2d30e86db743a8',
'price': 0.2484,
'adm': '<scr .. .iv>',
'adid': '119683582',
'adomain': [
'https://ozoneproject.com'
],
'iurl': 'https://ams1-ib.adnxs.com/cr?id=119683582',
'cid': '9979',
'crid': '119683582',
'cat': [
'IAB3'
],
'w': 300,
'h': 250,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'ozone': {},
'appnexus': {
'brand_id': 734921,
'auction_id': 2995348111857539600,
'bidder_id': 2,
'bid_ad_type': 0
}
}
},
'cpm': 0.2484,
'bidId': '2d30e86db743a8',
'requestId': '2d30e86db743a8',
'width': 300,
'height': 250,
'ad': '<scr...iv>',
'netRevenue': true,
'creativeId': '119683582',
'currency': 'USD',
'ttl': 300,
'originalCpm': 0.2484,
'originalCurrency': 'USD'
},
{
'id': '18552976939844681',
'impid': '3025f169863b7f8',
'price': 0.0621,
'adm': '<sc..this ad will lose to the next one.div>',
'adid': '120179216',
'adomain': [
'appnexus.com'
],
'iurl': 'https://ams1-ib.adnxs.com/cr?id=120179216',
'cid': '9979',
'crid': '120179216',
'w': 970,
'h': 250,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'ozone': {},
'appnexus': {
'brand_id': 1,
'auction_id': 3449036134472542700,
'bidder_id': 2,
'bid_ad_type': 0
}
}
},
'cpm': 0.0621,
'bidId': '3025f169863b7f8',
'requestId': '3025f169863b7f8',
'width': 970,
'height': 250,
'ad': '<scr...iv>',
'netRevenue': true,
'creativeId': '120179216',
'currency': 'USD',
'ttl': 300,
'originalCpm': 0.0621,
'originalCurrency': 'USD'
},
{
'id': '18552976939844999',
'impid': '3025f169863b7f8',
'price': 0.521,
'adm': '<sc. second bid for bidId 3025f169863b7f8 ..div>',
'adid': '120179216',
'adomain': [
'appnexus.com'
],
'iurl': 'https://ams1-ib.adnxs.com/cr?id=120179216',
'cid': '9999',
'crid': '120179299',
'w': 728,
'h': 90,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'ozone': {},
'appnexus': {
'brand_id': 1,
'auction_id': 3449036134472542700,
'bidder_id': 2,
'bid_ad_type': 0
}
}
},
'cpm': 0.521,
'bidId': '3025f169863b7f8',
'requestId': '3025f169863b7f8',
'width': 728,
'height': 90,
'ad': '<scr...iv>',
'netRevenue': true,
'creativeId': '120179299',
'currency': 'USD',
'ttl': 300,
'originalCpm': 0.0621,
'originalCurrency': 'USD'
}
],
'seat': 'ozappnexus'
},
{
'bid': [
{
'id': '1c605e8a-4992-4ec6-8a5c-f82e2938c2db',
'impid': '2d30e86db743a8',
'price': 0.01,
'adm': '<div ... div>',
'crid': '540463358',
'w': 300,
'h': 250,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'ozone': {}
}
},
'cpm': 0.01,
'bidId': '2d30e86db743a8',
'requestId': '2d30e86db743a8',
'width': 300,
'height': 250,
'ad': '<div ...div>',
'netRevenue': true,
'creativeId': '540463358',
'currency': 'USD',
'ttl': 300,
'originalCpm': 0.01,
'originalCurrency': 'USD'
},
{
'id': '3edeb4f7-d91d-44e2-8aeb-4a2f6d295ce5',
'impid': '3025f169863b7f8',
'price': 0.01,
'adm': '<div ... div>',
'crid': '540221061',
'w': 970,
'h': 250,
'ext': {
'prebid': {
'type': 'banner'
},
'bidder': {
'ozone': {}
}
},
'cpm': 0.01,
'bidId': '3025f169863b7f8',
'requestId': '3025f169863b7f8',
'width': 970,
'height': 250,
'ad': '<div ... div>',
'netRevenue': true,
'creativeId': '540221061',
'currency': 'USD',
'ttl': 300,
'originalCpm': 0.01,
'originalCurrency': 'USD'
}
],
'seat': 'openx'
}
],
'ext': {
'debug': {},
'responsetimemillis': {
'beeswax': 6,
'openx': 91,
'ozappnexus': 40,
'ozbeeswax': 6
}
}
},
'headers': {}
};
/*
--------------------end of 2 slots, 2 ----------------------------
*/
describe('ozone Adapter', function () {
describe('isBidRequestValid', function () {
// A test ad unit that will consistently return test creatives
let validBidReq = {
bidder: BIDDER_CODE,
params: {
placementId: '1310000099',
publisherId: '9876abcd12-3',
siteId: '1234567890'
}
};
it('should return true when required params found', function () {
expect(spec.isBidRequestValid(validBidReq)).to.equal(true);
});
var validBidReq2 = {
bidder: BIDDER_CODE,
params: {
placementId: '1310000099',
publisherId: '9876abcd12-3',
siteId: '1234567890',
customData: [{'settings': {}, 'targeting': {'gender': 'bart', 'age': 'low'}}]
},
siteId: 1234567890
}
it('should return true when required params found and all optional params are valid', function () {
expect(spec.isBidRequestValid(validBidReq2)).to.equal(true);
});
var xEmptyPlacement = {
bidder: BIDDER_CODE,
params: {
placementId: '',
publisherId: '9876abcd12-3',
siteId: '1234567890'
}
};
it('should not validate empty placementId', function () {
expect(spec.isBidRequestValid(xEmptyPlacement)).to.equal(false);
});
var xMissingPlacement = {
bidder: BIDDER_CODE,
params: {
publisherId: '9876abcd12-3',
siteId: '1234567890'
}
};
it('should not validate missing placementId', function () {
expect(spec.isBidRequestValid(xMissingPlacement)).to.equal(false);
});
var xBadPlacement = {
bidder: BIDDER_CODE,
params: {
placementId: '123X45',
publisherId: '9876abcd12-3',
siteId: '1234567890'
}
};
it('should not validate placementId with a non-numeric value', function () {
expect(spec.isBidRequestValid(xBadPlacement)).to.equal(false);
});
var xBadPlacementTooShort = {
bidder: BIDDER_CODE,
params: {
placementId: 123456789, /* should be exactly 10 chars */
publisherId: '9876abcd12-3',
siteId: '1234567890'
}
};
it('should not validate placementId with a numeric value of wrong length', function () {
expect(spec.isBidRequestValid(xBadPlacementTooShort)).to.equal(false);
});