Foramt JSDocs for 2 spaces

This commit is contained in:
Pavel Feldman 2017-06-21 13:58:49 -07:00
parent 437a93b26e
commit cf35524285
9 changed files with 221 additions and 221 deletions

View File

@ -32,8 +32,8 @@ var DEFAULT_ARGS = [
class Browser { class Browser {
/** /**
* @param {(!Object|undefined)} options * @param {(!Object|undefined)} options
*/ */
constructor(options) { constructor(options) {
options = options || {}; options = options || {};
++browserId; ++browserId;

View File

@ -21,10 +21,10 @@ const COMMAND_TIMEOUT = 10000;
class Connection extends EventEmitter { class Connection extends EventEmitter {
/** /**
* @param {number} port * @param {number} port
* @param {string} pageId * @param {string} pageId
* @param {!WebSocket} ws * @param {!WebSocket} ws
*/ */
constructor(port, pageId, ws) { constructor(port, pageId, ws) {
super(); super();
this._port = port; this._port = port;
@ -39,10 +39,10 @@ class Connection extends EventEmitter {
} }
/** /**
* @param {string} method * @param {string} method
* @param {(!Object|undefined)} params * @param {(!Object|undefined)} params
* @return {!Promise<?Object>} * @return {!Promise<?Object>}
*/ */
send(method, params = {}) { send(method, params = {}) {
var id = ++this._lastId; var id = ++this._lastId;
var message = JSON.stringify({id, method, params}); var message = JSON.stringify({id, method, params});
@ -53,8 +53,8 @@ class Connection extends EventEmitter {
} }
/** /**
* @param {string} message * @param {string} message
*/ */
_onMessage(message) { _onMessage(message) {
var object = JSON.parse(message); var object = JSON.parse(message);
if (object.id && this._callbacks.has(object.id)) { if (object.id && this._callbacks.has(object.id)) {
@ -76,16 +76,16 @@ class Connection extends EventEmitter {
} }
/** /**
* @return {!Promise} * @return {!Promise}
*/ */
async dispose() { async dispose() {
await runJsonCommand(this._port, `close/${this._pageId}`); await runJsonCommand(this._port, `close/${this._pageId}`);
} }
/** /**
* @param {number} port * @param {number} port
* @return {!Promise<!Connection>} * @return {!Promise<!Connection>}
*/ */
static async create(port) { static async create(port) {
var newTab = await runJsonCommand(port, 'new'); var newTab = await runJsonCommand(port, 'new');
var url = newTab.webSocketDebuggerUrl; var url = newTab.webSocketDebuggerUrl;
@ -98,9 +98,9 @@ class Connection extends EventEmitter {
} }
/** /**
* @param {number} port * @param {number} port
* @return {!Promise<!Object>} * @return {!Promise<!Object>}
*/ */
static version(port) { static version(port) {
return runJsonCommand(port, 'version'); return runJsonCommand(port, 'version');
} }

View File

@ -16,10 +16,10 @@
class Dialog { class Dialog {
/** /**
* @param {!Connection} client * @param {!Connection} client
* @param {!Dialog.Type} type * @param {!Dialog.Type} type
* @param {string} message * @param {string} message
*/ */
constructor(client, type, message) { constructor(client, type, message) {
this._client = client; this._client = client;
this.type = type; this.type = type;
@ -28,16 +28,16 @@ class Dialog {
} }
/** /**
* @return {string} * @return {string}
*/ */
message() { message() {
return this._message; return this._message;
} }
/** /**
* @param {string=} promptText * @param {string=} promptText
* @return {!Promise} * @return {!Promise}
*/ */
async accept(promptText) { async accept(promptText) {
console.assert(!this._handled, 'Cannot accept dialog which is already handled!'); console.assert(!this._handled, 'Cannot accept dialog which is already handled!');
this._handled = true; this._handled = true;
@ -48,8 +48,8 @@ class Dialog {
} }
/** /**
* @return {!Promise} * @return {!Promise}
*/ */
async dismiss() { async dismiss() {
console.assert(!this._handled, 'Cannot dismiss dialog which is already handled!'); console.assert(!this._handled, 'Cannot dismiss dialog which is already handled!');
this._handled = true; this._handled = true;

View File

@ -18,18 +18,18 @@ var EventEmitter = require('events');
class FrameManager extends EventEmitter { class FrameManager extends EventEmitter {
/** /**
* @param {!Connection} client * @param {!Connection} client
* @return {!FrameManager} * @return {!FrameManager}
*/ */
static async create(client) { static async create(client) {
var mainFramePayload = await client.send('Page.getResourceTree'); var mainFramePayload = await client.send('Page.getResourceTree');
return new FrameManager(client, mainFramePayload.frameTree); return new FrameManager(client, mainFramePayload.frameTree);
} }
/** /**
* @param {!Connection} client * @param {!Connection} client
* @param {!Object} frameTree * @param {!Object} frameTree
*/ */
constructor(client, frameTree) { constructor(client, frameTree) {
super(); super();
this._client = client; this._client = client;
@ -43,24 +43,24 @@ class FrameManager extends EventEmitter {
} }
/** /**
* @return {!Frame} * @return {!Frame}
*/ */
mainFrame() { mainFrame() {
return this._mainFrame; return this._mainFrame;
} }
/** /**
* @return {!Array<!Frame>} * @return {!Array<!Frame>}
*/ */
frames() { frames() {
return Array.from(this._frames.values()); return Array.from(this._frames.values());
} }
/** /**
* @param {string} frameId * @param {string} frameId
* @param {?string} parentFrameId * @param {?string} parentFrameId
* @return {?Frame} * @return {?Frame}
*/ */
_frameAttached(frameId, parentFrameId) { _frameAttached(frameId, parentFrameId) {
if (this._frames.has(frameId)) if (this._frames.has(frameId))
return; return;
@ -77,8 +77,8 @@ class FrameManager extends EventEmitter {
} }
/** /**
* @param {!Object} framePayload * @param {!Object} framePayload
*/ */
_frameNavigated(framePayload) { _frameNavigated(framePayload) {
var frame = this._frames.get(framePayload.id); var frame = this._frames.get(framePayload.id);
if (!frame) { if (!frame) {
@ -90,8 +90,8 @@ class FrameManager extends EventEmitter {
} }
/** /**
* @param {string} frameId * @param {string} frameId
*/ */
_frameDetached(frameId) { _frameDetached(frameId) {
var frame = this._frames.get(frameId); var frame = this._frames.get(frameId);
if (frame) if (frame)
@ -99,10 +99,10 @@ class FrameManager extends EventEmitter {
} }
/** /**
* @param {!Frame} frame * @param {!Frame} frame
* @param {string} newFrameId * @param {string} newFrameId
* @param {?Object} newFramePayload * @param {?Object} newFramePayload
*/ */
_navigateFrame(frame, newFrameId, newFramePayload) { _navigateFrame(frame, newFrameId, newFramePayload) {
// Detach all child frames first. // Detach all child frames first.
for (var child of frame.childFrames()) for (var child of frame.childFrames())
@ -115,10 +115,10 @@ class FrameManager extends EventEmitter {
} }
/** /**
* @param {?Frame} parentFrame * @param {?Frame} parentFrame
* @param {!Object} frameTreePayload * @param {!Object} frameTreePayload
* @return {!Frame} * @return {!Frame}
*/ */
_addFramesRecursively(parentFrame, frameTreePayload) { _addFramesRecursively(parentFrame, frameTreePayload) {
var framePayload = frameTreePayload.frame; var framePayload = frameTreePayload.frame;
var frame = new Frame(parentFrame, framePayload.id, framePayload); var frame = new Frame(parentFrame, framePayload.id, framePayload);
@ -130,8 +130,8 @@ class FrameManager extends EventEmitter {
} }
/** /**
* @param {!Frame} frame * @param {!Frame} frame
*/ */
_removeFramesRecursively(frame) { _removeFramesRecursively(frame) {
for (var child of frame.childFrames()) for (var child of frame.childFrames())
this._removeFramesRecursively(child); this._removeFramesRecursively(child);
@ -153,10 +153,10 @@ FrameManager.Events = {
*/ */
class Frame { class Frame {
/** /**
* @param {?Frame} parentFrame * @param {?Frame} parentFrame
* @param {string} frameId * @param {string} frameId
* @param {?Object} payload * @param {?Object} payload
*/ */
constructor(parentFrame, frameId, payload) { constructor(parentFrame, frameId, payload) {
this._parentFrame = parentFrame; this._parentFrame = parentFrame;
this._url = ''; this._url = '';
@ -170,57 +170,57 @@ class Frame {
} }
/** /**
* @return {string} * @return {string}
*/ */
name() { name() {
return this._name || ''; return this._name || '';
} }
/** /**
* @return {string} * @return {string}
*/ */
url() { url() {
return this._url; return this._url;
} }
/** /**
* @return {string} * @return {string}
*/ */
securityOrigin() { securityOrigin() {
return this._securityOrigin; return this._securityOrigin;
} }
/** /**
* @return {?Frame} * @return {?Frame}
*/ */
parentFrame() { parentFrame() {
return this._parentFrame; return this._parentFrame;
} }
/** /**
* @return {!Array.<!Frame>} * @return {!Array.<!Frame>}
*/ */
childFrames() { childFrames() {
return Array.from(this._childFrames); return Array.from(this._childFrames);
} }
/** /**
* @return {boolean} * @return {boolean}
*/ */
isMainFrame() { isMainFrame() {
return !this._detached && !this._parentFrame; return !this._detached && !this._parentFrame;
} }
/** /**
* @return {boolean} * @return {boolean}
*/ */
isDetached() { isDetached() {
return this._detached; return this._detached;
} }
/** /**
* @param {?Object} framePayload * @param {?Object} framePayload
*/ */
_adoptPayload(framePayload) { _adoptPayload(framePayload) {
framePayload = framePayload || { framePayload = framePayload || {
name: '', name: '',

View File

@ -16,9 +16,9 @@
class Navigator { class Navigator {
/** /**
* @param {!Connection} client * @param {!Connection} client
* @param {!Object=} options * @param {!Object=} options
*/ */
constructor(client, options) { constructor(client, options) {
this._client = client; this._client = client;
client.on('Network.requestWillBeSent', event => this._onRequestWillBeSent(event)); client.on('Network.requestWillBeSent', event => this._onRequestWillBeSent(event));
@ -30,9 +30,9 @@ class Navigator {
} }
/** /**
* @param {string} url * @param {string} url
* @param {string=} referrer * @param {string=} referrer
*/ */
async navigate(url, referrer) { async navigate(url, referrer) {
this._navigationStartTime = Date.now(); this._navigationStartTime = Date.now();
this._watchdogTimer = setTimeout(this._completeNavigation.bind(this, true), this._maxTime); this._watchdogTimer = setTimeout(this._completeNavigation.bind(this, true), this._maxTime);
@ -52,23 +52,23 @@ class Navigator {
} }
/** /**
* @param {!Object} event * @param {!Object} event
*/ */
_onRequestWillBeSent(event) { _onRequestWillBeSent(event) {
if (!event.redirectResponse) if (!event.redirectResponse)
++this._inflightRequests; ++this._inflightRequests;
} }
/** /**
* @param {!Object} event * @param {!Object} event
*/ */
_onLoadingFinished(event) { _onLoadingFinished(event) {
this._onLoadingCompleted(event); this._onLoadingCompleted(event);
} }
/** /**
* @param {!Object} event * @param {!Object} event
*/ */
_onLoadingFailed(event) { _onLoadingFailed(event) {
this._onLoadingCompleted(event); this._onLoadingCompleted(event);
} }
@ -81,8 +81,8 @@ class Navigator {
} }
/** /**
* @param {boolean} force * @param {boolean} force
*/ */
_completeNavigation(force) { _completeNavigation(force) {
if (!this._navigationLoadCallback) if (!this._navigationLoadCallback)
return; return;

View File

@ -24,9 +24,9 @@ var FrameManager = require('./FrameManager');
class Page extends EventEmitter { class Page extends EventEmitter {
/** /**
* @param {!Connection} client * @param {!Connection} client
* @return {!Promise<!Page>} * @return {!Promise<!Page>}
*/ */
static async create(client) { static async create(client) {
await Promise.all([ await Promise.all([
client.send('Network.enable', {}), client.send('Network.enable', {}),
@ -44,10 +44,10 @@ class Page extends EventEmitter {
} }
/** /**
* @param {!Connection} client * @param {!Connection} client
* @param {!FrameManager} frameManager * @param {!FrameManager} frameManager
* @param {number} screenDPI * @param {number} screenDPI
*/ */
constructor(client, frameManager, screenDPI) { constructor(client, frameManager, screenDPI) {
super(); super();
this._client = client; this._client = client;
@ -75,45 +75,45 @@ class Page extends EventEmitter {
} }
/** /**
* @return {!Frame} * @return {!Frame}
*/ */
mainFrame() { mainFrame() {
return this._frameManager.mainFrame(); return this._frameManager.mainFrame();
} }
/** /**
* @return {!Array<!Frame>} * @return {!Array<!Frame>}
*/ */
frames() { frames() {
return this._frameManager.frames(); return this._frameManager.frames();
} }
/** /**
* @param {?function(!Request)} interceptor * @param {?function(!Request)} interceptor
*/ */
async setRequestInterceptor(interceptor) { async setRequestInterceptor(interceptor) {
this._requestInterceptor = interceptor; this._requestInterceptor = interceptor;
await this._client.send('Network.enableRequestInterception', {enabled: !!interceptor}); await this._client.send('Network.enableRequestInterception', {enabled: !!interceptor});
} }
/** /**
* @param {!Object} event * @param {!Object} event
*/ */
_onRequestIntercepted(event) { _onRequestIntercepted(event) {
var request = new Request(this._client, event.InterceptionId, event.request); var request = new Request(this._client, event.InterceptionId, event.request);
this._requestInterceptor(request); this._requestInterceptor(request);
} }
/** /**
* @param {string} url * @param {string} url
* @return {!Promise} * @return {!Promise}
*/ */
async addScriptTag(url) { async addScriptTag(url) {
return this.evaluate(addScriptTag, url); return this.evaluate(addScriptTag, url);
/** /**
* @param {string} url * @param {string} url
*/ */
function addScriptTag(url) { function addScriptTag(url) {
var script = document.createElement('script'); var script = document.createElement('script');
script.src = url; script.src = url;
@ -124,9 +124,9 @@ class Page extends EventEmitter {
} }
/** /**
* @param {string} filePath * @param {string} filePath
* @return {!Promise} * @return {!Promise}
*/ */
async injectFile(filePath) { async injectFile(filePath) {
var callback; var callback;
var promise = new Promise(fulfill => callback = fulfill); var promise = new Promise(fulfill => callback = fulfill);
@ -136,9 +136,9 @@ class Page extends EventEmitter {
} }
/** /**
* @param {string} name * @param {string} name
* @param {function(?)} callback * @param {function(?)} callback
*/ */
async setInPageCallback(name, callback) { async setInPageCallback(name, callback) {
if (this._inPageCallbacks[name]) if (this._inPageCallbacks[name])
throw new Error(`Failed to set in-page callback with name ${name}: window['${name}'] already exists!`); throw new Error(`Failed to set in-page callback with name ${name}: window['${name}'] already exists!`);
@ -167,9 +167,9 @@ class Page extends EventEmitter {
} }
/** /**
* @param {!Object} headers * @param {!Object} headers
* @return {!Promise} * @return {!Promise}
*/ */
async setExtraHTTPHeaders(headers) { async setExtraHTTPHeaders(headers) {
this._extraHeaders = {}; this._extraHeaders = {};
// Note: header names are case-insensitive. // Note: header names are case-insensitive.
@ -179,31 +179,31 @@ class Page extends EventEmitter {
} }
/** /**
* @return {!Object} * @return {!Object}
*/ */
extraHTTPHeaders() { extraHTTPHeaders() {
return Object.assign({}, this._extraHeaders); return Object.assign({}, this._extraHeaders);
} }
/** /**
* @param {string} userAgent * @param {string} userAgent
* @return {!Promise} * @return {!Promise}
*/ */
async setUserAgentOverride(userAgent) { async setUserAgentOverride(userAgent) {
this._userAgent = userAgent; this._userAgent = userAgent;
return this._client.send('Network.setUserAgentOverride', { userAgent }); return this._client.send('Network.setUserAgentOverride', { userAgent });
} }
/** /**
* @return {string} * @return {string}
*/ */
userAgentOverride() { userAgentOverride() {
return this._userAgent; return this._userAgent;
} }
/** /**
* @param {!Object} exceptionDetails * @param {!Object} exceptionDetails
*/ */
async _handleException(exceptionDetails) { async _handleException(exceptionDetails) {
var message = await this._getExceptionMessage(exceptionDetails); var message = await this._getExceptionMessage(exceptionDetails);
this.emit(Page.Events.Error, new Error(message)); this.emit(Page.Events.Error, new Error(message));
@ -242,16 +242,16 @@ class Page extends EventEmitter {
} }
/** /**
* @return {!Promise<string>} * @return {!Promise<string>}
*/ */
async url() { async url() {
return this.evaluate(() => window.location.href); return this.evaluate(() => window.location.href);
} }
/** /**
* @param {string} html * @param {string} html
* @return {!Promise} * @return {!Promise}
*/ */
async setContent(html) { async setContent(html) {
this.evaluate(() => { this.evaluate(() => {
document.open(); document.open();
@ -261,18 +261,18 @@ class Page extends EventEmitter {
} }
/** /**
* @param {string} html * @param {string} html
* @param {!Object=} options * @param {!Object=} options
* @return {!Promise<boolean>} * @return {!Promise<boolean>}
*/ */
navigate(url, options) { navigate(url, options) {
return new Navigator(this._client, options).navigate(url, this._extraHeaders.referer); return new Navigator(this._client, options).navigate(url, this._extraHeaders.referer);
} }
/** /**
* @param {!{width: number, height: number}} size * @param {!{width: number, height: number}} size
* @return {!Promise} * @return {!Promise}
*/ */
async setViewportSize(size) { async setViewportSize(size) {
this._viewportSize = size; this._viewportSize = size;
var width = size.width; var width = size.width;
@ -295,17 +295,17 @@ class Page extends EventEmitter {
} }
/** /**
* @return {!{width: number, height: number}} * @return {!{width: number, height: number}}
*/ */
viewportSize() { viewportSize() {
return this._viewportSize; return this._viewportSize;
} }
/** /**
* @param {function()} fun * @param {function()} fun
* @param {!Array<*>} args * @param {!Array<*>} args
* @return {!Promise<(!Object|undefined)>} * @return {!Promise<(!Object|undefined)>}
*/ */
async evaluate(fun, ...args) { async evaluate(fun, ...args) {
var syncExpression = Page._evaluationString(fun, ...args); var syncExpression = Page._evaluationString(fun, ...args);
var expression = `Promise.resolve(${syncExpression})`; var expression = `Promise.resolve(${syncExpression})`;
@ -318,9 +318,9 @@ class Page extends EventEmitter {
} }
/** /**
* @param {!Object} exceptionDetails * @param {!Object} exceptionDetails
* @return {string} * @return {string}
*/ */
async _getExceptionMessage(exceptionDetails) { async _getExceptionMessage(exceptionDetails) {
var message = ''; var message = '';
var exception = exceptionDetails.exception; var exception = exceptionDetails.exception;
@ -346,28 +346,28 @@ class Page extends EventEmitter {
} }
/** /**
* @param {function()} fun * @param {function()} fun
* @param {!Array<*>} args * @param {!Array<*>} args
* @return {!Promise} * @return {!Promise}
*/ */
async evaluateOnInitialized(fun, ...args) { async evaluateOnInitialized(fun, ...args) {
var scriptSource = Page._evaluationString(fun, ...args); var scriptSource = Page._evaluationString(fun, ...args);
await this._client.send('Page.addScriptToEvaluateOnLoad', { scriptSource }); await this._client.send('Page.addScriptToEvaluateOnLoad', { scriptSource });
} }
/** /**
* @param {function()} fun * @param {function()} fun
* @param {!Array<*>} args * @param {!Array<*>} args
* @return {string} * @return {string}
*/ */
static _evaluationString(fun, ...args) { static _evaluationString(fun, ...args) {
return `(${fun})(${args.map(x => JSON.stringify(x)).join(',')})`; return `(${fun})(${args.map(x => JSON.stringify(x)).join(',')})`;
} }
/** /**
* @param {!Object=} options * @param {!Object=} options
* @return {!Promise<!Buffer>} * @return {!Promise<!Buffer>}
*/ */
async screenshot(options) { async screenshot(options) {
options = options || {}; options = options || {};
var screenshotType = null; var screenshotType = null;
@ -405,10 +405,10 @@ class Page extends EventEmitter {
} }
/** /**
* @param {string} screenshotType * @param {string} screenshotType
* @param {!Object=} options * @param {!Object=} options
* @return {!Promise<!Buffer>} * @return {!Promise<!Buffer>}
*/ */
async _screenshotTask(screenshotType, options) { async _screenshotTask(screenshotType, options) {
if (options.clip) { if (options.clip) {
await Promise.all([ await Promise.all([
@ -454,10 +454,10 @@ class Page extends EventEmitter {
} }
/** /**
* @param {string} filePath * @param {string} filePath
* @param {!Object=} options * @param {!Object=} options
* @return {!Promise} * @return {!Promise}
*/ */
async printToPDF(filePath, options) { async printToPDF(filePath, options) {
options = options || {}; options = options || {};
@ -503,22 +503,22 @@ class Page extends EventEmitter {
} }
/** /**
* @return {!Promise<string>} * @return {!Promise<string>}
*/ */
async plainText() { async plainText() {
return this.evaluate(() => document.body.innerText); return this.evaluate(() => document.body.innerText);
} }
/** /**
* @return {!Promise<string>} * @return {!Promise<string>}
*/ */
async title() { async title() {
return this.evaluate(() => document.title); return this.evaluate(() => document.title);
} }
/** /**
* @return {!Promise} * @return {!Promise}
*/ */
async close() { async close() {
await this._client.dispose(); await this._client.dispose();
} }

View File

@ -16,10 +16,10 @@
class Request { class Request {
/** /**
* @param {!Connection} client * @param {!Connection} client
* @param {string} interceptionId * @param {string} interceptionId
* @param {!Object} payload * @param {!Object} payload
*/ */
constructor(client, interceptionId, payload) { constructor(client, interceptionId, payload) {
this._client = client; this._client = client;
this._interceptionId = interceptionId; this._interceptionId = interceptionId;
@ -36,44 +36,44 @@ class Request {
} }
/** /**
* @return {string} * @return {string}
*/ */
url() { url() {
return this._urlOverride || this._url; return this._urlOverride || this._url;
} }
/** /**
* @param {string} url * @param {string} url
*/ */
setUrl(url) { setUrl(url) {
this._urlOverride = url; this._urlOverride = url;
} }
/** /**
* @return {string} * @return {string}
*/ */
method() { method() {
return this._methodOverride || this._method; return this._methodOverride || this._method;
} }
/** /**
* @param {string} method * @param {string} method
*/ */
setMethod(method) { setMethod(method) {
this._methodOverride = method; this._methodOverride = method;
} }
/** /**
* @return {!Object} * @return {!Object}
*/ */
headers() { headers() {
return Object.assign({}, this._headersOverride || this._headers); return Object.assign({}, this._headersOverride || this._headers);
} }
/** /**
* @param {string} key * @param {string} key
* @param {string} value * @param {string} value
*/ */
setHeader(key, value) { setHeader(key, value) {
if (!this._headersOverride) if (!this._headersOverride)
this._headersOverride = Object.assign({}, this._headers); this._headersOverride = Object.assign({}, this._headers);
@ -81,15 +81,15 @@ class Request {
} }
/** /**
* @return {(string|undefined)} * @return {(string|undefined)}
*/ */
postData() { postData() {
return this._postDataOverride || this._postData; return this._postDataOverride || this._postData;
} }
/** /**
* @return {(string|undefined)} * @return {(string|undefined)}
*/ */
setPostData(data) { setPostData(data) {
this._postDataOverride = data; this._postDataOverride = data;
} }
@ -116,8 +116,8 @@ class Request {
} }
/** /**
* @return {boolean} * @return {boolean}
*/ */
handled() { handled() {
return this._handled; return this._handled;
} }

View File

@ -22,9 +22,9 @@ var mime = require('mime');
class StaticServer { class StaticServer {
/** /**
* @param {string} dirPath * @param {string} dirPath
* @param {number} port * @param {number} port
*/ */
constructor(dirPath, port) { constructor(dirPath, port) {
this._server = http.createServer(this._onRequest.bind(this)); this._server = http.createServer(this._onRequest.bind(this));
this._server.listen(port); this._server.listen(port);

View File

@ -1,10 +1,10 @@
var utils = module.exports = { var utils = module.exports = {
/** /**
* @param {!Page} page * @param {!Page} page
* @param {string} frameId * @param {string} frameId
* @param {string} url * @param {string} url
* @return {!Promise} * @return {!Promise}
*/ */
attachFrame: async function(page, frameId, url) { attachFrame: async function(page, frameId, url) {
await page.evaluate(attachFrame, frameId, url); await page.evaluate(attachFrame, frameId, url);
@ -18,10 +18,10 @@ var utils = module.exports = {
}, },
/** /**
* @param {!Page} page * @param {!Page} page
* @param {string} frameId * @param {string} frameId
* @return {!Promise} * @return {!Promise}
*/ */
detachFrame: async function(page, frameId) { detachFrame: async function(page, frameId) {
await page.evaluate(detachFrame, frameId); await page.evaluate(detachFrame, frameId);
@ -32,11 +32,11 @@ var utils = module.exports = {
}, },
/** /**
* @param {!Page} page * @param {!Page} page
* @param {string} frameId * @param {string} frameId
* @param {string} url * @param {string} url
* @return {!Promise} * @return {!Promise}
*/ */
navigateFrame: async function(page, frameId, url) { navigateFrame: async function(page, frameId, url) {
await page.evaluate(navigateFrame, frameId, url); await page.evaluate(navigateFrame, frameId, url);
@ -48,10 +48,10 @@ var utils = module.exports = {
}, },
/** /**
* @param {!Frame} frame * @param {!Frame} frame
* @param {string=} indentation * @param {string=} indentation
* @return {string} * @return {string}
*/ */
dumpFrames: function(frame, indentation) { dumpFrames: function(frame, indentation) {
indentation = indentation || ''; indentation = indentation || '';
var result = indentation + frame.url(); var result = indentation + frame.url();