Skip to content

Commit

Permalink
add mediaType adn vastUrl for video reponse
Browse files Browse the repository at this point in the history
  • Loading branch information
Fang Bai committed Nov 10, 2017
1 parent 630b68e commit 02f7b59
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
7 changes: 2 additions & 5 deletions modules/openxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,9 @@ function createVideoBidResponses(response, {bid, startTime}) {
bidResponse.width = response.width;
bidResponse.height = response.height;
bidResponse.creativeId = response.adid;
bidResponse.vastUrl = response.vastUrl;
bidResponse.mediaType = VIDEO;

bidResponse.openx = {
ff: response.cache_key,
oxcolo: response.per_colo_domain,
oxph: response.ph
};
bidResponses.push(bidResponse);
}

Expand Down
23 changes: 7 additions & 16 deletions test/spec/modules/openxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { newBidder } from 'src/adapters/bidderFactory';
const URLBASE = '/w/1.0/arj';
const URLBASEVIDEO = '/v/1.0/avjp';

describe.only('OpenxAdapter', () => {
describe('OpenxAdapter', () => {
const adapter = newBidder(spec);

describe('inherited functions', () => {
Expand Down Expand Up @@ -169,9 +169,7 @@ describe.only('OpenxAdapter', () => {
'unit': '12345678',
'delDomain': 'test-del-domain',
'video': {
'be': 'true',
'url': 'abc.com',
'vtest': '1'
}
},
'adUnitCode': 'adunit-code',
Expand All @@ -196,8 +194,6 @@ describe.only('OpenxAdapter', () => {
expect(dataParams.auid).to.equal('12345678');
expect(dataParams.url).to.exist;
expect(dataParams.url).to.equal('abc.com');
expect(dataParams.vtest).to.exist;
expect(dataParams.vtest).to.equal('1');
});
});

Expand Down Expand Up @@ -301,9 +297,7 @@ describe.only('OpenxAdapter', () => {
'unit': '12345678',
'delDomain': 'test-del-domain',
'video': {
'be': 'true',
'url': 'abc.com',
'vtest': '1'
}
},
'adUnitCode': 'adunit-code',
Expand All @@ -320,11 +314,11 @@ describe.only('OpenxAdapter', () => {
payload: {'bid': bids[0], 'startTime': new Date()}
};
let bidResponse = {
'cache_key': 'test_cache_key',
'pub_rev': '1',
'per_colo_domain': 'http://delivery-us-west-1.openx.net',
'ph': '7a3b9374-7986-4a41-a79d-034193518aee',
'width': '640',
'height': '480',
'adid': 5678,
'vastUrl': 'http://testvast.com'
};

it('should return correct bid response', () => {
Expand All @@ -335,12 +329,9 @@ describe.only('OpenxAdapter', () => {
'cpm': 1,
'width': '640',
'height': '480',
'mediaType': 'video',
'creativeId': 5678,
'openx': {
'ff': 'test_cache_key',
'oxcolo': 'http://delivery-us-west-1.openx.net',
'oxph': '7a3b9374-7986-4a41-a79d-034193518aee'
},
'vastUrl': 'http://testvast.com',
'ttl': 300,
'netRevenue': true,
'currency': 'USD'
Expand All @@ -352,7 +343,7 @@ describe.only('OpenxAdapter', () => {
});

it('handles nobid responses', () => {
let bidResponse = {'cache_key': '', 'pub_rev': '', 'per_colo_domain': '', 'ph': ''};
let bidResponse = {'vastUrl': '', 'pub_rev': '', 'width': '', 'height': '', 'adid': ''};
let result = spec.interpretResponse({body: bidResponse}, bidRequest);
expect(result.length).to.equal(0);
});
Expand Down

0 comments on commit 02f7b59

Please sign in to comment.