Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 7 additions & 15 deletions build-system/global-configs/canary-config.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
{
"allow-doc-opt-in": ["amp-next-page", "analytics-chunks-inabox"],
"allow-url-opt-in": ["pump-early-frame"],
"allow-doc-opt-in": [
"amp-next-page",
"analytics-chunks-inabox"
],
"allow-url-opt-in": [
"pump-early-frame"
],
"amp-accordion-display-locking": 1,
"canary": 1,
"a4aProfilingRate": 0.01,
"adsense-ad-size-optimization": 0.1,
"amp-access-iframe": 1,
"amp-action-macro": 1,
"amp-ad-ff-adx-ady": 0.01,
"amp-auto-ads-adsense-holdout": 0.1,
"ampdoc-fie": 1,
"amp-mega-menu": 1,
"amp-nested-menu": 1,
"amp-playbuzz": 1,
"amp-sidebar-swipe-to-dismiss": 1,
"amp-story-responsive-units": 1,
"amp-story-v1": 1,
"chunked-amp": 1,
"doubleclickSraExp": 0.01,
"doubleclickSraReportExcludedBlock": 0.1,
"expand-json-targeting": 1,
"fix-inconsistent-responsive-height-selection": 0,
"fixed-elements-in-lightbox": 1,
"flexAdSlots": 0.05,
"intersect-resources": 0,
"ios-fixed-no-transfer": 1,
"pump-early-frame": 1,
"remove-task-timeout": 0,
"swg-gpay-api": 1,
"swg-gpay-native": 1,
"amp-ad-no-center-css": 0,
"render-on-idle-fix": 1,
"build-in-chunks": 1,
Expand Down
22 changes: 7 additions & 15 deletions build-system/global-configs/prod-config.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
{
"allow-doc-opt-in": ["amp-next-page", "analytics-chunks-inabox"],
"allow-url-opt-in": ["pump-early-frame"],
"allow-doc-opt-in": [
"amp-next-page",
"analytics-chunks-inabox"
],
"allow-url-opt-in": [
"pump-early-frame"
],
"canary": 0,
"a4aProfilingRate": 0.01,
"adsense-ad-size-optimization": 0.1,
"amp-access-iframe": 1,
"amp-accordion-display-locking": 1,
"amp-action-macro": 1,
"amp-ad-ff-adx-ady": 0.01,
"amp-auto-ads-adsense-holdout": 0.1,
"ampdoc-fie": 1,
"amp-mega-menu": 1,
"amp-nested-menu": 1,
"amp-playbuzz": 1,
"amp-sidebar-swipe-to-dismiss": 1,
"amp-story-responsive-units": 1,
"amp-story-v1": 1,
"chunked-amp": 1,
"doubleclickSraExp": 0.01,
"doubleclickSraReportExcludedBlock": 0.1,
"expand-json-targeting": 1,
"fix-inconsistent-responsive-height-selection": 0,
"fixed-elements-in-lightbox": 1,
"flexAdSlots": 0.05,
"intersect-resources": 0,
"ios-fixed-no-transfer": 0,
"pump-early-frame": 1,
"swg-gpay-api": 1,
"swg-gpay-native": 1,
"amp-ad-no-center-css": 0,
"adsense-ptt-exp": 0.1,
"doubleclick-ptt-exp": 0.1,
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-access/0.1/amp-access-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export class AccessSource {
}
if (
type == AccessType.IFRAME &&
!isExperimentOn(this.ampdoc.win, 'amp-access-iframe')
!(/* experiment: amp-access-iframe */ true)
) {
user().error(TAG, 'Experiment "amp-access-iframe" is not enabled.');
type = AccessType.CLIENT;
Expand Down
2 changes: 0 additions & 2 deletions extensions/amp-access/0.1/test/test-amp-access-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describes.fakeWin(

afterEach(() => {
toggleExperiment(win, 'amp-access-server', false);
toggleExperiment(win, 'amp-access-iframe', false);
});

function expectSourceType(ampdoc, config, type, adapter) {
Expand Down Expand Up @@ -114,7 +113,6 @@ describes.fakeWin(
allowConsoleError(() => {
config['type'] = 'iframe';
expectSourceType(ampdoc, config, 'client', AccessClientAdapter);
toggleExperiment(win, 'amp-access-iframe', true);
expectSourceType(ampdoc, config, 'iframe', AccessIframeAdapter);
});

Expand Down
3 changes: 2 additions & 1 deletion extensions/amp-action-macro/0.1/amp-action-macro.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export class AmpActionMacro extends AMP.BaseElement {
/** @override */
buildCallback() {
userAssert(
isExperimentOn(this.win, 'amp-action-macro'),
/* experiment: amp-action-macro */
true,
'Experiment is off'
);
const {element} = this;
Expand Down
5 changes: 0 additions & 5 deletions extensions/amp-action-macro/0.1/test/test-amp-action-macro.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ describes.realWin(
beforeEach(() => {
win = env.win;
doc = win.document;

toggleExperiment(win, 'amp-action-macro', true);
});

function newActionMacro() {
Expand All @@ -60,7 +58,6 @@ describes.realWin(

it('should not build if experiment is off', () => {
return allowConsoleError(() => {
toggleExperiment(env.win, 'amp-action-macro', false);
return newActionMacro().catch((err) => {
expect(err.message).to.include('Experiment is off');
});
Expand All @@ -75,8 +72,6 @@ describes.realWin(
let unreferrableMacro;
let unreferrableMacroElement;
beforeEach(() => {
toggleExperiment(win, 'amp-action-macro', true);

// This macro is referrable and can be invoked by the macro element(s)
// defined after it.
referrableMacroElement = doc.createElement('amp-action-macro');
Expand Down
3 changes: 2 additions & 1 deletion extensions/amp-playbuzz/0.1/amp-playbuzz.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ class AmpPlaybuzz extends AMP.BaseElement {
// EXPERIMENT
// AMP.toggleExperiment(EXPERIMENT, true); //for dev
userAssert(
isExperimentOn(this.win, 'amp-playbuzz'),
/* experiment: amp-playbuzz */
true,
'Enable amp-playbuzz experiment'
);

Expand Down
1 change: 0 additions & 1 deletion extensions/amp-playbuzz/0.1/test/test-amp-playbuzz.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ describes.realWin(
beforeEach(() => {
win = env.win;
doc = win.document;
toggleExperiment(win, 'amp-playbuzz', true);
});

function createOptionalParams(
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-sidebar/0.1/amp-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ export class AmpSidebar extends AMP.BaseElement {
* @private
*/
setupGestures_(element) {
if (!isExperimentOn(this.win, 'amp-sidebar-swipe-to-dismiss')) {
if (!(/* experiment: amp-sidebar-swipe-to-dismiss */ true)) {
return;
}
// stop propagation of swipe event inside amp-viewer
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-sidebar/0.2/amp-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ export class AmpSidebar extends AMP.BaseElement {
* @private
*/
setupGestures_(element) {
if (!isExperimentOn(this.win, 'amp-sidebar-swipe-to-dismiss')) {
if (!(/* experiment: amp-sidebar-swipe-to-dismiss */ true)) {
return;
}
// stop propagation of swipe event inside amp-viewer
Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-story/1.0/amp-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ export class AmpStory extends AMP.BaseElement {
* @private
*/
rewriteStyles_(styleEl) {
if (!isExperimentOn(this.win, 'amp-story-responsive-units')) {
if (!(/* experiment: amp-story-responsive-units */ true)) {
return;
}

Expand Down
8 changes: 2 additions & 6 deletions extensions/amp-story/1.0/test/test-amp-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -1656,13 +1656,9 @@ describes.realWin(
});

describe('amp-story rewriteStyles', () => {
beforeEach(() => {
toggleExperiment(win, 'amp-story-responsive-units', true);
});
beforeEach(() => {});

afterEach(() => {
toggleExperiment(win, 'amp-story-responsive-units', false);
});
afterEach(() => {});

it('should rewrite vw styles', async () => {
await createStoryWithPages(1, ['cover']);
Expand Down
2 changes: 1 addition & 1 deletion src/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ function maybeLoadCorrectVersion(win, fnOrStruct) {
* pumped.
*/
function maybePumpEarlyFrame(win, cb) {
if (!isExperimentOn(win, 'pump-early-frame')) {
if (!(/* experiment: pump-early-frame */ true)) {
cb();
return;
}
Expand Down
3 changes: 0 additions & 3 deletions test/unit/test-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ describes.fakeWin(
);

it('should not maybePumpEarlyFrame when body not yet present', () => {
toggleExperiment(win, 'pump-early-frame', true);
// Make document.body be null on first invocation to simulate
// JS executing before the rest of the doc has been parsed.
const {body} = win.document;
Expand All @@ -223,14 +222,12 @@ describes.fakeWin(
'should not maybePumpEarlyFrame ' +
'when a renderDelayingExtension is present',
() => {
toggleExperiment(win, 'pump-early-frame', true);
win.document.body.appendChild(document.createElement('amp-experiment'));
extensionRegistrationTest();
}
);

it('should maybePumpEarlyFrame and delay extension execution', () => {
toggleExperiment(win, 'pump-early-frame', true);
let progress = '';
const queueExtensions = win.AMP;
const highPriority = regularExtension((amp) => {
Expand Down
42 changes: 0 additions & 42 deletions tools/experiments/experiments-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ export const EXPERIMENTS = [
spec: 'https://github.com/ampproject/amphtml/issues/2934',
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/4005',
},
{
id: 'amp-access-iframe',
name: 'AMP Access iframe prototype (launched)',
spec: 'https://github.com/ampproject/amphtml/issues/13287',
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/13287',
},
{
id: 'amp-access-server',
name: 'AMP Access server side prototype',
Expand Down Expand Up @@ -89,36 +83,12 @@ export const EXPERIMENTS = [
name: 'Allows the new lightbox experience to be used in A4A (prototype).',
spec: 'https://github.com/ampproject/amphtml/issues/7743',
},
{
id: 'amp-playbuzz',
name: 'AMP extension for playbuzz items (launched)',
spec: 'https://github.com/ampproject/amphtml/issues/6106',
cleanupIssue: 'https://github.com/ampproject/amphtml/pull/6351',
},
{
id: 'amp-action-macro',
name: 'AMP extension for defining action macros',
spec: 'https://github.com/ampproject/amphtml/issues/19494',
cleanupIssue: 'https://github.com/ampproject/amphtml/pull/19495',
},
{
id: 'ios-fixed-no-transfer',
name: 'Remove fixed transfer from iOS 12.2 and up',
spec: 'https://github.com/ampproject/amphtml/issues/22220',
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/22220',
},
{
id: 'chunked-amp',
name: "Split AMP's loading phase into chunks",
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/5535',
},
{
id: 'pump-early-frame',
name:
'If applicable, let the browser paint the current frame before ' +
'executing the callback.',
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/8237',
},
{
id: 'web-worker',
name: 'Web worker for background processing',
Expand Down Expand Up @@ -150,12 +120,6 @@ export const EXPERIMENTS = [
spec: 'https://github.com/ampproject/amphtml/issues/11329',
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/14357',
},
{
id: 'amp-story-responsive-units',
name: 'Scale pages in amp-story by rewriting responsive units',
spec: 'https://github.com/ampproject/amphtml/issues/15955',
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/15960',
},
{
id: 'amp-next-page',
name: 'Document level next page recommendations and infinite scroll',
Expand Down Expand Up @@ -205,12 +169,6 @@ export const EXPERIMENTS = [
spec: 'https://github.com/ampproject/amphtml/issues/23568',
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/24165',
},
{
id: 'fix-inconsistent-responsive-height-selection',
name: 'Fix inconsistent responsive height selection.',
spec: 'https://github.com/ampproject/amphtml/issues/24166',
cleanupIssue: 'https://github.com/ampproject/amphtml/issues/24167',
},
{
id: 'intersect-resources',
name: 'Use IntersectionObserver for resource scheduling.',
Expand Down