Skip to content

Commit

Permalink
Merge branch 'master' into owners-comment
Browse files Browse the repository at this point in the history
  • Loading branch information
rcebulko committed Sep 23, 2019
2 parents 7d23951 + 1c1e722 commit cd80a8d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 32 deletions.
60 changes: 35 additions & 25 deletions build-system/tasks/e2e/describes-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const {PuppeteerController} = require('./puppeteer-controller');
const SUB = ' ';
const TEST_TIMEOUT = 40000;
const SETUP_TIMEOUT = 30000;
const SETUP_RETRIES = 1;
const DEFAULT_E2E_INITIAL_RECT = {width: 800, height: 600};
const supportedBrowsers = new Set(['chrome', 'firefox', 'safari']);
/**
Expand Down Expand Up @@ -410,7 +411,7 @@ function describeEnv(factory) {
this.timeout(TEST_TIMEOUT);
beforeEach(async function() {
this.timeout(SETUP_TIMEOUT);
await fixture.setup(env, browserName);
await fixture.setup(env, browserName, SETUP_RETRIES);

// don't install for CI
if (!isTravisBuild()) {
Expand Down Expand Up @@ -479,34 +480,43 @@ class EndToEndFixture {
/**
* @param {!Object} env
* @param {string} browserName
* @param {number} retries
*/
async setup(env, browserName) {
const {testUrl, experiments = [], initialRect, deviceName} = this.spec;
const config = getConfig();
const controller = await getController(config, browserName, deviceName);
const ampDriver = new AmpDriver(controller);
env.controller = controller;
env.ampDriver = ampDriver;

const {environment} = env;

const url = new URL(testUrl);
if (experiments.length > 0) {
if (environment.includes('inabox')) {
// inabox experiments are toggled at server side using <meta> tag
url.searchParams.set('exp', experiments.join(','));
} else {
// AMP doc experiments are toggled via cookies
await toggleExperiments(ampDriver, url.href, experiments);
async setup(env, browserName, retries = 0) {
try {
const {testUrl, experiments = [], initialRect, deviceName} = this.spec;
const config = getConfig();
const controller = await getController(config, browserName, deviceName);
const ampDriver = new AmpDriver(controller);
env.controller = controller;
env.ampDriver = ampDriver;

const {environment} = env;

const url = new URL(testUrl);
if (experiments.length > 0) {
if (environment.includes('inabox')) {
// inabox experiments are toggled at server side using <meta> tag
url.searchParams.set('exp', experiments.join(','));
} else {
// AMP doc experiments are toggled via cookies
await toggleExperiments(ampDriver, url.href, experiments);
}
}
}

if (initialRect) {
const {width, height} = initialRect;
await controller.setWindowRect({width, height});
}
if (initialRect) {
const {width, height} = initialRect;
await controller.setWindowRect({width, height});
}

await ampDriver.navigateToEnvironment(environment, url.href);
await ampDriver.navigateToEnvironment(environment, url.href);
} catch (ex) {
if (retries > 0) {
await this.setup(env, browserName, --retries);
} else {
throw ex;
}
}
}

async teardown(env) {
Expand Down
7 changes: 2 additions & 5 deletions extensions/amp-autocomplete/amp-autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,8 @@ Example:
</tr>
<tr>
<td width="40%"><strong>src (optional)</strong></td>
<td>The URL of the remote endpoint that returns the JSON that will be filtered and rendered within this <code>amp-autocomplete</code>. This must be a CORS HTTP service and the URL's protocol must be HTTPS. The endpoint must implement the requirements specified in the <a href="https://amp.dev/documentation/guides-and-tutorials/learn/amp-caches-and-cors/amp-cors-requests?referrer=ampproject.org">CORS Requests in AMP</a> spec.

The src attribute may be omitted if the <code>[src]</code> attribute exists.

If fetching the data at the src URL fails, the <code><amp-autocomplete></code> triggers a fallback.</td>
<td>The URL of the remote endpoint that returns the JSON that will be filtered and rendered within this <code>amp-autocomplete</code>. This must be a CORS HTTP service and the URL's protocol must be HTTPS. The endpoint must implement the requirements specified in the <a href="https://amp.dev/documentation/guides-and-tutorials/learn/amp-caches-and-cors/amp-cors-requests?referrer=ampproject.org">CORS Requests in AMP</a> spec. If fetching the data at the src URL fails, the <code>amp-autocomplete</code> triggers a fallback. The src attribute may be omitted if the <code>[src]</code> attribute exists.
</td>
</tr>
<tr>
<td width="40%"><strong>filter-expr (optional)</strong></td>
Expand Down
5 changes: 3 additions & 2 deletions extensions/amp-story/OWNERS.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# For an explanation of the OWNERS.yaml rules and syntax, see:
# https://github.com/ampproject/amp-github-apps/blob/master/owners/OWNERS.example.yaml

- gmajoulet
- newmuis
- "#gmajoulet"
- "#newmuis"
- Enriqe

0 comments on commit cd80a8d

Please sign in to comment.