Skip to content

Commit

Permalink
Some comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
William Chou committed Dec 18, 2018
1 parent c88e4c6 commit 816bf65
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build-system/amp4test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ app.use('/compose-doc', function(req, res) {
let experimentsBlock = '';
if (experiments) {
const string = `"${experiments.split(',').join('","')}"`;
// TODO: Why is localDev necessary?
// TODO: Why is setting localDev necessary?
// `allow-doc-opt-in` enables any experiment to be enabled via doc opt-in.
experimentsBlock =
`<script>
Expand All @@ -57,7 +57,7 @@ app.use('/compose-doc', function(req, res) {
<meta name="amp-experiments-opt-in" content="${experiments}">`;
}

// TODO: What is amp-3p-iframe-src used for?
// TODO: Do we need to inject amp-3p-iframe-src for non-ad tests?
const head =
`${experimentsBlock}
<meta name="amp-3p-iframe-src" content="http://localhost:9876/${frameHtml}">`;
Expand Down Expand Up @@ -217,7 +217,8 @@ function composeDocument(config) {
extensionScripts = extensions.map(extension => {
const src = (cdn)
? `https://cdn.ampproject.org/v0/${extension}-0.1.js`
: `/dist/v0/${extension}-0.1.${compiled ? '' : 'max.'}js`; // TODO: Use '-latest'?
// TODO: Version 0.1 is hard-coded. Use '-latest'?
: `/dist/v0/${extension}-0.1.${compiled ? '' : 'max.'}js`;
return `<script async custom-element="${extension}" src="${src}"></script>`;
}).join('\n');
}
Expand Down Expand Up @@ -269,6 +270,8 @@ function composeDocument(config) {
// To enable A4A FIE, a <script amp-ad-metadata> tag must exist.
let ampAdMeta = '';
if (amp === 'amp4ads') {
// `ampRuntimeUtf16CharOffsets` is used to cut out all runtime scripts,
// which are not needed in FIE mode.
const start = topHalfOfHtml.indexOf(runtimeScript);
let end = start + runtimeScript.length;

Expand All @@ -280,7 +283,8 @@ function composeDocument(config) {
extensionsMap = customElements.map(ce => {
return {
'custom-element': ce,
'src': `https://cdn.ampproject.org/v0/${ce}-0.1.js`, // TODO: Local?
// TODO: Should this be a local URL i.e. /dist/v0/...?
'src': `https://cdn.ampproject.org/v0/${ce}-0.1.js`,
};
});
}
Expand Down

0 comments on commit 816bf65

Please sign in to comment.