Skip to content

Commit

Permalink
Pass experiment channel via the AmpRuntimeTypeParam (#24723)
Browse files Browse the repository at this point in the history
* read param

* add mod/nomod
  • Loading branch information
zhouyx committed Sep 26, 2019
1 parent 3b85257 commit a6429e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ads/google/a4a/test/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,14 @@ describe('Google A4A utils', () => {
})
).to.equal('1');
});
it('should specify that this is experimentA', () => {
expect(
getAmpRuntimeTypeParameter({
AMP_CONFIG: {type: 'experimentA'},
location: {origin: 'https://www-example-com.cdn.ampproject.org'},
})
).to.equal('10');
});
it('should not have `art` parameter when AMP_CONFIG is undefined', () => {
expect(
getAmpRuntimeTypeParameter({
Expand Down
5 changes: 5 additions & 0 deletions ads/google/a4a/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,11 @@ export function getBinaryTypeNumericalCode(type) {
'control': '1',
'canary': '2',
'rc': '3',
'experimentA': '10',
'experimentB': '11',
'experimentC': '12',
'nomod': '42',
'mod': '43',
}[type] || null
);
}
Expand Down

0 comments on commit a6429e7

Please sign in to comment.