Skip to content

Commit

Permalink
remove unused fn and variable (#20111) (#20328)
Browse files Browse the repository at this point in the history
  • Loading branch information
stacey-gammon authored Jun 29, 2018
1 parent f585621 commit 97cf9c4
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions x-pack/plugins/reporting/server/browsers/chromium/driver/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ export class HeadlessChromiumDriver {
this._logger = logger;
}

async destroy() {
this.killed = true;
await this._client.close();
}

async evaluate({ fn, args = [], awaitPromise = false, returnByValue = false }) {
const { Runtime } = this._client;

Expand Down Expand Up @@ -63,9 +58,7 @@ export class HeadlessChromiumDriver {

Page.screencastFrame(async ({ data, sessionId }) => {
await this._writeData(path.join(recordPath, `${moment().utc().format('HH_mm_ss_SSS')}.png`), data);
if (!this.killed) {
await Page.screencastFrameAck({ sessionId });
}
await Page.screencastFrameAck({ sessionId });
});
}

Expand Down Expand Up @@ -123,13 +116,13 @@ export class HeadlessChromiumDriver {
}

async waitFor({ fn, args, toEqual }) {
while (!this.killed && (await this.evaluate({ fn, args })) !== toEqual) {
while ((await this.evaluate({ fn, args })) !== toEqual) {
await delay(this._waitForDelayMs);
}
}

async waitForSelector(selector) {
while (!this.killed) {
while (true) {
const { nodeId } = await this._client.DOM.querySelector({ nodeId: this.documentNode.root.nodeId, selector });
if (nodeId) {
break;
Expand Down

0 comments on commit 97cf9c4

Please sign in to comment.