diff --git a/lib/Connection.js b/lib/Connection.js index cbda4e785a0..c99584c3046 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -117,9 +117,6 @@ class Connection extends EventEmitter { this._sessions.clear(); } - /** - * @return {!Promise} - */ dispose() { this._onClose(); this._ws.close(); @@ -203,9 +200,6 @@ class Session extends EventEmitter { } } - /** - * @return {!Promise} - */ async dispose() { await this._connection.send('Target.closeTarget', {targetId: this._targetId}); } diff --git a/lib/Dialog.js b/lib/Dialog.js index dff77c73735..5e618878e95 100644 --- a/lib/Dialog.js +++ b/lib/Dialog.js @@ -47,7 +47,6 @@ class Dialog { /** * @param {string=} promptText - * @return {!Promise} */ async accept(promptText) { console.assert(!this._handled, 'Cannot accept dialog which is already handled!'); @@ -58,9 +57,6 @@ class Dialog { }); } - /** - * @return {!Promise} - */ async dismiss() { console.assert(!this._handled, 'Cannot dismiss dialog which is already handled!'); this._handled = true; diff --git a/lib/ElementHandle.js b/lib/ElementHandle.js index 1e8578b2225..697e4a40015 100644 --- a/lib/ElementHandle.js +++ b/lib/ElementHandle.js @@ -29,9 +29,6 @@ class ElementHandle { this._disposed = false; } - /** - * @return {!Promise} - */ async dispose() { if (this._disposed) return; @@ -77,9 +74,6 @@ class ElementHandle { return center; } - /** - * @return {!Promise} - */ async hover() { const {x, y} = await this._visibleCenter(); await this._mouse.move(x, y); @@ -87,7 +81,6 @@ class ElementHandle { /** * @param {!Object=} options - * @return {!Promise} */ async click(options) { const {x, y} = await this._visibleCenter(); diff --git a/lib/FrameManager.js b/lib/FrameManager.js index c998122b5fc..5e632b038c6 100644 --- a/lib/FrameManager.js +++ b/lib/FrameManager.js @@ -284,7 +284,7 @@ class Frame { /** * @param {string} filePath - * @return {!Promise} + * @return {!Promise<*>} */ async injectFile(filePath) { let contents = await new Promise((resolve, reject) => { @@ -299,7 +299,6 @@ class Frame { /** * @param {string} url - * @return {!Promise} */ async addScriptTag(url) { return this.evaluate(addScriptTag, url); diff --git a/lib/Input.js b/lib/Input.js index 623eed38a3d..8e93e47874c 100644 --- a/lib/Input.js +++ b/lib/Input.js @@ -29,7 +29,6 @@ class Keyboard { /** * @param {string} key * @param {{text: (string|undefined)}} options - * @return {!Promise} */ async down(key, options = {}) { const text = options.text; @@ -65,7 +64,6 @@ class Keyboard { /** * @param {string} key - * @return {!Promise} */ async up(key) { this._modifiers &= ~this._modifierBit(key); @@ -80,7 +78,6 @@ class Keyboard { /** * @param {string} char - * @return {!Promise} */ async sendCharacter(char) { await this._client.send('Input.dispatchKeyEvent', { diff --git a/lib/NetworkManager.js b/lib/NetworkManager.js index 8ba24cbaf06..bb03ce15347 100644 --- a/lib/NetworkManager.js +++ b/lib/NetworkManager.js @@ -47,7 +47,6 @@ class NetworkManager extends EventEmitter { /** * @param {!Object} extraHTTPHeaders - * @return {!Promise} */ async setExtraHTTPHeaders(extraHTTPHeaders) { this._extraHTTPHeaders = {}; @@ -65,7 +64,6 @@ class NetworkManager extends EventEmitter { /** * @param {string} userAgent - * @return {!Promise} */ async setUserAgent(userAgent) { return this._client.send('Network.setUserAgentOverride', { userAgent }); @@ -73,7 +71,6 @@ class NetworkManager extends EventEmitter { /** * @param {boolean} value - * @return {!Promise} */ async setRequestInterceptionEnabled(value) { await this._client.send('Network.setRequestInterceptionEnabled', {enabled: !!value}); diff --git a/lib/Page.js b/lib/Page.js index 6af1a427cec..90e75373922 100644 --- a/lib/Page.js +++ b/lib/Page.js @@ -205,7 +205,6 @@ class Page extends EventEmitter { /** * @param {string} url - * @return {!Promise} */ async addScriptTag(url) { return this.mainFrame().addScriptTag(url); @@ -213,7 +212,6 @@ class Page extends EventEmitter { /** * @param {string} filePath - * @return {!Promise} */ async injectFile(filePath) { return this.mainFrame().injectFile(filePath); @@ -252,7 +250,6 @@ class Page extends EventEmitter { /** * @param {!Object} headers - * @return {!Promise} */ async setExtraHTTPHeaders(headers) { return this._networkManager.setExtraHTTPHeaders(headers); @@ -260,7 +257,6 @@ class Page extends EventEmitter { /** * @param {string} userAgent - * @return {!Promise} */ async setUserAgent(userAgent) { return this._networkManager.setUserAgent(userAgent); @@ -333,7 +329,6 @@ class Page extends EventEmitter { /** * @param {string} html - * @return {!Promise} */ async setContent(html) { await this.evaluate(html => { @@ -425,7 +420,6 @@ class Page extends EventEmitter { /** * @param {!Object} options - * @return {!Promise} */ async emulate(options) { return Promise.all([ @@ -443,7 +437,6 @@ class Page extends EventEmitter { /** * @param {?string} mediaType - * @return {!Promise} */ async emulateMedia(mediaType) { console.assert(mediaType === 'screen' || mediaType === 'print' || mediaType === null, 'Unsupported media type: ' + mediaType); @@ -452,7 +445,6 @@ class Page extends EventEmitter { /** * @param {!Page.Viewport} viewport - * @return {!Promise} */ async setViewport(viewport) { const needsReload = await this._emulationManager.emulateViewport(this._client, viewport); @@ -480,7 +472,6 @@ class Page extends EventEmitter { /** * @param {function()|string} pageFunction * @param {!Array<*>} args - * @return {!Promise} */ async evaluateOnNewDocument(pageFunction, ...args) { const source = helper.evaluationString(pageFunction, ...args); @@ -627,9 +618,6 @@ class Page extends EventEmitter { return this.mainFrame().title(); } - /** - * @return {!Promise} - */ async close() { await this._client.dispose(); } @@ -644,7 +632,6 @@ class Page extends EventEmitter { /** * @param {string} selector * @param {!Object} options - * @return {!Promise} */ async click(selector, options) { const handle = await this.$(selector); @@ -655,7 +642,6 @@ class Page extends EventEmitter { /** * @param {string} selector - * @param {!Promise} */ async hover(selector) { const handle = await this.$(selector); @@ -666,7 +652,6 @@ class Page extends EventEmitter { /** * @param {string} selector - * @return {!Promise} */ async focus(selector) { const handle = await this.$(selector); @@ -678,7 +663,6 @@ class Page extends EventEmitter { /** * @param {string} text * @param {{delay: (number|undefined)}=} options - * @return {!Promise} */ async type(text, options) { let delay = 0; @@ -696,7 +680,6 @@ class Page extends EventEmitter { /** * @param {string} text * @param {!Object=} options - * @return {!Promise} */ async press(key, options) { this._keyboard.down(key, options); diff --git a/lib/Tracing.js b/lib/Tracing.js index aadb7ad5662..c1975d42893 100644 --- a/lib/Tracing.js +++ b/lib/Tracing.js @@ -28,7 +28,6 @@ class Tracing { /** * @param {!Object} options - * @return {!Promise} */ async start(options) { console.assert(!this._recording, 'Cannot start recording trace while already recording trace.'); @@ -52,9 +51,6 @@ class Tracing { }); } - /** - * @return {!Promise} - */ async stop() { let fulfill; const contentPromise = new Promise(x => fulfill = x); @@ -69,7 +65,6 @@ class Tracing { /** * @param {string} handle * @param {string} path - * @return {!Promise} */ async _readStream(handle, path) { let eof = false; diff --git a/lib/helper.js b/lib/helper.js index eefa5b8f1c2..5239d2ddc13 100644 --- a/lib/helper.js +++ b/lib/helper.js @@ -90,7 +90,6 @@ class Helper { /** * @param {!Session} client * @param {!Object} remoteObject - * @return {!Promise} */ static async releaseObject(client, remoteObject) { if (!remoteObject.objectId) diff --git a/test/frame-utils.js b/test/frame-utils.js index ac59f2a8283..2de76772199 100644 --- a/test/frame-utils.js +++ b/test/frame-utils.js @@ -19,7 +19,6 @@ const utils = module.exports = { * @param {!Page} page * @param {string} frameId * @param {string} url - * @return {!Promise} */ attachFrame: async function(page, frameId, url) { await page.evaluate(attachFrame, frameId, url); @@ -36,7 +35,6 @@ const utils = module.exports = { /** * @param {!Page} page * @param {string} frameId - * @return {!Promise} */ detachFrame: async function(page, frameId) { await page.evaluate(detachFrame, frameId); @@ -51,7 +49,6 @@ const utils = module.exports = { * @param {!Page} page * @param {string} frameId * @param {string} url - * @return {!Promise} */ navigateFrame: async function(page, frameId, url) { await page.evaluate(navigateFrame, frameId, url); diff --git a/test/server/SimpleServer.js b/test/server/SimpleServer.js index 411dd3a6613..583d32c289a 100644 --- a/test/server/SimpleServer.js +++ b/test/server/SimpleServer.js @@ -88,9 +88,6 @@ class SimpleServer { socket.once('close', () => this._sockets.delete(socket)); } - /** - * @return {!Promise} - */ async stop() { this.reset(); for (const socket of this._sockets) diff --git a/utils/check_availability.js b/utils/check_availability.js index 14e99ea21c7..62350760ae6 100755 --- a/utils/check_availability.js +++ b/utils/check_availability.js @@ -63,9 +63,6 @@ const fromRevision = parseInt(process.argv[2], 10); const toRevision = parseInt(process.argv[3], 10); checkRangeAvailability(fromRevision, toRevision); -/** - * @return {!Promise} - */ async function checkOmahaProxyAvailability() { console.log('Fetching revisions from ' + OMAHA_PROXY); const platforms = await loadJSON(OMAHA_PROXY); @@ -93,7 +90,6 @@ async function checkOmahaProxyAvailability() { /** * @param {number} fromRevision * @param {number} toRevision - * @return {!Promise} */ async function checkRangeAvailability(fromRevision, toRevision) { const table = new Table([10, 7, 7, 7, 7]); @@ -107,7 +103,6 @@ async function checkRangeAvailability(fromRevision, toRevision) { * @param {!Table} table * @param {string} name * @param {number} revision - * @return {!Promise} */ async function checkAndDrawRevisionAvailability(table, name, revision) { const promises = [];