Skip to content

Commit

Permalink
Updated the testing package with the latest updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
ix-certification committed Sep 7, 2018
1 parent 496c229 commit dd8aa58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ function noop(){}function Promise(e){if("object"!=typeof this)throw new TypeErro
},{"gpt-clear-targeting.js":"/wrapper/src/modules/gpt-layer/gpt-clear-targeting.js","gpt-helper.js":"/wrapper/src/libs/gpt-helper.js","gpt-map-slots.js":"/wrapper/src/modules/gpt-layer/gpt-map-slots.js","gpt-set-targeting.js":"/wrapper/src/modules/gpt-layer/gpt-set-targeting.js","prms.js":"/wrapper/src/libs/external/prms.js","space-camp.js":"/wrapper/src/space-camp.js","whoopsie.js":"/wrapper/src/libs/whoopsie.js"}],"/wrapper/src/modules/gpt-layer/gpt-set-targeting.js":[function(require,module,exports){
"use strict";function GptSetTargeting(e,t){function r(e,r){for(var i=0;i<r.length;i++)if(!r[i].pass&&r[i].targeting&&!Utilities.isEmpty(r[i].targeting)){"slot"===r[i].targetingType&&EventsService.emit("hs_slot_kv_pushed",{sessionId:e,statsId:r[i].partnerStatsId,htSlotId:r[i].htSlot.getId(),requestId:r[i].requestId,xSlotNames:[r[i].xSlotName]});var s,a=r[i].targeting;for(var g in a)if(a.hasOwnProperty(g))if("page"===r[i].targetingType)s=t.pageDemandHistory,s[g]=s[g]||{},s[g]=!0,window.googletag.pubads().setTargeting(g,a[g]);else{var n=r[i].ref,o=n.getSlotElementId();s=t.gSlotDemandHistory,s[o]=s[o]||{},s[o][g]=!0,n.setTargeting(g,n.getTargeting(g).concat(a[g]))}}}return function(){EventsService=SpaceCamp.services.EventsService,t.gSlotDemandHistory=t.gSlotDemandHistory||{},t.pageDemandHistory=t.pageDemandHistory||{}}(),{setTargeting:r}}var GptHelper=require("gpt-helper.js"),SpaceCamp=require("space-camp.js"),Utilities=require("utilities.js"),Whoopsie=require("whoopsie.js"),EventsService;module.exports=GptSetTargeting;
},{"gpt-helper.js":"/wrapper/src/libs/gpt-helper.js","space-camp.js":"/wrapper/src/space-camp.js","utilities.js":"/wrapper/src/libs/utilities.js","whoopsie.js":"/wrapper/src/libs/whoopsie.js"}],"/wrapper/src/modules/partners-layer/dynamic-partner-loader/dynamic-partner-loader.js":[function(require,module,exports){
"use strict";function DynamicPartnerLoader(e){function r(e){return-1!==e.indexOf("validator.js")?System.noOp:c[e]}function s(){var e=window.adapter.configs,s={};window.adapter.bidder(r,s),n=s.exports(e)}function i(e,r){return n.retrieve(e,r)}var t,a,n,c={"browser.js":require("browser.js"),"cache.js":require("cache.js"),"classify.js":require("classify.js"),"command-queue.js":require("command-queue.js"),"config-validators.js":require("config-validators.js"),"constants.js":require("constants.js"),"device-type-checker.js":require("device-type-checker.js"),"network.js":require("network.js"),"openrtb.js":require("openrtb.js"),"openrtb2_5.js":require("openrtb2_5.js"),"partner.js":require("partner.js"),"scribe.js":require("scribe.js"),"size.js":require("size.js"),"space-camp.js":require("space-camp.js"),"system.js":require("system.js"),"utilities.js":require("utilities.js"),"whoopsie.js":require("whoopsie.js")};!function(){t={partnerId:"DynamicPartnerLoader",namespace:"DynamicPartnerLoader",statsId:"DYNLDR",version:"1.0.0",targetingType:"slot",enabledAnalytics:{requestTime:!0},features:{demandExpiry:{enabled:!1,value:0},rateLimiting:{enabled:!1,value:0}},targetingKeys:{id:"ix_dyn_id",om:"ix_dyn_cpm",pm:"ix_dyn_cpm",pmid:"ix_dyn_dealid"},bidUnitInCents:1,lineItemType:Constants.LineItemTypes.ID_AND_SIZE,callbackType:Partner.CallbackTypes.ID,architecture:Partner.Architectures.SRA,requestType:Partner.RequestTypes.ANY},s();var r=n.getPartnerId();t.namespace=r,a=Partner(t,e,null,{retriever:i});var c=n.getDirectInterface();if(c.hasOwnProperty(r))for(var o in c[r])c[r].hasOwnProperty(o)&&a._addToDirectInterface(o,c[r][o])}();var o={__baseClass:a,profile:t};return Classify.derive(a,o)}var Classify=require("classify.js"),Constants=require("constants.js"),Partner=require("partner.js"),System=require("system");module.exports=DynamicPartnerLoader;
"use strict";function DynamicPartnerLoader(e){function r(e){return-1!==e.indexOf("validator.js")?System.noOp:c[e]}function s(){var e=window.adapter.configs,s={exports:{}};window.adapter.bidder(r,s,s.exports),n=s.exports(e)}function t(e,r){return n.retrieve(e,r)}var i,a,n,c={"browser.js":require("browser.js"),"cache.js":require("cache.js"),"classify.js":require("classify.js"),"command-queue.js":require("command-queue.js"),"config-validators.js":require("config-validators.js"),"constants.js":require("constants.js"),"device-type-checker.js":require("device-type-checker.js"),"network.js":require("network.js"),"openrtb.js":require("openrtb.js"),"openrtb2_5.js":require("openrtb2_5.js"),"partner.js":require("partner.js"),"scribe.js":require("scribe.js"),"size.js":require("size.js"),"space-camp.js":require("space-camp.js"),"system.js":require("system.js"),"utilities.js":require("utilities.js"),"whoopsie.js":require("whoopsie.js")};!function(){i={partnerId:"DynamicPartnerLoader",namespace:"DynamicPartnerLoader",statsId:"DYNLDR",version:"1.0.0",targetingType:"slot",enabledAnalytics:{requestTime:!0},features:{demandExpiry:{enabled:!1,value:0},rateLimiting:{enabled:!1,value:0}},targetingKeys:{id:"ix_dyn_id",om:"ix_dyn_cpm",pm:"ix_dyn_cpm",pmid:"ix_dyn_dealid"},bidUnitInCents:1,lineItemType:Constants.LineItemTypes.ID_AND_SIZE,callbackType:Partner.CallbackTypes.ID,architecture:Partner.Architectures.SRA,requestType:Partner.RequestTypes.ANY},s();var r=n.getPartnerId();i.namespace=r,a=Partner(i,e,null,{retriever:t});var c=n.getDirectInterface();if(c.hasOwnProperty(r))for(var o in c[r])c[r].hasOwnProperty(o)&&a._addToDirectInterface(o,c[r][o])}();var o={__baseClass:a,profile:i};return Classify.derive(a,o)}var Classify=require("classify.js"),Constants=require("constants.js"),Partner=require("partner.js"),System=require("system");module.exports=DynamicPartnerLoader;
},{"browser.js":"/wrapper/src/libs/browser.js","cache.js":"/wrapper/src/libs/cache.js","classify.js":"/wrapper/src/libs/classify.js","command-queue.js":"/wrapper/src/libs/command-queue.js","config-validators.js":"/wrapper/src/libs/config-validators.js","constants.js":"/wrapper/src/libs/constants.js","device-type-checker.js":"/wrapper/src/libs/device-type-checker.js","network.js":"/wrapper/src/libs/network.js","openrtb.js":"/wrapper/src/libs/openrtb.js","openrtb2_5.js":"/wrapper/src/libs/openrtb2_5.js","partner.js":"/wrapper/src/modules/partners-layer/partner.js","scribe.js":"/wrapper/src/libs/scribe.js","size.js":"/wrapper/src/libs/size.js","space-camp.js":"/wrapper/src/space-camp.js","system":"/wrapper/src/libs/system.js","system.js":"/wrapper/src/libs/system.js","utilities.js":"/wrapper/src/libs/utilities.js","whoopsie.js":"/wrapper/src/libs/whoopsie.js"}],"/wrapper/src/modules/partners-layer/partner.js":[function(require,module,exports){
"use strict";function Partner(e,t,r,n){function a(e){return function(t){C[e]=t,delete k[e]}}function i(e,t,r){for(var n in r)if(r.hasOwnProperty(n))for(var a in r[n])r[n].hasOwnProperty(a)&&r[n][a].length&&EventsService.emit(t,{sessionId:e,statsId:y.statsId,htSlotId:n,requestId:a,xSlotNames:r[n][a]})}function s(e,r){var n={};return"price"===e&&(n={outputCentsDivisor:1,outputPrecision:0,roundingType:"NONE"}),Utilities.mergeObjects(O[e],{bidUnitInCents:y.bidUnitInCents},r||{},t.bidTransformer||{},n)}function o(e){var t=[];y.architecture===Partner.Architectures.FSRA&&t.push([]);for(var r={},n=0;n<e.length;n++){var a=e[n].htSlot.getName();if(_.mapping.hasOwnProperty(a))for(var i="_"+System.generateUniqueId(),s=0;s<_.mapping[a].length;s++){var o={},u=_.mapping[a][s];o.partnerId=y.partnerId,o.partnerStatsId=y.statsId,o.htSlot=e[n].htSlot,o.ref=e[n].ref,o.xSlotRef=_.xSlots[u],o.xSlotName=u,o.requestId=i,e[n].firstPartyData&&(o.firstPartyData=e[n].firstPartyData),e[n].identityData&&(o.identityData=e[n].identityData),y.architecture===Partner.Architectures.MRA?t.push([o]):y.architecture===Partner.Architectures.FSRA?t[0].push(o):(r.hasOwnProperty(u)||(r[u]=0),t.length<r[u]+1&&t.push([]),t[r[u]].push(o),r[u]++)}}return t}function u(e,t){if(0===t.length)return Prms.resolve([]);var r=b(t,e);y.callbackType===Partner.CallbackTypes.CALLBACK_NAME&&(k[r.callbackId]=a(r.callbackId));var n={};if(y.enabledAnalytics.requestTime){for(var s=0;s<t.length;s++){var o=t[s],u=o.htSlot.getId(),p=o.requestId;n.hasOwnProperty(u)||(n[u]={}),n[u].hasOwnProperty(p)||(n[u][p]=[]),n[u][p].push(o.xSlotName)}i(e,"hs_slot_request",n)}return new Prms(function(a){EventsService.emit("partner_request_sent",{partner:y.partnerId});var s,o,u={url:r.url,data:r.data,method:"GET",timeout:_.timeout,withCredentials:!0,jsonp:!0,sessionId:e,globalTimeout:!0,continueAfterTimeout:!0,onSuccess:function(o,u,p){var c,l="success";try{y.callbackType===Partner.CallbackTypes.NONE?c=JSON.parse(o):(o&&eval.call(null,o),c=C[r.callbackId],delete C[r.callbackId]),p&&!y.parseAfterTimeout||T(e,c,t,n,s,u,p)}catch(t){EventsService.emit("internal_error",y.partnerId+" error parsing demand: "+t,t.stack),l="error",y.enabledAnalytics.requestTime&&!p&&i(e,"hs_slot_error",n)}EventsService.emit("partner_request_complete",{partner:y.partnerId,status:l}),a(t)},onTimeout:function(){EventsService.emit("partner_request_complete",{partner:y.partnerId,status:"timeout"}),y.enabledAnalytics.requestTime&&i(e,"hs_slot_timeout",n),a(t)},onFailure:function(){EventsService.emit("partner_request_complete",{partner:y.partnerId,status:"error"}),y.enabledAnalytics.requestTime&&i(e,"hs_slot_error",n),a(t)}};o=r.networkParamOverrides?Utilities.mergeObjects(u,r.networkParamOverrides):u,y.callbackType!==Partner.CallbackTypes.NONE&&y.requestType!==Partner.RequestTypes.AJAX||(o.jsonp=!1),s=y.requestType===Partner.RequestTypes.JSONP?Network.jsonp(o):Network.ajax(o)})}function p(e){q.push(e)}function c(){return h}function l(e){__directInterface={},__directInterface[y.namespace]=e}function m(e,t){__directInterface[y.namespace][e]=t}function d(){return y.partnerId}function v(){return __directInterface}function g(){return y.features.prefetchDisabled&&y.features.prefetchDisabled.enabled}function f(e,t){if(t=t.slice(),_.rateLimiting.enabled){var r=System.now();if("page"===y.targetingType){if(r<=P)return[];P=r+_.rateLimiting.value}else for(var n=t.length-1;n>=0;n--){var a=t[n].htSlot.getName();I.hasOwnProperty(a)&&r<=I[a]?t.splice(n,1):I[a]=r+_.rateLimiting.value}}if(!t.length)return[];if(S)return S(e,t);for(var i=o(t),s=[],p=0;p<i.length;p++)s.push(u(e,i[p]));return s}var y,h,P,I,__directInterface,S,b,T,O,_,q,C,A,w,k;return function(){if(EventsService=SpaceCamp.services.EventsService,RenderService=SpaceCamp.services.RenderService,O={targeting:{bidUnitInCents:1,outputCentsDivisor:1,outputPrecision:0,roundingType:"FLOOR",floor:0,buckets:[{max:2e3,step:5},{max:5e3,step:100}]},price:{bidUnitInCents:1}},y=e,P=0,I={},q=[],k={},C={},_={timeout:0,lineItemType:e.lineItemType,targetingKeys:e.targetingKeys,rateLimiting:e.features.rateLimiting},t.hasOwnProperty("timeout")&&t.timeout>0&&(_.timeout=t.timeout,EventsService.emit("hs_define_partner_timeout",{timeout:_.timeout,statsId:y.statsId})),t.hasOwnProperty("targetingKeyOverride"))for(var a in t.targetingKeyOverride)t.targetingKeyOverride.hasOwnProperty(a)&&_.targetingKeys.hasOwnProperty(a)&&(_.targetingKeys[a]=t.targetingKeyOverride[a]);if(t.hasOwnProperty("rateLimiting")&&(t.rateLimiting.hasOwnProperty("enabled")&&(_.rateLimiting.enabled=t.rateLimiting.enabled),t.rateLimiting.value&&(_.rateLimiting.value=t.rateLimiting.value)),t.hasOwnProperty("lineItemType")&&(_.lineItemType=Constants.LineItemTypes[t.lineItemType]),_.xSlots=t.xSlots,_.mapping=t.mapping,h=!1,r){Utilities.isArray(r)||(r=[r]);var i=[];r.map(function(e){var t=Prms.defer();i.push(t.promise),Network.jsonp({url:e,onSuccess:function(){t.resolve()}})}),Prms.all(i).then(function(){h=!0,EventsService.emit("partner_instantiated",{partner:y.partnerId}),q=CommandQueue(q)})}else EventsService.emit("partner_instantiated",{partner:y.partnerId}),h=!0;RenderService.registerPartner(y.partnerId,_.lineItemType,_.targetingKeys.id),A={},e.hasOwnProperty("bidUnitInCents")&&(A.targeting=BidTransformer(s("targeting")),A.price=BidTransformer(s("price"))),n.retriever?S=n.retriever:(T=n.parseResponse,b=n.generateRequestObj,w=n.adResponseCallback),__directInterface={},__directInterface.hasOwnProperty(y.namespace)||(__directInterface[y.namespace]={}),y.callbackType===Partner.CallbackTypes.ID?__directInterface[y.namespace].adResponseCallback=w:__directInterface[y.namespace].adResponseCallbacks=k}(),{_configs:_,_adResponseStore:C,_bidTransformers:A,_setDirectInterface:l,_addToDirectInterface:m,_generateReturnParcels:o,_emitStatsEvent:i,_pushToCommandQueue:p,_generateBidTransformerConfig:s,getPartnerId:d,getDirectInterface:v,getPrefetchDisabled:g,isReady:c,retrieve:f}}var BidTransformer=require("bid-transformer.js"),CommandQueue=require("command-queue.js"),Constants=require("constants.js"),Network=require("network.js"),Prms=require("prms.js"),SpaceCamp=require("space-camp.js"),System=require("system.js"),Utilities=require("utilities.js"),Whoopsie=require("whoopsie.js"),EventsService,RenderService;Partner.Architectures={MRA:0,SRA:1,FSRA:2},Partner.CallbackTypes={ID:0,CALLBACK_NAME:1,NONE:2},Partner.RequestTypes={ANY:0,AJAX:1,JSONP:2},module.exports=Partner;
},{"bid-transformer.js":"/wrapper/src/libs/bid-transformer.js","command-queue.js":"/wrapper/src/libs/command-queue.js","constants.js":"/wrapper/src/libs/constants.js","network.js":"/wrapper/src/libs/network.js","prms.js":"/wrapper/src/libs/external/prms.js","space-camp.js":"/wrapper/src/space-camp.js","system.js":"/wrapper/src/libs/system.js","utilities.js":"/wrapper/src/libs/utilities.js","whoopsie.js":"/wrapper/src/libs/whoopsie.js"}],"/wrapper/src/modules/partners-layer/prefetch.js":[function(require,module,exports){
Expand Down Expand Up @@ -3094,7 +3094,7 @@ describe('System Tests: Partner', function () {
// Add the filtering mechanism to the server's fake XHR instance so that
// it only captures and fakes explicitly configured URLs.
xhrFilter = XhrFilter.install(server.xhr);
xhrFilter.register(partnerId, 'bidRequest', window.testCases.getRequestRegex());
xhrFilter.register(partnerId, 'bidRequest', window.testCases.getBidRequestRegex());

// SpaceCamp needs to be reset on every instantiation of the wrapper
// because it is just an object. It carries values between test
Expand Down Expand Up @@ -3170,6 +3170,7 @@ describe('System Tests: Partner', function () {

});

// Update the base configs for this test.
baseConfig.partners.DynamicPartnerLoader.enabled = true;

window.adapter = window.adapter || {};
Expand Down Expand Up @@ -3287,7 +3288,7 @@ describe('System Tests: Partner', function () {

var gSlots = gptPage.getSlotsMap();

window.testCases.validateTargeting(gSlots);
window.testCases.validateTargeting(gSlots.divIdA.getTargetingMap());

done();

Expand Down Expand Up @@ -3508,7 +3509,7 @@ describe('System Tests: Partner', function () {

var gSlots = gptPage.getSlotsMap();

window.testCases.validateTargetingWithDeal(gSlots);
window.testCases.validateTargetingWithDeal(gSlots.divIdA.getTargetingMap());

done();

Expand All @@ -3529,7 +3530,7 @@ describe('System Tests: Partner', function () {

});

describe('Pass', function () {
describe('Passes', function () {

it('should not set targeting', function (done) {

Expand Down
6 changes: 2 additions & 4 deletions app/public/tester/system-tester.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

<link href="http://localhost:9876/favicon.ico" rel="icon" type="image/x-icon">

<title>System Test Runner (Karma)</title>

<script type="text/javascript" src="/public/debugger/js/external/jquery.js"></script>
Expand Down Expand Up @@ -38,7 +36,7 @@
'/base/node_modules/karma-jasmine-html-reporter/src/lib/html.jasmine.reporter.js': '4af523ab7bfaa86c4966fa332c4dc2bd2278b4cc',
'/base/node_modules/karma-jasmine-html-reporter/src/lib/adapter.js': '9d2c71b931979c6194d209809111ee3a72cf149b',
'/base/node_modules/sinon/pkg/sinon.js': '3466bb5639b16d4e61e2bd4a0284d156cf03783c',
'/absolute/var/folders/x3/bghtdvf53_b4hfgdrwy1n3mc0000gn/T/e5088874fd6a1a22eb1b58f2a089fb8a.browserify': 'c7a369e34f29b99568cdbbe90d8556e611997b70',
'/absolute/var/folders/x3/bghtdvf53_b4hfgdrwy1n3mc0000gn/T/0d5311cdb487b2226db51f8298d7030f.browserify': '61d87fe045860d85067fcc950da45f765f733d3a',
'/base/src/layers/direct-bidding-layer.js': '6a2d51d3b33d36b8ccb6830ba559fd259750e399',
'/base/src/layers/gpt-layer.js': 'b8e0d4dbd8209c59c1fd75ec912c2c4a2cf5800c',
'/base/src/layers/identity-layer.js': '34d4868361304b3062d298483ddd8a939e4e81d3',
Expand Down Expand Up @@ -136,7 +134,7 @@
<script type="text/javascript" src="/public/tester/assets/html.jasmine.reporter.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="/public/tester/assets/adapter(1).js" crossorigin="anonymous"></script>
<script type="text/javascript" src="/public/tester/assets/sinon.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="/public/tester/assets/e5088874fd6a1a22eb1b58f2a089fb8a.browserify" crossorigin="anonymous"></script>
<script type="text/javascript" src="/public/tester/assets/0d5311cdb487b2226db51f8298d7030f.browserify" crossorigin="anonymous"></script>
<script type="text/javascript" src="/public/tester/assets/direct-bidding-layer.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="/public/tester/assets/gpt-layer.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="/public/tester/assets/identity-layer.js" crossorigin="anonymous"></script>
Expand Down

0 comments on commit dd8aa58

Please sign in to comment.