Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✅ Add integration for shadow AMP v0.js #26344

Merged

Conversation

kevinkimball
Copy link
Contributor

Adds basic integration tests that show attaching a shadow AMP document and laying out an <amp-img> component. Closes #5580

@kevinkimball kevinkimball changed the title ✅Add integration for shadow AMP v0.js ✅ Add integration for shadow AMP v0.js Jan 14, 2020
@@ -0,0 +1,33 @@
/**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.

This comment was marked as resolved.

@@ -0,0 +1,54 @@
/**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.

This comment was marked as resolved.

@@ -210,9 +210,9 @@ export class RequestBank {
}

export class BrowserController {
constructor(win) {
constructor(win, doc) {

This comment was marked as resolved.

@@ -0,0 +1,33 @@
/**

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the app code for the test subject page

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the port below and stuff, maybe it's just better to be in the integration js file itself as a string?

@@ -210,9 +210,9 @@ export class RequestBank {
}

export class BrowserController {
constructor(win) {
constructor(win, opt_doc) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit misleading. This is actually ShadowRoot or at least Document|ShadowRoot, right? Maybe then we should call it rootNode?

* @param {number=} timeout
* @return {!Promise}
*/
waitForShadowDoc(hostSelector, timeout = 10000) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waitForShadowRoot

@kevinkimball
Copy link
Contributor Author

@dvoytenko Good naming suggestions , thanks. Updated the PR

@kevinkimball kevinkimball force-pushed the shadow-amp-integration-test branch 8 times, most recently from d70ed9e to 9aee0d7 Compare January 21, 2020 18:53
this.win_ = win;
this.doc_ = this.win_.document;
this.doc_ = opt_rootNode || this.win_.document;

This comment was marked as resolved.

/**
* Serves an amp doc for test-shadow-amp.js
*/
app.get('/shadow-amp', (_req, res) =>

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other test documents seem to be loaded from this file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Ok let's keep then since it's an established pattern. Though I think it's a bit painful.

@kevinkimball kevinkimball force-pushed the shadow-amp-integration-test branch 2 times, most recently from 14591b6 to 1fb797e Compare January 22, 2020 18:45
@amp-owners-bot
Copy link

Hey @rsimha, these files were changed:

  • .vscode/settings.json

Comment on lines 28 to 35
"[markdown]": {
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change can be reverted after you sync to HEAD.

@kevinkimball kevinkimball force-pushed the shadow-amp-integration-test branch 14 times, most recently from 3cdf5b7 to 4436f40 Compare February 10, 2020 19:21
@kevinkimball kevinkimball force-pushed the shadow-amp-integration-test branch 3 times, most recently from 08cb627 to 19db117 Compare February 10, 2020 21:13
@kevinkimball
Copy link
Contributor Author

@dvoytenko I believe all issues have been addressed, can you take another look? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
PWA and Shadow AMP
Awaiting triage
Development

Successfully merging this pull request may close these issues.

Add integration test for shadow-amp startup
6 participants