✅ Add integration for shadow AMP v0.js#26344
Conversation
| @@ -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
|
|
||
| export class BrowserController { | ||
| constructor(win) { | ||
| constructor(win, doc) { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
| @@ -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.
It's the app code for the test subject page
There was a problem hiding this comment.
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
|
|
||
| export class BrowserController { | ||
| constructor(win) { | ||
| constructor(win, opt_doc) { |
There was a problem hiding this comment.
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) { |
a5a1b4f to
57297c1
Compare
|
@dvoytenko Good naming suggestions , thanks. Updated the PR |
d70ed9e to
9aee0d7
Compare
testing/test-helper.js
Outdated
| constructor(win, opt_rootNode) { | ||
| 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.
The other test documents seem to be loaded from this file.
There was a problem hiding this comment.
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.
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