prebid.js 6.7.0 → 6.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +8 -1
- package/integrationExamples/gpt/{haloRtdProvider_example.html → hadronRtdProvider_example.html} +9 -9
- package/integrationExamples/gpt/idImportLibrary_example.html +2 -2
- package/integrationExamples/gpt/userId_example.html +2 -2
- package/integrationExamples/gpt/weboramaRtdProvider_example.html +154 -115
- package/integrationExamples/gpt/x-domain/creative.html +63 -29
- package/modules/.submodules.json +3 -0
- package/modules/adagioBidAdapter.js +0 -8
- package/modules/adagioBidAdapter.md +1 -1
- package/modules/adkernelBidAdapter.js +2 -1
- package/modules/adnuntiusRtdProvider.js +96 -0
- package/modules/adnuntiusRtdProvider.md +41 -0
- package/modules/adotBidAdapter.js +516 -567
- package/modules/adotBidAdapter.md +6 -44
- package/modules/adpod.js +12 -14
- package/modules/adyoulikeBidAdapter.js +2 -0
- package/modules/appnexusBidAdapter.js +14 -2
- package/modules/asealBidAdapter.js +58 -0
- package/modules/asealBidAdapter.md +52 -0
- package/modules/brandmetricsRtdProvider.js +168 -0
- package/modules/brandmetricsRtdProvider.md +40 -0
- package/modules/conversantBidAdapter.js +7 -0
- package/modules/criteoBidAdapter.js +9 -0
- package/modules/currency.js +27 -5
- package/modules/displayioBidAdapter.js +157 -0
- package/modules/displayioBidAdapter.md +148 -0
- package/modules/dspxBidAdapter.js +69 -29
- package/modules/dspxBidAdapter.md +2 -1
- package/modules/e_volutionBidAdapter.js +158 -0
- package/modules/gridBidAdapter.js +15 -1
- package/modules/gumgumBidAdapter.js +52 -38
- package/modules/hadronIdSystem.js +96 -0
- package/modules/hadronIdSystem.md +35 -0
- package/modules/hadronRtdProvider.js +254 -0
- package/modules/hadronRtdProvider.md +126 -0
- package/modules/haloIdSystem.md +4 -35
- package/modules/haloRtdProvider.md +3 -126
- package/modules/imRtdProvider.js +10 -0
- package/modules/improvedigitalBidAdapter.js +5 -0
- package/modules/interactiveOffersBidAdapter.js +9 -6
- package/modules/iqzoneBidAdapter.js +10 -3
- package/modules/iqzoneBidAdapter.md +16 -0
- package/modules/ixBidAdapter.js +2 -6
- package/modules/kubientBidAdapter.js +50 -19
- package/modules/lunamediahbBidAdapter.js +32 -4
- package/modules/malltvBidAdapter.js +7 -3
- package/modules/malltvBidAdapter.md +64 -51
- package/modules/mass.js +3 -5
- package/modules/mediakeysBidAdapter.js +0 -5
- package/modules/medianetAnalyticsAdapter.js +1 -1
- package/modules/mediasquareBidAdapter.js +9 -1
- package/modules/nextMillenniumBidAdapter.js +1 -0
- package/modules/oguryBidAdapter.js +7 -14
- package/modules/prebidServerBidAdapter/index.js +61 -39
- package/modules/priceFloors.js +20 -12
- package/modules/pubmaticBidAdapter.js +1 -1
- package/modules/richaudienceBidAdapter.js +8 -3
- package/modules/riseBidAdapter.js +17 -6
- package/modules/rtbhouseBidAdapter.js +2 -0
- package/modules/rubiconAnalyticsAdapter.js +5 -0
- package/modules/rubiconBidAdapter.js +2 -2
- package/modules/sizeMappingV2.js +1 -8
- package/modules/sortableAnalyticsAdapter.js +5 -4
- package/modules/sovrnBidAdapter.js +93 -18
- package/modules/sovrnBidAdapter.md +80 -2
- package/modules/sspBCBidAdapter.js +53 -20
- package/modules/telariaBidAdapter.js +22 -29
- package/modules/trustpidSystem.js +197 -0
- package/modules/trustpidSystem.md +45 -0
- package/modules/undertoneBidAdapter.js +17 -1
- package/modules/userId/eids.js +16 -1
- package/modules/userId/eids.md +10 -2
- package/modules/userId/userId.md +17 -2
- package/modules/vibrantmediaBidAdapter.js +220 -0
- package/modules/vibrantmediaBidAdapter.md +92 -0
- package/modules/vidoomyBidAdapter.js +8 -0
- package/modules/vidoomyBidAdapter.md +4 -2
- package/modules/weboramaRtdProvider.js +264 -34
- package/modules/weboramaRtdProvider.md +110 -40
- package/modules/yahoosspBidAdapter.js +3 -1
- package/modules/yieldoneBidAdapter.js +6 -0
- package/package.json +2 -1
- package/src/adRendering.js +38 -0
- package/src/adapterManager.js +24 -19
- package/src/adapters/bidderFactory.js +14 -11
- package/src/adloader.js +2 -1
- package/src/auction.js +138 -115
- package/src/auctionIndex.js +85 -0
- package/src/auctionManager.js +3 -0
- package/src/bidderSettings.js +69 -0
- package/src/bidfactory.js +18 -6
- package/src/native.js +29 -21
- package/src/prebid.js +3 -19
- package/src/secureCreatives.js +128 -45
- package/src/targeting.js +11 -2
- package/src/utils.js +14 -17
- package/src/video.js +10 -11
- package/src/videoCache.js +10 -9
- package/test/fixtures/fixtures.js +2 -1
- package/test/helpers/indexStub.js +28 -0
- package/test/helpers/syncPromise.js +71 -0
- package/test/spec/auctionmanager_spec.js +268 -89
- package/test/spec/config_spec.js +24 -1
- package/test/spec/modules/adagioBidAdapter_spec.js +0 -10
- package/test/spec/modules/adnuntiusRtdProvider_spec.js +145 -0
- package/test/spec/modules/adotBidAdapter_spec.js +294 -3124
- package/test/spec/modules/adpod_spec.js +91 -156
- package/test/spec/modules/adyoulikeBidAdapter_spec.js +4 -0
- package/test/spec/modules/appnexusBidAdapter_spec.js +27 -0
- package/test/spec/modules/asealBidAdapter_spec.js +144 -0
- package/test/spec/modules/brandmetricsRtdProvider_spec.js +191 -0
- package/test/spec/modules/conversantBidAdapter_spec.js +54 -2
- package/test/spec/modules/criteoBidAdapter_spec.js +21 -0
- package/test/spec/modules/currency_spec.js +36 -15
- package/test/spec/modules/displayioBidAdapter_spec.js +239 -0
- package/test/spec/modules/dspxBidAdapter_spec.js +20 -15
- package/test/spec/modules/e_volutionBidAdapter_spec.js +242 -0
- package/test/spec/modules/eids_spec.js +2 -2
- package/test/spec/modules/gridBidAdapter_spec.js +18 -0
- package/test/spec/modules/gumgumBidAdapter_spec.js +49 -3
- package/test/spec/modules/hadronIdSystem_spec.js +57 -0
- package/test/spec/modules/hadronRtdProvider_spec.js +762 -0
- package/test/spec/modules/imRtdProvider_spec.js +30 -1
- package/test/spec/modules/improvedigitalBidAdapter_spec.js +19 -0
- package/test/spec/modules/iqzoneBidAdapter_spec.js +1 -0
- package/test/spec/modules/ixBidAdapter_spec.js +1 -1
- package/test/spec/modules/kubientBidAdapter_spec.js +182 -84
- package/test/spec/modules/lunamediahbBidAdapter_spec.js +27 -1
- package/test/spec/modules/mass_spec.js +2 -14
- package/test/spec/modules/mediakeysBidAdapter_spec.js +9 -5
- package/test/spec/modules/mediasquareBidAdapter_spec.js +25 -1
- package/test/spec/modules/oguryBidAdapter_spec.js +63 -5
- package/test/spec/modules/prebidServerBidAdapter_spec.js +43 -6
- package/test/spec/modules/priceFloors_spec.js +83 -24
- package/test/spec/modules/pubmaticBidAdapter_spec.js +40 -0
- package/test/spec/modules/riseBidAdapter_spec.js +30 -4
- package/test/spec/modules/rubiconAnalyticsAdapter_spec.js +31 -1
- package/test/spec/modules/rubiconBidAdapter_spec.js +1 -1
- package/test/spec/modules/sortableAnalyticsAdapter_spec.js +2 -3
- package/test/spec/modules/sovrnBidAdapter_spec.js +413 -333
- package/test/spec/modules/sspBCBidAdapter_spec.js +7 -7
- package/test/spec/modules/telariaBidAdapter_spec.js +1 -3
- package/test/spec/modules/trustpidSystem_spec.js +232 -0
- package/test/spec/modules/undertoneBidAdapter_spec.js +55 -2
- package/test/spec/modules/userId_spec.js +39 -39
- package/test/spec/modules/vibrantmediaBidAdapter_spec.js +1237 -0
- package/test/spec/modules/vidoomyBidAdapter_spec.js +7 -1
- package/test/spec/modules/weboramaRtdProvider_spec.js +536 -20
- package/test/spec/modules/yahoosspBidAdapter_spec.js +10 -0
- package/test/spec/modules/yieldoneBidAdapter_spec.js +33 -0
- package/test/spec/native_spec.js +62 -40
- package/test/spec/unit/core/adapterManager_spec.js +22 -0
- package/test/spec/unit/core/auctionIndex_spec.js +129 -0
- package/test/spec/unit/core/bidderFactory_spec.js +65 -12
- package/test/spec/unit/core/bidderSettings_spec.js +123 -0
- package/test/spec/unit/core/targeting_spec.js +93 -0
- package/test/spec/unit/pbjs_api_spec.js +80 -42
- package/test/spec/unit/secureCreatives_spec.js +143 -24
- package/test/spec/videoCache_spec.js +18 -19
- package/test/spec/video_spec.js +51 -61
|
@@ -73,16 +73,11 @@ describe('adpod.js', function () {
|
|
|
73
73
|
mediaType: 'video'
|
|
74
74
|
};
|
|
75
75
|
|
|
76
|
-
let
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
video: {
|
|
80
|
-
context: 'outstream'
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
76
|
+
let videoMT = {
|
|
77
|
+
context: 'outstream'
|
|
78
|
+
};
|
|
84
79
|
|
|
85
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bid, function () {},
|
|
80
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bid, function () {}, videoMT);
|
|
86
81
|
expect(callbackResult).to.equal(true);
|
|
87
82
|
});
|
|
88
83
|
|
|
@@ -132,22 +127,16 @@ describe('adpod.js', function () {
|
|
|
132
127
|
}
|
|
133
128
|
};
|
|
134
129
|
|
|
135
|
-
let
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
playerSize: [[300, 300]],
|
|
142
|
-
adPodDurationSec: 300,
|
|
143
|
-
durationRangeSec: [15, 30, 45],
|
|
144
|
-
requireExactDuration: false
|
|
145
|
-
}
|
|
146
|
-
},
|
|
130
|
+
let videoMT = {
|
|
131
|
+
context: ADPOD,
|
|
132
|
+
playerSize: [[300, 300]],
|
|
133
|
+
adPodDurationSec: 300,
|
|
134
|
+
durationRangeSec: [15, 30, 45],
|
|
135
|
+
requireExactDuration: false
|
|
147
136
|
};
|
|
148
137
|
|
|
149
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy,
|
|
150
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy,
|
|
138
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy, videoMT);
|
|
139
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy, videoMT);
|
|
151
140
|
|
|
152
141
|
// check if bid adsereverTargeting is setup
|
|
153
142
|
expect(callbackResult).to.be.null;
|
|
@@ -214,22 +203,16 @@ describe('adpod.js', function () {
|
|
|
214
203
|
durationBucket: 30
|
|
215
204
|
}
|
|
216
205
|
};
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
playerSize: [[300, 300]],
|
|
224
|
-
adPodDurationSec: 120,
|
|
225
|
-
durationRangeSec: [15, 30],
|
|
226
|
-
requireExactDuration: false
|
|
227
|
-
}
|
|
228
|
-
}
|
|
206
|
+
let videoMT = {
|
|
207
|
+
context: ADPOD,
|
|
208
|
+
playerSize: [[300, 300]],
|
|
209
|
+
adPodDurationSec: 120,
|
|
210
|
+
durationRangeSec: [15, 30],
|
|
211
|
+
requireExactDuration: false
|
|
229
212
|
};
|
|
230
213
|
|
|
231
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy,
|
|
232
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy,
|
|
214
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy, videoMT);
|
|
215
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy, videoMT);
|
|
233
216
|
|
|
234
217
|
expect(callbackResult).to.be.null;
|
|
235
218
|
expect(afterBidAddedSpy.calledTwice).to.equal(true);
|
|
@@ -276,21 +259,15 @@ describe('adpod.js', function () {
|
|
|
276
259
|
durationBucket: 30
|
|
277
260
|
}
|
|
278
261
|
};
|
|
279
|
-
let
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
playerSize: [[300, 300]],
|
|
286
|
-
adPodDurationSec: 120,
|
|
287
|
-
durationRangeSec: [15, 30],
|
|
288
|
-
requireExactDuration: true
|
|
289
|
-
}
|
|
290
|
-
}
|
|
262
|
+
let videoMT = {
|
|
263
|
+
context: ADPOD,
|
|
264
|
+
playerSize: [[300, 300]],
|
|
265
|
+
adPodDurationSec: 120,
|
|
266
|
+
durationRangeSec: [15, 30],
|
|
267
|
+
requireExactDuration: true
|
|
291
268
|
};
|
|
292
269
|
|
|
293
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse, afterBidAddedSpy,
|
|
270
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse, afterBidAddedSpy, videoMT);
|
|
294
271
|
clock.tick(31);
|
|
295
272
|
|
|
296
273
|
expect(callbackResult).to.be.null;
|
|
@@ -370,23 +347,17 @@ describe('adpod.js', function () {
|
|
|
370
347
|
}
|
|
371
348
|
};
|
|
372
349
|
|
|
373
|
-
let
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
playerSize: [[300, 300]],
|
|
380
|
-
adPodDurationSec: 45,
|
|
381
|
-
durationRangeSec: [15, 30],
|
|
382
|
-
requireExactDuration: false
|
|
383
|
-
}
|
|
384
|
-
}
|
|
350
|
+
let videoMT = {
|
|
351
|
+
context: ADPOD,
|
|
352
|
+
playerSize: [[300, 300]],
|
|
353
|
+
adPodDurationSec: 45,
|
|
354
|
+
durationRangeSec: [15, 30],
|
|
355
|
+
requireExactDuration: false
|
|
385
356
|
};
|
|
386
357
|
|
|
387
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy,
|
|
388
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy,
|
|
389
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse3, afterBidAddedSpy,
|
|
358
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy, videoMT);
|
|
359
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy, videoMT);
|
|
360
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse3, afterBidAddedSpy, videoMT);
|
|
390
361
|
clock.next();
|
|
391
362
|
|
|
392
363
|
expect(callbackResult).to.be.null;
|
|
@@ -459,22 +430,16 @@ describe('adpod.js', function () {
|
|
|
459
430
|
}
|
|
460
431
|
};
|
|
461
432
|
|
|
462
|
-
let
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
playerSize: [[300, 300]],
|
|
469
|
-
adPodDurationSec: 45,
|
|
470
|
-
durationRangeSec: [15, 30],
|
|
471
|
-
requireExactDuration: false
|
|
472
|
-
}
|
|
473
|
-
}
|
|
433
|
+
let videoMT = {
|
|
434
|
+
context: ADPOD,
|
|
435
|
+
playerSize: [[300, 300]],
|
|
436
|
+
adPodDurationSec: 45,
|
|
437
|
+
durationRangeSec: [15, 30],
|
|
438
|
+
requireExactDuration: false
|
|
474
439
|
};
|
|
475
440
|
|
|
476
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy,
|
|
477
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy,
|
|
441
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy, videoMT);
|
|
442
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy, videoMT);
|
|
478
443
|
|
|
479
444
|
expect(callbackResult).to.be.null;
|
|
480
445
|
expect(afterBidAddedSpy.calledTwice).to.equal(true);
|
|
@@ -519,21 +484,15 @@ describe('adpod.js', function () {
|
|
|
519
484
|
}
|
|
520
485
|
};
|
|
521
486
|
|
|
522
|
-
let
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
playerSize: [[300, 300]],
|
|
529
|
-
adPodDurationSec: 45,
|
|
530
|
-
durationRangeSec: [15, 30],
|
|
531
|
-
requireExactDuration: false
|
|
532
|
-
}
|
|
533
|
-
}
|
|
487
|
+
let videoMT = {
|
|
488
|
+
context: ADPOD,
|
|
489
|
+
playerSize: [[300, 300]],
|
|
490
|
+
adPodDurationSec: 45,
|
|
491
|
+
durationRangeSec: [15, 30],
|
|
492
|
+
requireExactDuration: false
|
|
534
493
|
};
|
|
535
494
|
|
|
536
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy,
|
|
495
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy, videoMT);
|
|
537
496
|
|
|
538
497
|
expect(callbackResult).to.be.null;
|
|
539
498
|
expect(afterBidAddedSpy.calledOnce).to.equal(true);
|
|
@@ -596,22 +555,16 @@ describe('adpod.js', function () {
|
|
|
596
555
|
durationBucket: 45
|
|
597
556
|
}
|
|
598
557
|
};
|
|
599
|
-
let
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
playerSize: [[300, 300]],
|
|
606
|
-
adPodDurationSec: 120,
|
|
607
|
-
durationRangeSec: [15, 30, 45],
|
|
608
|
-
requireExactDuration: false
|
|
609
|
-
}
|
|
610
|
-
}
|
|
558
|
+
let videoMT = {
|
|
559
|
+
context: ADPOD,
|
|
560
|
+
playerSize: [[300, 300]],
|
|
561
|
+
adPodDurationSec: 120,
|
|
562
|
+
durationRangeSec: [15, 30, 45],
|
|
563
|
+
requireExactDuration: false
|
|
611
564
|
};
|
|
612
565
|
|
|
613
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy,
|
|
614
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy,
|
|
566
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy, videoMT);
|
|
567
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy, videoMT);
|
|
615
568
|
|
|
616
569
|
expect(callbackResult).to.be.null;
|
|
617
570
|
expect(afterBidAddedSpy.calledTwice).to.equal(true);
|
|
@@ -669,22 +622,16 @@ describe('adpod.js', function () {
|
|
|
669
622
|
durationBucket: 30
|
|
670
623
|
}
|
|
671
624
|
};
|
|
672
|
-
let
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
playerSize: [[300, 300]],
|
|
679
|
-
adPodDurationSec: 120,
|
|
680
|
-
durationRangeSec: [15, 30, 45],
|
|
681
|
-
requireExactDuration: false
|
|
682
|
-
}
|
|
683
|
-
}
|
|
625
|
+
let videoMT = {
|
|
626
|
+
context: ADPOD,
|
|
627
|
+
playerSize: [[300, 300]],
|
|
628
|
+
adPodDurationSec: 120,
|
|
629
|
+
durationRangeSec: [15, 30, 45],
|
|
630
|
+
requireExactDuration: false
|
|
684
631
|
};
|
|
685
632
|
|
|
686
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy,
|
|
687
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy,
|
|
633
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy, videoMT);
|
|
634
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy, videoMT);
|
|
688
635
|
|
|
689
636
|
expect(doCallbacksIfTimedoutStub.calledTwice).to.equal(true);
|
|
690
637
|
expect(logWarnStub.calledOnce).to.equal(true);
|
|
@@ -742,21 +689,15 @@ describe('adpod.js', function () {
|
|
|
742
689
|
}
|
|
743
690
|
};
|
|
744
691
|
|
|
745
|
-
let
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
playerSize: [[300, 300]],
|
|
752
|
-
adPodDurationSec: 45,
|
|
753
|
-
durationRangeSec: [15, 30],
|
|
754
|
-
requireExactDuration: false
|
|
755
|
-
}
|
|
756
|
-
}
|
|
692
|
+
let videoMT = {
|
|
693
|
+
context: ADPOD,
|
|
694
|
+
playerSize: [[300, 300]],
|
|
695
|
+
adPodDurationSec: 45,
|
|
696
|
+
durationRangeSec: [15, 30],
|
|
697
|
+
requireExactDuration: false
|
|
757
698
|
};
|
|
758
699
|
|
|
759
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy,
|
|
700
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy, videoMT);
|
|
760
701
|
|
|
761
702
|
expect(callbackResult).to.be.null;
|
|
762
703
|
expect(afterBidAddedSpy.calledOnce).to.equal(true);
|
|
@@ -820,22 +761,16 @@ describe('adpod.js', function () {
|
|
|
820
761
|
}
|
|
821
762
|
};
|
|
822
763
|
|
|
823
|
-
let
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
playerSize: [[300, 300]],
|
|
830
|
-
adPodDurationSec: 300,
|
|
831
|
-
durationRangeSec: [15, 30, 45],
|
|
832
|
-
requireExactDuration: false
|
|
833
|
-
}
|
|
834
|
-
},
|
|
764
|
+
let videoMT = {
|
|
765
|
+
context: ADPOD,
|
|
766
|
+
playerSize: [[300, 300]],
|
|
767
|
+
adPodDurationSec: 300,
|
|
768
|
+
durationRangeSec: [15, 30, 45],
|
|
769
|
+
requireExactDuration: false
|
|
835
770
|
};
|
|
836
771
|
|
|
837
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy,
|
|
838
|
-
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy,
|
|
772
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse1, afterBidAddedSpy, videoMT);
|
|
773
|
+
callPrebidCacheHook(callbackFn, auctionInstance, bidResponse2, afterBidAddedSpy, videoMT);
|
|
839
774
|
|
|
840
775
|
expect(auctionBids[0].adserverTargeting.hb_pb_cat_dur).to.equal('tier7_test_15s');
|
|
841
776
|
expect(auctionBids[1].adserverTargeting.hb_pb_cat_dur).to.equal('12.00_value_15s');
|
|
@@ -985,7 +920,7 @@ describe('adpod.js', function () {
|
|
|
985
920
|
},
|
|
986
921
|
vastXml: '<VAST>test XML here</VAST>'
|
|
987
922
|
};
|
|
988
|
-
const
|
|
923
|
+
const adUnitNoExact = {
|
|
989
924
|
mediaTypes: {
|
|
990
925
|
video: {
|
|
991
926
|
context: ADPOD,
|
|
@@ -996,7 +931,7 @@ describe('adpod.js', function () {
|
|
|
996
931
|
}
|
|
997
932
|
}
|
|
998
933
|
};
|
|
999
|
-
const
|
|
934
|
+
const adUnitWithExact = {
|
|
1000
935
|
mediaTypes: {
|
|
1001
936
|
video: {
|
|
1002
937
|
context: ADPOD,
|
|
@@ -1051,7 +986,7 @@ describe('adpod.js', function () {
|
|
|
1051
986
|
|
|
1052
987
|
let goodBid = utils.deepClone(adpodTestBid);
|
|
1053
988
|
goodBid.meta.primaryCatId = undefined;
|
|
1054
|
-
checkVideoBidSetupHook(callbackFn, goodBid,
|
|
989
|
+
checkVideoBidSetupHook(callbackFn, goodBid, adUnitNoExact, adUnitNoExact.mediaTypes.video, ADPOD);
|
|
1055
990
|
expect(callbackResult).to.be.null;
|
|
1056
991
|
expect(bailResult).to.equal(true);
|
|
1057
992
|
expect(logErrorStub.called).to.equal(false);
|
|
@@ -1059,7 +994,7 @@ describe('adpod.js', function () {
|
|
|
1059
994
|
|
|
1060
995
|
it('returns true when adpod bid is missing iab category while brandCategoryExclusion in config is false', function() {
|
|
1061
996
|
let goodBid = utils.deepClone(adpodTestBid);
|
|
1062
|
-
checkVideoBidSetupHook(callbackFn, goodBid,
|
|
997
|
+
checkVideoBidSetupHook(callbackFn, goodBid, adUnitNoExact, adUnitNoExact.mediaTypes.video, ADPOD);
|
|
1063
998
|
expect(callbackResult).to.be.null;
|
|
1064
999
|
expect(bailResult).to.equal(true);
|
|
1065
1000
|
expect(logErrorStub.called).to.equal(false);
|
|
@@ -1067,7 +1002,7 @@ describe('adpod.js', function () {
|
|
|
1067
1002
|
|
|
1068
1003
|
it('returns false when a required property from an adpod bid is missing', function() {
|
|
1069
1004
|
function testInvalidAdpodBid(badTestBid, shouldErrorBeLogged) {
|
|
1070
|
-
checkVideoBidSetupHook(callbackFn, badTestBid,
|
|
1005
|
+
checkVideoBidSetupHook(callbackFn, badTestBid, adUnitNoExact, adUnitNoExact.mediaTypes.video, ADPOD);
|
|
1071
1006
|
expect(callbackResult).to.be.null;
|
|
1072
1007
|
expect(bailResult).to.equal(false);
|
|
1073
1008
|
expect(logErrorStub.called).to.equal(shouldErrorBeLogged);
|
|
@@ -1108,7 +1043,7 @@ describe('adpod.js', function () {
|
|
|
1108
1043
|
|
|
1109
1044
|
it('when requireExactDuration is true', function() {
|
|
1110
1045
|
let goodBid = utils.deepClone(basicBid);
|
|
1111
|
-
checkVideoBidSetupHook(callbackFn, goodBid,
|
|
1046
|
+
checkVideoBidSetupHook(callbackFn, goodBid, adUnitWithExact, adUnitWithExact.mediaTypes.video, ADPOD);
|
|
1112
1047
|
|
|
1113
1048
|
expect(callbackResult).to.be.null;
|
|
1114
1049
|
expect(goodBid.video.durationBucket).to.equal(30);
|
|
@@ -1117,7 +1052,7 @@ describe('adpod.js', function () {
|
|
|
1117
1052
|
|
|
1118
1053
|
let badBid = utils.deepClone(basicBid);
|
|
1119
1054
|
badBid.video.durationSeconds = 14;
|
|
1120
|
-
checkVideoBidSetupHook(callbackFn, badBid,
|
|
1055
|
+
checkVideoBidSetupHook(callbackFn, badBid, adUnitWithExact, adUnitWithExact.mediaTypes.video, ADPOD);
|
|
1121
1056
|
|
|
1122
1057
|
expect(callbackResult).to.be.null;
|
|
1123
1058
|
expect(badBid.video.durationBucket).to.be.undefined;
|
|
@@ -1127,7 +1062,7 @@ describe('adpod.js', function () {
|
|
|
1127
1062
|
|
|
1128
1063
|
it('when requireExactDuration is false and bids are bucketed properly', function() {
|
|
1129
1064
|
function testRoundingForGoodBId(bid, bucketValue) {
|
|
1130
|
-
checkVideoBidSetupHook(callbackFn, bid,
|
|
1065
|
+
checkVideoBidSetupHook(callbackFn, bid, adUnitNoExact, adUnitNoExact.mediaTypes.video, ADPOD);
|
|
1131
1066
|
expect(callbackResult).to.be.null;
|
|
1132
1067
|
expect(bid.video.durationBucket).to.equal(bucketValue);
|
|
1133
1068
|
expect(bailResult).to.equal(true);
|
|
@@ -1157,7 +1092,7 @@ describe('adpod.js', function () {
|
|
|
1157
1092
|
|
|
1158
1093
|
it('when requireExactDuration is false and bid duration exceeds listed buckets', function() {
|
|
1159
1094
|
function testRoundingForBadBid(bid) {
|
|
1160
|
-
checkVideoBidSetupHook(callbackFn, bid,
|
|
1095
|
+
checkVideoBidSetupHook(callbackFn, bid, adUnitNoExact, adUnitNoExact.mediaTypes.video, ADPOD);
|
|
1161
1096
|
expect(callbackResult).to.be.null;
|
|
1162
1097
|
expect(bid.video.durationBucket).to.be.undefined;
|
|
1163
1098
|
expect(bailResult).to.equal(false);
|
|
@@ -556,6 +556,33 @@ describe('AppNexusAdapter', function () {
|
|
|
556
556
|
config.getConfig.restore();
|
|
557
557
|
});
|
|
558
558
|
|
|
559
|
+
it('adds auction level keywords to request when set', function() {
|
|
560
|
+
let bidRequest = Object.assign({}, bidRequests[0]);
|
|
561
|
+
sinon
|
|
562
|
+
.stub(config, 'getConfig')
|
|
563
|
+
.withArgs('appnexusAuctionKeywords')
|
|
564
|
+
.returns({
|
|
565
|
+
gender: 'm',
|
|
566
|
+
music: ['rock', 'pop'],
|
|
567
|
+
test: ''
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
const request = spec.buildRequests([bidRequest]);
|
|
571
|
+
const payload = JSON.parse(request.data);
|
|
572
|
+
|
|
573
|
+
expect(payload.keywords).to.deep.equal([{
|
|
574
|
+
'key': 'gender',
|
|
575
|
+
'value': ['m']
|
|
576
|
+
}, {
|
|
577
|
+
'key': 'music',
|
|
578
|
+
'value': ['rock', 'pop']
|
|
579
|
+
}, {
|
|
580
|
+
'key': 'test'
|
|
581
|
+
}]);
|
|
582
|
+
|
|
583
|
+
config.getConfig.restore();
|
|
584
|
+
});
|
|
585
|
+
|
|
559
586
|
it('should attach native params to the request', function () {
|
|
560
587
|
let bidRequest = Object.assign({},
|
|
561
588
|
bidRequests[0],
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
import { spec, BIDDER_CODE, API_ENDPOINT, HEADER_AOTTER_VERSION } from 'modules/asealBidAdapter.js';
|
|
3
|
+
import { newBidder } from 'src/adapters/bidderFactory.js';
|
|
4
|
+
import { config } from 'src/config.js';
|
|
5
|
+
|
|
6
|
+
const TEST_CLIENT_ID = 'TEST_CLIENT_ID'
|
|
7
|
+
|
|
8
|
+
describe('asealBidAdapter', () => {
|
|
9
|
+
const adapter = newBidder(spec);
|
|
10
|
+
|
|
11
|
+
describe('inherited functions', () => {
|
|
12
|
+
it('exists and is a function', () => {
|
|
13
|
+
expect(adapter.callBids).to.exist.and.to.be.a('function')
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
describe('isBidRequestValid', () => {
|
|
18
|
+
const bid = {
|
|
19
|
+
bidder: 'aseal',
|
|
20
|
+
params: {
|
|
21
|
+
placeUid: '123'
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
it('should return true when required params found', () => {
|
|
26
|
+
expect(spec.isBidRequestValid(bid)).to.equal(true)
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should return false when required param placeUid is not passed', () => {
|
|
30
|
+
bid.params = {
|
|
31
|
+
placeUid: ''
|
|
32
|
+
}
|
|
33
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false)
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it('should return false when required param placeUid is wrong type', () => {
|
|
37
|
+
bid.params = {
|
|
38
|
+
placeUid: null
|
|
39
|
+
}
|
|
40
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false)
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should return false when required params are not passed', () => {
|
|
44
|
+
let bid = Object.assign({}, bid);
|
|
45
|
+
delete bid.params;
|
|
46
|
+
bid.params = {};
|
|
47
|
+
expect(spec.isBidRequestValid(bid)).to.equal(false)
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
describe('buildRequests', () => {
|
|
52
|
+
afterEach(() => {
|
|
53
|
+
config.resetConfig();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('should return an empty array when there are no bid requests', () => {
|
|
57
|
+
const bidRequests = []
|
|
58
|
+
const request = spec.buildRequests(bidRequests)
|
|
59
|
+
|
|
60
|
+
expect(request).to.be.an('array').that.is.empty
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('should send `x-aotter-clientid` header as empty string when user not set config `clientId`', () => {
|
|
64
|
+
const bidRequests = [{
|
|
65
|
+
bidder: BIDDER_CODE,
|
|
66
|
+
params: {
|
|
67
|
+
placeUid: '123'
|
|
68
|
+
}
|
|
69
|
+
}]
|
|
70
|
+
|
|
71
|
+
const bidderRequest = {}
|
|
72
|
+
const request = spec.buildRequests(bidRequests, bidderRequest)[0];
|
|
73
|
+
|
|
74
|
+
expect(request.options.customHeaders['x-aotter-clientid']).equal('')
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
it('should send bid requests to ENDPOINT via POST', () => {
|
|
78
|
+
const bidRequests = [{
|
|
79
|
+
bidder: BIDDER_CODE,
|
|
80
|
+
params: {
|
|
81
|
+
placeUid: '123'
|
|
82
|
+
}
|
|
83
|
+
}]
|
|
84
|
+
|
|
85
|
+
const bidderRequest = {
|
|
86
|
+
refererInfo: {
|
|
87
|
+
referer: 'https://aseal.in/',
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
config.setConfig({
|
|
92
|
+
aseal: {
|
|
93
|
+
clientId: TEST_CLIENT_ID
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
const request = spec.buildRequests(bidRequests, bidderRequest)[0];
|
|
97
|
+
|
|
98
|
+
expect(request.url).to.equal(API_ENDPOINT);
|
|
99
|
+
expect(request.method).to.equal('POST')
|
|
100
|
+
expect(request.options).deep.equal({
|
|
101
|
+
contentType: 'application/json',
|
|
102
|
+
withCredentials: true,
|
|
103
|
+
customHeaders: {
|
|
104
|
+
'x-aotter-clientid': TEST_CLIENT_ID,
|
|
105
|
+
'x-aotter-version': HEADER_AOTTER_VERSION,
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
expect(request.data).deep.equal({
|
|
109
|
+
bids: bidRequests,
|
|
110
|
+
refererInfo: bidderRequest.refererInfo,
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe('interpretResponse', () => {
|
|
116
|
+
it('should return an empty array when there are no bids', () => {
|
|
117
|
+
const serverResponse = {}
|
|
118
|
+
const response = spec.interpretResponse(serverResponse);
|
|
119
|
+
|
|
120
|
+
expect(response).is.an('array').that.is.empty;
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('should get correct bid response', () => {
|
|
124
|
+
const serverResponse = {
|
|
125
|
+
body: [{
|
|
126
|
+
requestId: '2ef08f145b7a4f',
|
|
127
|
+
cpm: 3,
|
|
128
|
+
width: 300,
|
|
129
|
+
height: 250,
|
|
130
|
+
creativeId: '123abc',
|
|
131
|
+
dealId: '123abc',
|
|
132
|
+
currency: 'USD',
|
|
133
|
+
netRevenue: false,
|
|
134
|
+
mediaType: 'banner',
|
|
135
|
+
ttl: 300,
|
|
136
|
+
ad: '<!-- adtag -->'
|
|
137
|
+
}]
|
|
138
|
+
}
|
|
139
|
+
const response = spec.interpretResponse(serverResponse);
|
|
140
|
+
|
|
141
|
+
expect(response).deep.equal(serverResponse.body);
|
|
142
|
+
});
|
|
143
|
+
})
|
|
144
|
+
});
|