-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
✅ Add integration for shadow AMP v0.js #26344
Conversation
examples/shadow-amp/test.js
Outdated
@@ -0,0 +1,33 @@ | |||
/** | |||
* Copyright 2018 The AMP HTML Authors. All Rights Reserved. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
test/integration/test-shadow-amp.js
Outdated
@@ -0,0 +1,54 @@ | |||
/** | |||
* Copyright 2018 The AMP HTML Authors. All Rights Reserved. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
testing/test-helper.js
Outdated
@@ -210,9 +210,9 @@ export class RequestBank { | |||
} | |||
|
|||
export class BrowserController { | |||
constructor(win) { | |||
constructor(win, doc) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
examples/shadow-amp/test.js
Outdated
@@ -0,0 +1,33 @@ | |||
/** |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
testing/test-helper.js
Outdated
@@ -210,9 +210,9 @@ export class RequestBank { | |||
} | |||
|
|||
export class BrowserController { | |||
constructor(win) { | |||
constructor(win, opt_doc) { |
There was a problem hiding this comment.
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
?
testing/test-helper.js
Outdated
* @param {number=} timeout | ||
* @return {!Promise} | ||
*/ | ||
waitForShadowDoc(hostSelector, timeout = 10000) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waitForShadowRoot
a5a1b4f
to
57297c1
Compare
@dvoytenko Good naming suggestions , thanks. Updated the PR |
d70ed9e
to
9aee0d7
Compare
testing/test-helper.js
Outdated
this.win_ = win; | ||
this.doc_ = this.win_.document; | ||
this.doc_ = opt_rootNode || this.win_.document; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
build-system/server/amp4test.js
Outdated
/** | ||
* Serves an amp doc for test-shadow-amp.js | ||
*/ | ||
app.get('/shadow-amp', (_req, res) => |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
14591b6
to
1fb797e
Compare
Hey @rsimha, these files were changed:
|
.vscode/settings.json
Outdated
"[markdown]": { | ||
"editor.formatOnSave": true | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
} |
There was a problem hiding this comment.
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
.
3cdf5b7
to
4436f40
Compare
08cb627
to
19db117
Compare
19db117
to
2055e33
Compare
@dvoytenko I believe all issues have been addressed, can you take another look? Thanks. |
Adds basic integration tests that show attaching a shadow AMP document and laying out an
<amp-img>
component. Closes #5580