Skip to content

Commit

Permalink
Force upgrade sticky ad to 1.0 (#9042)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouyx authored May 4, 2017
1 parent 2feb7c2 commit eda6d7c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/amp-sticky-ad/0.1/test/test-amp-sticky-ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import '../amp-sticky-ad';
import '../../../amp-ad/0.1/amp-ad';
import {poll} from '../../../../testing/iframe';

describes.realWin('amp-sticky-ad 0.1 version', {
describes.realWin.skip('amp-sticky-ad 0.1 version', {
win: { /* window spec */
location: '...',
historyOff: false,
Expand Down Expand Up @@ -284,7 +284,7 @@ describes.realWin('amp-sticky-ad 0.1 version', {
});


describes.realWin('amp-sticky-ad 0.1 with real ad child', {
describes.realWin.skip('amp-sticky-ad 0.1 with real ad child', {
win: { /* window spec */
location: '...',
historyOff: false,
Expand Down
9 changes: 9 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,15 @@ function buildExtension(name, version, hasCss, options, opt_extraGlobs) {
options = options || {};
options.extraGlobs = opt_extraGlobs;
var path = 'extensions/' + name + '/' + version;
if (name == 'amp-sticky-ad' && version == '0.1') {
// Special case for amp-sticky-ad force upgrade from v0.1 to v1.0
// to provide better UX. (related issue #6169).
// To deprecate 0.1, replace the build path so that amp-sticky-ad-0.1.js
// is built from extensions/amp-sticky-ad/1.0/amp-sticky-ad.js
// NOTE: The upgrade happens here to provide backward compatibility
// to existing pages with amp-sticky-ad 0.1 script.
path = 'extensions/' + name + '/1.0';
}
var jsPath = path + '/' + name + '.js';
var jsTestPath = path + '/test/' + 'test-' + name + '.js';
if (argv.files && options.bundleOnlyIfListedInFiles) {
Expand Down
4 changes: 4 additions & 0 deletions testing/describes.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ function describeEnv(factory) {
return templateFunc(name, spec, fn, describe./*OK*/only);
};

mainFunc.skip = function(name, variants, fn) {
return templateFunc(name, variants, fn, describe.skip);
};

return mainFunc;
}

Expand Down

0 comments on commit eda6d7c

Please sign in to comment.