remove unused fn and variable (#20111) (#20328)

This commit is contained in:
Stacey Gammon 2018-06-29 08:09:43 -04:00 committed by GitHub
parent f5856210d9
commit 97cf9c4a06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
@ -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 });
});
}
@ -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;