mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
parent
81d4b8f4f8
commit
9363a15cce
@ -31,7 +31,7 @@ class Connection extends EventEmitter {
|
|||||||
this._port = port;
|
this._port = port;
|
||||||
this._targetId = targetId;
|
this._targetId = targetId;
|
||||||
this._lastId = 0;
|
this._lastId = 0;
|
||||||
/** @type {!Map<number, {resolve: function(*), reject: function(*), method: string}>}*/
|
/** @type {!Map<number, {resolve: function, reject: function, method: string}>}*/
|
||||||
this._callbacks = new Map();
|
this._callbacks = new Map();
|
||||||
|
|
||||||
this._ws = ws;
|
this._ws = ws;
|
||||||
|
@ -115,7 +115,7 @@ class FrameManager extends EventEmitter {
|
|||||||
// Detach all child frames first.
|
// Detach all child frames first.
|
||||||
for (let child of frame.childFrames())
|
for (let child of frame.childFrames())
|
||||||
this._removeFramesRecursively(child);
|
this._removeFramesRecursively(child);
|
||||||
this._frames.delete(frame._id, frame);
|
this._frames.delete(frame._id);
|
||||||
|
|
||||||
// Update frame id to retain frame identity.
|
// Update frame id to retain frame identity.
|
||||||
frame._id = newFramePayload.id;
|
frame._id = newFramePayload.id;
|
||||||
@ -305,6 +305,7 @@ class Frame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @template T
|
||||||
* @param {string} selector
|
* @param {string} selector
|
||||||
* @param {function(!Element):T} pageFunction
|
* @param {function(!Element):T} pageFunction
|
||||||
* @param {!Array<*>} args
|
* @param {!Array<*>} args
|
||||||
@ -322,6 +323,7 @@ class Frame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @template T
|
||||||
* @param {string} selector
|
* @param {string} selector
|
||||||
* @param {function(!Element):T} pageFunction
|
* @param {function(!Element):T} pageFunction
|
||||||
* @param {!Array<*>} args
|
* @param {!Array<*>} args
|
||||||
|
@ -599,6 +599,7 @@ class Page extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @template T
|
||||||
* @param {string} selector
|
* @param {string} selector
|
||||||
* @param {function(!Element):T} pageFunction
|
* @param {function(!Element):T} pageFunction
|
||||||
* @param {!Array<*>} args
|
* @param {!Array<*>} args
|
||||||
@ -609,6 +610,7 @@ class Page extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @template T
|
||||||
* @param {string} selector
|
* @param {string} selector
|
||||||
* @param {function(!Element):T} pageFunction
|
* @param {function(!Element):T} pageFunction
|
||||||
* @param {!Array<*>} args
|
* @param {!Array<*>} args
|
||||||
|
@ -306,7 +306,7 @@ describe('Puppeteer', function() {
|
|||||||
expect(found).toBe(true);
|
expect(found).toBe(true);
|
||||||
}));
|
}));
|
||||||
it('should timeout', SX(async function() {
|
it('should timeout', SX(async function() {
|
||||||
startTime = Date.now();
|
let startTime = Date.now();
|
||||||
const timeout = 42;
|
const timeout = 42;
|
||||||
await page.waitFor(timeout);
|
await page.waitFor(timeout);
|
||||||
expect(Date.now() - startTime).not.toBeLessThan(timeout / 2);
|
expect(Date.now() - startTime).not.toBeLessThan(timeout / 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user