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

Fixing issue #4950 #4951

Closed
wants to merge 54 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
5a2b8c2
Fixing issue #4950
leonardlabat Mar 9, 2020
844f52b
Added test case & removed duplicated utils function
leonardlabat Mar 9, 2020
a088d66
update audigent tests to fix larger test suite issue (#4952)
jsnellbaker Mar 9, 2020
60f66c9
enable no-console eslint rule for project (#4802)
jsnellbaker Mar 10, 2020
5d4c823
Fix failing code-coverage command (#4892)
Fawke Mar 10, 2020
9325d22
Add 7xbid adapter to compatible with prebid 3.0 (#4908)
7XBID00 Mar 10, 2020
fc8ebec
add import extensions (#4959)
robertrmartinez Mar 10, 2020
f5b0e4e
removing the log (#4960)
robertrmartinez Mar 10, 2020
bb015bd
adding user-id support in medianet adapter (#4925)
vedantseta Mar 10, 2020
79a5f46
added option to url parser to ignore decoding entire url (#4938)
robertrmartinez Mar 10, 2020
8c84e01
assert string returned not that we break things (#4962)
robertrmartinez Mar 10, 2020
1b62b0b
IX Adapter - Increase banner TTL to 300s (#4957)
ix-prebid-support Mar 11, 2020
6113cd9
Lifestreet adapter 3.0 (#4927)
probably-kira Mar 11, 2020
6005a29
Module - Size Mapping V2 (#4690)
Fawke Mar 11, 2020
ef57d43
update logic in adpod module for playersize (#4953)
jsnellbaker Mar 11, 2020
0b75199
add mediaforce bid adapter (#4933)
ksanksana Mar 11, 2020
efae8f8
Eids liveintent ext fix (#4944)
pm-harshad-mane Mar 11, 2020
4af14c9
3.11.0 release
mkendall07 Mar 11, 2020
364b385
3.12.0-pre
mkendall07 Mar 11, 2020
f890eb8
add UNICORN bid adapter (#4917)
ctylim Mar 12, 2020
0ccf807
Added support for merging arrays and some test cases
leonardlabat Mar 12, 2020
703b898
Submitting Clicktripz bid adapter (#4929)
apmitchell Mar 12, 2020
00c4cb0
PrebidServerbidAdapter to use userIdAsEids to set eids in request (#4…
pm-harshad-mane Mar 13, 2020
2db8ecf
Conversant bid adapter to use userIdAsEids (#4967)
pm-harshad-mane Mar 16, 2020
5df9c8f
add support for TCF2 (#4911)
jsnellbaker Mar 17, 2020
1034f27
New e-volution tech bid adapter (#4934)
e-volution-tech Mar 17, 2020
a95f911
Add enforcement for deviceAccess (#4913)
Mar 17, 2020
d1f0ea1
Fix failing circle-ci build job. (#4840)
Fawke Mar 17, 2020
aa36b5a
Add alias Select Media into Adtelligent (#4985)
GeneGenie Mar 17, 2020
320e3a0
NoBid version 1.2.4 (#4971)
redaguermas Mar 17, 2020
02069e4
Prebid 3.12.0 Release
Mar 17, 2020
0de00fe
Increment pre version
Mar 17, 2020
9fc9579
Liveintent liveconnect module (#4803)
melgenek Mar 18, 2020
cbdea4a
Vidazoo adapter: update maintainer email (#5006)
uditalias Mar 20, 2020
dfcbd25
Add coppa support for Quantcast adapter (#5012)
weilingxi-qc Mar 20, 2020
9523787
Add Valueimpression Bid Adapter (#4974)
thuyhq Mar 21, 2020
07cf06f
appnexus adapter : include hb_source in request to server (#4964)
sumit116 Mar 24, 2020
fecfc2b
Index Exchange: Registering user syncs (#5005)
ix-prebid-support Mar 24, 2020
f0bc358
update consent manager to support a new config prop: defaultGdprScope…
Mar 24, 2020
498b771
freewheel add property vastXml to bidResponse (#5015)
xwang202 Mar 24, 2020
da6bb01
Added Adnuntius Bid Adapter (#4896)
mikael-lundin Mar 24, 2020
b24156c
deal tier fix (#5028)
jaiminpanchal27 Mar 24, 2020
a1083ff
PubMatic bid adapter to support NetId User Module (#5009)
pm-harshad-mane Mar 25, 2020
adda4e1
Undertone add parameters to request (#4995)
AnnaPerion Mar 25, 2020
e4ea90f
PulsePoint bid adapter: Multi-size support (#4988)
anand-venkatraman Mar 25, 2020
18b4009
VIS.X: use schain & userId modules (#5004)
mk0x9 Mar 25, 2020
811dd44
ADFINITY adapter gdpr support (#4955)
adfinity-prebid Mar 25, 2020
9268e98
Prebid 3.13.0 Release
Mar 25, 2020
efa289e
Increment pre version
Mar 25, 2020
7c45626
Media.net : adds Analytics Adapter (#5016)
vedantseta Mar 26, 2020
d7424a5
Fixing issue #4950
leonardlabat Mar 9, 2020
6cb6fd1
Added test case & removed duplicated utils function
leonardlabat Mar 9, 2020
b128bc2
Added support for merging arrays and some test cases
leonardlabat Mar 12, 2020
3a37ebd
Merge branch 'issue_4950' of github.com:criteo-forks/Prebid.js into i…
leonardlabat Mar 26, 2020
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = {
"no-throw-literal": "off",
"no-undef": 2,
"no-useless-escape": "off",
"no-console": "error"
},
"overrides": Object.keys(allowedModules).map((key) => ({
"files": key + "/**/*.js",
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ When you are adding code to Prebid.js, or modifying code that isn't covered by a
- If you need to check `adloader.loadExternalScript` in a test, use a `stub` rather than a `spy`. `spy`s trigger a network call which can result in a `script error` and cause unrelated unit tests to fail. `stub`s will let you gather information about the `adloader.loadExternalScript` call without affecting external resources
- If your test makes ajax requests, use the global xhr stub in `test/mocks/xhr`. Do not use your own `sinon.useFakeXMLHttpRequest()` or `sinon.createFakeServer()`.
- When writing tests you may use ES2015 syntax if desired
- If your test relies on `Window` or `global` object, do not mutate that object directly. Instead, create a separate copy of that object and perform operations on that new copy.

### Test Examples
Prebid.js already has many tests. Read them to see how Prebid.js is tested, and for inspiration:
Expand Down
3 changes: 2 additions & 1 deletion allowedModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module.exports = {
...sharedWhiteList,
'criteo-direct-rsa-validate',
'jsencrypt',
'crypto-js'
'crypto-js',
'live-connect' // Maintained by LiveIntent : https://github.com/liveintent-berlin/live-connect/
],
'src': [
...sharedWhiteList,
Expand Down
26 changes: 13 additions & 13 deletions browsers.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"device": null,
"os": "Windows"
},
"bs_edge_16_windows_10": {
"bs_edge_18_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "edge",
"browser_version": "16.0",
"browser_version": "18.0",
"device": null,
"os": "Windows"
},
Expand All @@ -23,43 +23,43 @@
"device": null,
"os": "Windows"
},
"bs_chrome_74_windows_10": {
"bs_chrome_80_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "chrome",
"browser_version": "74.0",
"browser_version": "80.0",
"device": null,
"os": "Windows"
},
"bs_chrome_75_windows_10": {
"bs_chrome_79_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "chrome",
"browser_version": "75.0",
"browser_version": "79.0",
"device": null,
"os": "Windows"
},
"bs_firefox_66_windows_10": {
"bs_firefox_73_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "firefox",
"browser_version": "66.0",
"browser_version": "73.0",
"device": null,
"os": "Windows"
},
"bs_firefox_67_windows_10": {
"bs_firefox_72_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "firefox",
"browser_version": "67.0",
"browser_version": "72.0",
"device": null,
"os": "Windows"
},
"bs_safari_11_mac_high_sierra": {
"bs_safari_11_mac_catalina": {
"base": "BrowserStack",
"os_version": "High Sierra",
"os_version": "Catalina",
"browser": "safari",
"browser_version": "11.1",
"browser_version": "13.0",
"device": null,
"os": "OS X"
},
Expand Down
24 changes: 12 additions & 12 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ function lint(done) {
if (argv.nolint) {
return done();
}
const isFixed = function(file) {
const isFixed = function (file) {
return file.eslint != null && file.eslint.fixed;
}
return gulp.src(['src/**/*.js', 'modules/**/*.js', 'test/**/*.js'], {base: './'})
.pipe(gulpif(argv.nolintfix, eslint(), eslint({fix: true})))
return gulp.src(['src/**/*.js', 'modules/**/*.js', 'test/**/*.js'], { base: './' })
.pipe(gulpif(argv.nolintfix, eslint(), eslint({ fix: true })))
.pipe(eslint.format('stylish'))
.pipe(eslint.failAfterError())
.pipe(gulpif(isFixed, gulp.dest('./')));
Expand All @@ -84,7 +84,7 @@ function viewCoverage(done) {

connect.server({
port: coveragePort,
root: 'build/coverage/karma_html',
root: 'build/coverage/lcov-report',
livereload: false
});
opens('http://' + mylocalhost + ':' + coveragePort);
Expand Down Expand Up @@ -160,7 +160,7 @@ function nodeBundle(modules) {
.on('error', (err) => {
reject(err);
})
.pipe(through.obj(function(file, enc, done) {
.pipe(through.obj(function (file, enc, done) {
resolve(file.contents.toString(enc));
done();
}));
Expand Down Expand Up @@ -199,7 +199,7 @@ function bundle(dev, moduleArr) {
return gulp.src(
entries
)
.pipe(gulpif(dev, sourcemaps.init({loadMaps: true})))
.pipe(gulpif(dev, sourcemaps.init({ loadMaps: true })))
.pipe(concat(outputFileName))
.pipe(gulpif(!argv.manualEnable, footer('\n<%= global %>.processQueue();', {
global: prebid.globalVarName
Expand Down Expand Up @@ -239,7 +239,7 @@ function test(done) {
}

//run mock-server
const mockServer = spawn('node', ['./test/mock-server/index.js', '--port='+mockServerPort]);
const mockServer = spawn('node', ['./test/mock-server/index.js', '--port=' + mockServerPort]);
mockServer.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
Expand Down Expand Up @@ -273,7 +273,7 @@ function test(done) {
}

function newKarmaCallback(done) {
return function(exitCode) {
return function (exitCode) {
if (exitCode) {
done(new Error('Karma tests failed with exit code ' + exitCode));
if (argv.browserstack) {
Expand All @@ -296,7 +296,7 @@ function testCoverage(done) {
function coveralls() { // 2nd arg is a dependency: 'test' must be finished
// first send results of istanbul's test coverage to coveralls.io.
return gulp.src('gulpfile.js', { read: false }) // You have to give it a file, but you don't
// have to read it.
// have to read it.
.pipe(shell('cat build/coverage/lcov.info | node_modules/coveralls/bin/coveralls.js'));
}

Expand Down Expand Up @@ -326,10 +326,10 @@ function setupE2e(done) {
done();
}

gulp.task('updatepath', function(){
gulp.task('updatepath', function () {
return gulp.src(['build/dist/*.js'])
.pipe(replace('https://ib.adnxs.com/ut/v3/prebid', 'http://' + host + ':' + mockServerPort + '/'))
.pipe(gulp.dest('build/dist'));
.pipe(replace('https://ib.adnxs.com/ut/v3/prebid', 'http://' + host + ':' + mockServerPort + '/'))
.pipe(gulp.dest('build/dist'));
});

// support tasks
Expand Down
121 changes: 121 additions & 0 deletions integrationExamples/gpt/responsiveAds_sizeMappingV2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<!DOCTYPE html>
<html>

<head>
<script async src="../../../build/dev/prebid.js"></script>
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<script>
const FAILSAFE_TIMEOUT = 3300;
const PREBID_TIMEOUT = 1000;

const adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
mediaTypes: {
banner: {
sizeConfig: [
{ minViewPort: [0, 0], sizes: [] }, // remove if < 750px
{ minViewPort: [750, 0], sizes: [[300, 250], [300, 600]] }, // between 750px and 1199px
{ minViewPort: [1200, 0], sizes: [[970, 90], [728, 90], [300, 250]] }, // between 1200px and 1599px
{ minViewPort: [1600, 0], sizes: [[1000, 300], [970, 90], [728, 90], [300, 250]] } // greater than 1600px
]
},
video: {
context: 'instream',
sizeConfig: [
{ minViewPort: [0, 0], playerSize: [] },
{ minViewPort: [800, 0], playerSize: [640, 480] }
]
},
native: {
image: {
required: true,
sizes: [150, 50]
},

sizeConfig: [
{ minViewPort: [0, 0], active: false },
{ minViewPort: [600, 0], active: true }
]
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: 13144370
},
sizeConfig: [
{ minViewPort: [0, 0], relevantMediaTypes: ['none'] },
{ minViewPort: [850, 0], relevantMediaTypes: ['banner'] }
]
}, {
bidder: 'rubicon',
params: {
accountId: 14062,
siteId: 70608,
zoneId: 498816
},
sizeConfig: [
{ minViewPort: [0, 0], relevantMediaTypes: ['none'] },
{ minViewPort: [850, 0], relevantMediaTypes: ['native'] },
{ minViewPort: [1200, 0], relevantMediaTypes: ['none'] }
]
}]
}];
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

</script>

<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function () {
googletag.pubads().disableInitialLoad();
});

pbjs.que.push(function () {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest,
timeout: PREBID_TIMEOUT
});
});

function sendAdserverRequest() {
if (pbjs.adserverRequestSent) return;
pbjs.adserverRequestSent = true;
googletag.cmd.push(function () {
pbjs.que.push(function () {
pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
});
}

setTimeout(function () {
sendAdserverRequest();
}, FAILSAFE_TIMEOUT);

</script>

<script>
googletag.cmd.push(function () {
googletag.defineSlot('/19968336/header-bid-tag-0', [728, 90], 'div-gpt-ad-1460505748561-0').addService(googletag.pubads());

googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
</head>

<body>
<h2>Prebid.js Test</h2>
<h5>Div-1</h5>
<div id='div-gpt-ad-1460505748561-0'>
<script type='text/javascript'>
googletag.cmd.push(function () { googletag.display('div-gpt-ad-1460505748561-0'); });
</script>
</div>
</body>

</html>
34 changes: 16 additions & 18 deletions karma.conf.maker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

var _ = require('lodash');
var webpackConf = require('./webpack.conf');
var path = require('path')
var karmaConstants = require('karma').constants;

function newWebpackConfig(codeCoverage) {
Expand Down Expand Up @@ -33,7 +32,7 @@ function newWebpackConfig(codeCoverage) {
function newPluginsArray(browserstack) {
var plugins = [
'karma-chrome-launcher',
'karma-coverage-istanbul-reporter',
'karma-coverage',
'karma-es5-shim',
'karma-mocha',
'karma-chai',
Expand Down Expand Up @@ -66,18 +65,15 @@ function setReporters(karmaConf, codeCoverage, browserstack) {
suppressPassed: true
};
}

if (codeCoverage) {
karmaConf.reporters.push('coverage-istanbul');
karmaConf.coverageIstanbulReporter = {
reports: ['html', 'lcovonly', 'text-summary'],
dir: path.join(__dirname, 'build', 'coverage'),
'report-config': {
html: {
subdir: 'karma_html',
urlFriendlyName: true, // simply replaces spaces with _ for files/dirs
}
}
}
karmaConf.reporters.push('coverage');
karmaConf.coverageReporter = {
dir: 'build/coverage',
reporters: [
{ type: 'lcov', subdir: '.' }
]
};
}
}

Expand All @@ -92,7 +88,7 @@ function setBrowsers(karmaConf, browserstack) {
karmaConf.browserStack.startTunnel = false;
karmaConf.browserStack.tunnelIdentifier = process.env.BROWSERSTACK_LOCAL_IDENTIFIER;
}
karmaConf.customLaunchers = require('./browsers.json')
karmaConf.customLaunchers = require('./browsers.json');
karmaConf.browsers = Object.keys(karmaConf.customLaunchers);
} else {
var isDocker = require('is-docker')();
Expand Down Expand Up @@ -157,6 +153,7 @@ module.exports = function(codeCoverage, browserstack, watchMode, file) {
autoWatch: true,

reporters: ['mocha'],

mochaReporter: {
showDiff: true,
output: 'minimal'
Expand All @@ -165,10 +162,11 @@ module.exports = function(codeCoverage, browserstack, watchMode, file) {
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: !watchMode,
browserDisconnectTimeout: 10000, // default 2000
browserDisconnectTolerance: 1, // default 0
browserNoActivityTimeout: 4 * 60 * 1000, // default 10000
captureTimeout: 4 * 60 * 1000, // default 60000
browserDisconnectTimeout: 3e5, // default 2000
browserNoActivityTimeout: 3e5, // default 10000
captureTimeout: 3e5, // default 60000,
browserDisconnectTolerance: 3,
concurrency: 5,

plugins: plugins
}
Expand Down
Loading