Skip to content

Commit

Permalink
Criteo bid adapter: remove checks on video context and placement (#10912
Browse files Browse the repository at this point in the history
)

Those checks are no longer useful so we decided to remove them.
  • Loading branch information
dzhang-criteo authored Jan 8, 2024
1 parent 759c52d commit 6689373
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 98 deletions.
12 changes: 1 addition & 11 deletions modules/criteoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,17 +683,7 @@ function hasValidVideoMediaType(bidRequest) {
}
});

if (isValid) {
const videoPlacement = bidRequest.mediaTypes.video.placement || bidRequest.params.video.placement;
// We do not support long form for now, also we have to check that context & placement are consistent
if (bidRequest.mediaTypes.video.context == 'instream' && videoPlacement === 1) {
return true;
} else if (bidRequest.mediaTypes.video.context == 'outstream' && videoPlacement !== 1) {
return true;
}
}

return false;
return isValid;
}

/**
Expand Down
87 changes: 0 additions & 87 deletions test/spec/modules/criteoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,93 +364,6 @@ describe('The Criteo bidding adapter', function () {
});

it('should return false when given an invalid video bid request', function () {
expect(spec.isBidRequestValid({
bidder: 'criteo',
mediaTypes: {
video: {
mimes: ['video/mpeg'],
playerSize: [640, 480],
protocols: [5, 6],
maxduration: 30,
api: [1, 2]
}
},
params: {
networkId: 456,
video: {
skip: 1,
placement: 1,
playbackmethod: 1
}
},
})).to.equal(false);

expect(spec.isBidRequestValid({
bidder: 'criteo',
mediaTypes: {
video: {
context: 'instream',
mimes: ['video/mpeg'],
playerSize: [640, 480],
protocols: [5, 6],
maxduration: 30,
api: [1, 2]
}
},
params: {
networkId: 456,
video: {
skip: 1,
placement: 2,
playbackmethod: 1
}
},
})).to.equal(false);

expect(spec.isBidRequestValid({
bidder: 'criteo',
mediaTypes: {
video: {
context: 'outstream',
mimes: ['video/mpeg'],
playerSize: [640, 480],
protocols: [5, 6],
maxduration: 30,
api: [1, 2]
}
},
params: {
networkId: 456,
video: {
skip: 1,
placement: 1,
playbackmethod: 1
}
},
})).to.equal(false);

expect(spec.isBidRequestValid({
bidder: 'criteo',
mediaTypes: {
video: {
context: 'adpod',
mimes: ['video/mpeg'],
playerSize: [640, 480],
protocols: [5, 6],
maxduration: 30,
api: [1, 2]
}
},
params: {
networkId: 456,
video: {
skip: 1,
placement: 1,
playbackmethod: 1
}
},
})).to.equal(false);

expect(spec.isBidRequestValid({
bidder: 'criteo',
mediaTypes: {
Expand Down

0 comments on commit 6689373

Please sign in to comment.