change assert to use helpers
This commit is contained in:
parent
966095dd09
commit
8e006145e0
|
|
@ -81,15 +81,12 @@ export class WKBrowser extends browser.Browser {
|
||||||
}
|
}
|
||||||
|
|
||||||
async _waitForFirstPageTarget(timeout: number): Promise<void> {
|
async _waitForFirstPageTarget(timeout: number): Promise<void> {
|
||||||
console.assert(!this._targets.size);
|
assert(!this._targets.size);
|
||||||
await helper.waitWithTimeout(this._firstTargetPromise, 'target', timeout);
|
await helper.waitWithTimeout(this._firstTargetPromise, 'target', timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onTargetCreated(session: WKTargetSession, targetInfo: Protocol.Target.TargetInfo) {
|
_onTargetCreated(session: WKTargetSession, targetInfo: Protocol.Target.TargetInfo) {
|
||||||
if (targetInfo.type !== 'page') {
|
assert(targetInfo.type === 'page', 'Only page targets are expected in WebKit, received: ' + targetInfo.type);
|
||||||
console.assert(false, 'Unexpected target type: ' + targetInfo.type);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let context = null;
|
let context = null;
|
||||||
if (targetInfo.browserContextId) {
|
if (targetInfo.browserContextId) {
|
||||||
// FIXME: we don't know about the default context id, so assume that all targets from
|
// FIXME: we don't know about the default context id, so assume that all targets from
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue