Skip to content

Commit

Permalink
Clearer naming for BrowserController changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkimball committed Jan 16, 2020
1 parent ebed128 commit 57297c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/integration/test-shadow-amp.js
Expand Up @@ -20,7 +20,7 @@ describes.integration(
{
amp: false,
body: `
<script async src='/dist/v0/amp-shadow.js'></script>
<script async src='/dist/amp-shadow.js'></script>
<div id="host"></div>
<script src='/examples/shadow-amp/test.js'></script>
`,
Expand All @@ -31,7 +31,7 @@ describes.integration(

beforeEach(async () => {
docController = new BrowserController(env.win);
await docController.waitForShadowDoc('#host');
await docController.waitForShadowRoot('#host');
shadowDoc = env.win.ampShadowHost.shadowRoot;
});

Expand Down
7 changes: 3 additions & 4 deletions testing/test-helper.js
Expand Up @@ -210,9 +210,9 @@ export class RequestBank {
}

export class BrowserController {
constructor(win, opt_doc) {
constructor(win, opt_rootNode) {
this.win_ = win;
this.doc_ = opt_doc || this.win_.document;
this.doc_ = opt_rootNode || this.win_.document;
}

wait(duration) {
Expand All @@ -222,12 +222,11 @@ export class BrowserController {
}

/**
*
* @param {string} hostSelector
* @param {number=} timeout
* @return {!Promise}
*/
waitForShadowDoc(hostSelector, timeout = 10000) {
waitForShadowRoot(hostSelector, timeout = 10000) {
const element = this.doc_.querySelector(hostSelector);
if (!element) {
throw new Error(`BrowserController query failed: ${hostSelector}`);
Expand Down

0 comments on commit 57297c1

Please sign in to comment.