Skip to content

Commit

Permalink
oneTag Bid Adapter: edit page fields (#6971)
Browse files Browse the repository at this point in the history
  • Loading branch information
onetag-dev authored Jun 8, 2021
1 parent d5750fc commit a532e4a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
5 changes: 5 additions & 0 deletions modules/onetagBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ function getPageInfo() {
topmostFrame.document.referrer !== ''
? topmostFrame.document.referrer
: null,
ancestorOrigin:
window.location.ancestorOrigins && window.location.ancestorOrigins[0] != null
? window.location.ancestorOrigins[0]
: null,
masked: currentFrameNesting,
wWidth: topmostFrame.innerWidth,
wHeight: topmostFrame.innerHeight,
Expand Down Expand Up @@ -240,6 +244,7 @@ function requestsToBids(bidRequests) {
videoObj['protocols'] = bidRequest.mediaTypes.video.protocols;
videoObj['maxDuration'] = bidRequest.mediaTypes.video.maxduration;
videoObj['api'] = bidRequest.mediaTypes.video.api;
videoObj['playbackmethod'] = bidRequest.mediaTypes.video.playbackmethod || [];
videoObj['type'] = VIDEO;
return videoObj;
});
Expand Down
31 changes: 29 additions & 2 deletions test/spec/modules/onetagBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ describe('onetag', function () {
expect(data.wHeight).to.be.a('number');
expect(data.oHeight).to.be.a('number');
expect(data.oWidth).to.be.a('number');
expect(data.ancestorOrigin).to.satisfy(function (value) {
return value === null || typeof value === 'string';
});
expect(data.aWidth).to.be.a('number');
expect(data.aHeight).to.be.a('number');
expect(data.sLeft).to.be.a('number');
Expand All @@ -153,9 +156,33 @@ describe('onetag', function () {
for (let i = 0; i < bids.length; i++) {
const bid = bids[i];
if (hasTypeVideo(bid)) {
expect(bid).to.have.all.keys('adUnitCode', 'auctionId', 'bidId', 'bidderRequestId', 'pubId', 'transactionId', 'context', 'mimes', 'playerSize', 'protocols', 'maxDuration', 'api', 'type');
expect(bid).to.have.all.keys(
'adUnitCode',
'auctionId',
'bidId',
'bidderRequestId',
'pubId',
'transactionId',
'context',
'mimes',
'playerSize',
'protocols',
'maxDuration',
'api',
'playbackmethod',
'type'
);
} else if (isValid(BANNER, bid)) {
expect(bid).to.have.all.keys('adUnitCode', 'auctionId', 'bidId', 'bidderRequestId', 'pubId', 'transactionId', 'sizes', 'type');
expect(bid).to.have.all.keys(
'adUnitCode',
'auctionId',
'bidId',
'bidderRequestId',
'pubId',
'transactionId',
'sizes',
'type'
);
}
expect(bid.bidId).to.be.a('string');
expect(bid.pubId).to.be.a('string');
Expand Down

0 comments on commit a532e4a

Please sign in to comment.