chore: update chromium-bidi (#10862)

This commit is contained in:
jrandolf 2023-09-08 13:51:44 +02:00 committed by GitHub
parent f8c7a46448
commit 24a357dbdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 96 deletions

16
package-lock.json generated
View File

@ -3434,9 +3434,9 @@
}
},
"node_modules/chromium-bidi": {
"version": "0.4.22",
"resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.22.tgz",
"integrity": "sha512-wR7Y9Ioez+cNXT4ZP7VNM1HRTljpNnMSLw4/RnwhhZUP4yCU7kIQND00YiktuHekch68jklGPK1q9Jkb29+fQg==",
"version": "0.4.25",
"resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.25.tgz",
"integrity": "sha512-wQOIgYulshTLpZtuDO/eKFfKqVtpS2UwFVVqi/9q5rX/VXVkYNb/0mZ5l479W24A5ogYKBKEIb6BxMlhMcpXFw==",
"dependencies": {
"mitt": "3.0.1"
},
@ -11115,7 +11115,7 @@
"license": "Apache-2.0",
"dependencies": {
"@puppeteer/browsers": "1.7.0",
"chromium-bidi": "0.4.22",
"chromium-bidi": "0.4.25",
"cross-fetch": "4.0.0",
"debug": "4.3.4",
"devtools-protocol": "0.0.1159816",
@ -13466,9 +13466,9 @@
"dev": true
},
"chromium-bidi": {
"version": "0.4.22",
"resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.22.tgz",
"integrity": "sha512-wR7Y9Ioez+cNXT4ZP7VNM1HRTljpNnMSLw4/RnwhhZUP4yCU7kIQND00YiktuHekch68jklGPK1q9Jkb29+fQg==",
"version": "0.4.25",
"resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.25.tgz",
"integrity": "sha512-wQOIgYulshTLpZtuDO/eKFfKqVtpS2UwFVVqi/9q5rX/VXVkYNb/0mZ5l479W24A5ogYKBKEIb6BxMlhMcpXFw==",
"requires": {
"mitt": "3.0.1"
}
@ -17257,7 +17257,7 @@
"version": "file:packages/puppeteer-core",
"requires": {
"@puppeteer/browsers": "1.7.0",
"chromium-bidi": "0.4.22",
"chromium-bidi": "0.4.25",
"cross-fetch": "4.0.0",
"debug": "4.3.4",
"devtools-protocol": "0.0.1159816",

View File

@ -141,7 +141,7 @@
"license": "Apache-2.0",
"dependencies": {
"@puppeteer/browsers": "1.7.0",
"chromium-bidi": "0.4.22",
"chromium-bidi": "0.4.25",
"cross-fetch": "4.0.0",
"debug": "4.3.4",
"devtools-protocol": "0.0.1159816",

View File

@ -157,8 +157,6 @@ export class BidiBrowser extends Browser {
}
#onContextDomLoaded(event: Bidi.BrowsingContext.Info) {
const context = this.#connection.getBrowsingContext(event.context);
context.url = event.url;
const target = this.#targets.get(event.context);
if (target) {
this.emit(BrowserEmittedEvents.TargetChanged, target);
@ -166,8 +164,6 @@ export class BidiBrowser extends Browser {
}
#onContextNavigation(event: Bidi.BrowsingContext.NavigationInfo) {
const context = this.#connection.getBrowsingContext(event.context);
context.url = event.url;
const target = this.#targets.get(event.context);
if (target) {
this.emit(BrowserEmittedEvents.TargetChanged, target);

View File

@ -155,6 +155,7 @@ export class BrowsingContext extends Realm {
this.#cdpSession = new CDPSessionWrapper(this, undefined);
this.on('browsingContext.domContentLoaded', this.#updateUrl.bind(this));
this.on('browsingContext.fragmentNavigated', this.#updateUrl.bind(this));
this.on('browsingContext.load', this.#updateUrl.bind(this));
}
@ -163,7 +164,7 @@ export class BrowsingContext extends Realm {
}
#updateUrl(info: Bidi.BrowsingContext.NavigationInfo) {
this.url = info.url;
this.#url = info.url;
}
createRealmForSandbox(): Realm {
@ -174,10 +175,6 @@ export class BrowsingContext extends Realm {
return this.#url;
}
set url(value: string) {
this.#url = value;
}
get id(): string {
return this.#id;
}
@ -190,10 +187,6 @@ export class BrowsingContext extends Realm {
return this.#cdpSession;
}
navigated(url: string): void {
this.#url = url;
}
async goto(
url: string,
options: {

View File

@ -85,12 +85,12 @@ export class BidiPage extends Page {
['log.entryAdded', this.#onLogEntryAdded.bind(this)],
['browsingContext.load', this.#onFrameLoaded.bind(this)],
[
'browsingContext.domContentLoaded',
this.#onFrameDOMContentLoaded.bind(this),
'browsingContext.fragmentNavigated',
this.#onFrameFragmentNavigated.bind(this),
],
[
'browsingContext.navigationStarted',
this.#onFrameNavigationStarted.bind(this),
'browsingContext.domContentLoaded',
this.#onFrameDOMContentLoaded.bind(this),
],
['browsingContext.userPromptOpened', this.#onDialog.bind(this)],
]);
@ -246,6 +246,13 @@ export class BidiPage extends Page {
}
}
#onFrameFragmentNavigated(info: Bidi.BrowsingContext.NavigationInfo): void {
const frame = this.frame(info.context);
if (frame) {
this.emit(PageEmittedEvents.FrameNavigated, frame);
}
}
#onFrameDOMContentLoaded(info: Bidi.BrowsingContext.NavigationInfo): void {
const frame = this.frame(info.context);
if (frame) {
@ -253,6 +260,7 @@ export class BidiPage extends Page {
if (this.mainFrame() === frame) {
this.emit(PageEmittedEvents.DOMContentLoaded);
}
this.emit(PageEmittedEvents.FrameNavigated, frame);
}
}
@ -274,45 +282,6 @@ export class BidiPage extends Page {
}
}
async #onFrameNavigationStarted(
info: Bidi.BrowsingContext.NavigationInfo
): Promise<void> {
const frameId = info.context;
const frame = this.frame(frameId);
if (frame) {
// TODO: Investigate if a navigationCompleted event should be in Spec
const predicate = (
event: Bidi.BrowsingContext.DomContentLoaded['params']
) => {
if (event.context === frame?._id) {
return true;
}
return false;
};
await Deferred.race([
waitForEvent(
this.#connection,
'browsingContext.domContentLoaded',
predicate,
0,
this.#closedDeferred.valueOrThrow()
).catch(debugError),
waitForEvent(
this.#connection,
'browsingContext.fragmentNavigated',
predicate,
0,
this.#closedDeferred.valueOrThrow()
).catch(debugError),
]);
this.emit(PageEmittedEvents.FrameNavigated, frame);
}
}
#onContextDestroyed(context: BrowsingContext): void {
const frame = this.frame(context.id);

View File

@ -2291,18 +2291,6 @@
"parameters": ["cdp", "firefox"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should work right after framenavigated",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should work right after framenavigated",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[fixtures.spec] Fixtures should close the browser when the node process closes",
"platforms": ["darwin", "linux", "win32"],
@ -2991,7 +2979,7 @@
"testIdPattern": "[navigation.spec] navigation Page.goto should return response when page changes its URL after load",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
"expectations": ["PASS"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.goto should send referer",
@ -3035,24 +3023,12 @@
"parameters": ["chrome", "headless"],
"expectations": ["PASS", "TIMEOUT"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.goto should work with redirects",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.goto should work with subframes return 204",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.reload should work",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work",
"platforms": ["darwin", "linux", "win32"],
@ -3353,12 +3329,6 @@
"parameters": ["cdp", "firefox"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[network.spec] network Response.fromCache should work",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[network.spec] network Response.fromCache should work",
"platforms": ["darwin", "linux", "win32"],