From 42bb850e5ae126c2599353d005e8f979de5d88c8 Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Mon, 14 Jul 2025 18:19:35 +0200 Subject: [PATCH 1/3] experiment: rely on `Network.loadingFinished` --- src/bidiMapper/modules/network/NetworkRequest.ts | 11 ++++++++++- src/bidiMapper/modules/network/NetworkStorage.ts | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/bidiMapper/modules/network/NetworkRequest.ts b/src/bidiMapper/modules/network/NetworkRequest.ts index 53225fd713..37494c4e30 100644 --- a/src/bidiMapper/modules/network/NetworkRequest.ts +++ b/src/bidiMapper/modules/network/NetworkRequest.ts @@ -65,6 +65,8 @@ export class NetworkRequest { #fetchId?: Protocol.Fetch.RequestId; + #finished = false; + /** * Indicates the network intercept phase, if the request is currently blocked. * Undefined necessarily implies that the request is not blocked. @@ -473,7 +475,8 @@ export class NetworkRequest { if ( Boolean(this.#response.info) && responseExtraInfoCompleted && - responseInterceptionCompleted + responseInterceptionCompleted && + this.#finished ) { this.#emitEvent(this.#getResponseReceivedEvent.bind(this)); this.#networkStorage.disposeRequest(this.id); @@ -523,6 +526,7 @@ export class NetworkRequest { } onLoadingFailedEvent(event: Protocol.Network.LoadingFailedEvent) { + this.#finished = true; this.#emitEventsIfReady({ hasFailed: true, }); @@ -1100,6 +1104,11 @@ export class NetworkRequest { return 'other'; } } + + onLoadingFinished(): void { + this.#finished = true; + this.#emitEventsIfReady(); + } } function getCdpBodyFromBiDiBytesValue( diff --git a/src/bidiMapper/modules/network/NetworkStorage.ts b/src/bidiMapper/modules/network/NetworkStorage.ts index 0f04fc6af2..512b87c31a 100644 --- a/src/bidiMapper/modules/network/NetworkStorage.ts +++ b/src/bidiMapper/modules/network/NetworkStorage.ts @@ -161,6 +161,15 @@ export class NetworkStorage { ).onResponseReceivedExtraInfoEvent(params); }, ], + [ + 'Network.loadingFinished', + (params: Protocol.Network.LoadingFinishedEvent) => { + this.#getOrCreateNetworkRequest( + params.requestId, + cdpTarget, + ).onLoadingFinished(); + }, + ], [ 'Network.requestServedFromCache', (params: Protocol.Network.RequestServedFromCacheEvent) => { From 8f7ae5199ff89ae557c343d6918eec99831244ed Mon Sep 17 00:00:00 2001 From: browser-automation-bot <133232582+browser-automation-bot@users.noreply.github.com> Date: Wed, 16 Jul 2025 10:19:22 +0200 Subject: [PATCH 2/3] test: expectations update the #3575 (#3579) Update the expectations for PR #3575. Automatically generated by https://github.com/GoogleChromeLabs/chromium-bidi/blob/main/.github/workflows/wpt.yml --- .../bidi/input/perform_actions/key_events.py.ini | 3 --- .../bidi/network/combined/network_events.py.ini | 3 +++ .../bidi/network/fetch_error/fetch_error.py.ini | 2 ++ .../response_completed/response_completed.py.ini | 12 ++++++++++++ .../response_completed_cached.py.ini | 3 +++ .../bidi/network/combined/network_events.py.ini | 3 +++ .../bidi/network/fetch_error/fetch_error.py.ini | 2 ++ .../response_completed/response_completed.py.ini | 12 ++++++++++++ .../response_completed_cached.py.ini | 3 +++ .../bidi/network/fetch_error/fetch_error.py.ini | 2 ++ .../response_completed/response_completed.py.ini | 1 + .../response_completed_cached.py.ini | 3 +++ 12 files changed, 46 insertions(+), 3 deletions(-) delete mode 100644 wpt-metadata/chromedriver/headful/webdriver/tests/bidi/input/perform_actions/key_events.py.ini create mode 100644 wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/combined/network_events.py.ini create mode 100644 wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini create mode 100644 wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini create mode 100644 wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/combined/network_events.py.ini create mode 100644 wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini create mode 100644 wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini create mode 100644 wpt-metadata/mapper/headless/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini create mode 100644 wpt-metadata/mapper/headless/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini diff --git a/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/input/perform_actions/key_events.py.ini b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/input/perform_actions/key_events.py.ini deleted file mode 100644 index d8e3cfe9f3..0000000000 --- a/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/input/perform_actions/key_events.py.ini +++ /dev/null @@ -1,3 +0,0 @@ -[key_events.py] - [test_non_printable_key_sends_events[\\ue00c-ESCAPE\]] - expected: FAIL diff --git a/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/combined/network_events.py.ini b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/combined/network_events.py.ini new file mode 100644 index 0000000000..adc3f048c5 --- /dev/null +++ b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/combined/network_events.py.ini @@ -0,0 +1,3 @@ +[network_events.py] + [test_event_order_with_redirect] + expected: FAIL diff --git a/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini new file mode 100644 index 0000000000..1fdaf2fc4a --- /dev/null +++ b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini @@ -0,0 +1,2 @@ +[fetch_error.py] + expected: TIMEOUT diff --git a/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/response_completed/response_completed.py.ini b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/response_completed/response_completed.py.ini index acde9fac86..d039f1e891 100644 --- a/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/response_completed/response_completed.py.ini +++ b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/response_completed/response_completed.py.ini @@ -4,3 +4,15 @@ [test_response_status[407-Proxy Authentication Required\]] expected: FAIL + + [test_redirect] + expected: FAIL + + [test_redirect_document[http\]] + expected: FAIL + + [test_redirect_document[https\]] + expected: FAIL + + [test_redirect_document[https coop\]] + expected: FAIL diff --git a/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini new file mode 100644 index 0000000000..35c099cccc --- /dev/null +++ b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini @@ -0,0 +1,3 @@ +[response_completed_cached.py] + [test_cached_redirect] + expected: FAIL diff --git a/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/combined/network_events.py.ini b/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/combined/network_events.py.ini new file mode 100644 index 0000000000..adc3f048c5 --- /dev/null +++ b/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/combined/network_events.py.ini @@ -0,0 +1,3 @@ +[network_events.py] + [test_event_order_with_redirect] + expected: FAIL diff --git a/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini b/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini new file mode 100644 index 0000000000..1fdaf2fc4a --- /dev/null +++ b/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini @@ -0,0 +1,2 @@ +[fetch_error.py] + expected: TIMEOUT diff --git a/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/response_completed/response_completed.py.ini b/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/response_completed/response_completed.py.ini index acde9fac86..d039f1e891 100644 --- a/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/response_completed/response_completed.py.ini +++ b/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/response_completed/response_completed.py.ini @@ -4,3 +4,15 @@ [test_response_status[407-Proxy Authentication Required\]] expected: FAIL + + [test_redirect] + expected: FAIL + + [test_redirect_document[http\]] + expected: FAIL + + [test_redirect_document[https\]] + expected: FAIL + + [test_redirect_document[https coop\]] + expected: FAIL diff --git a/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini b/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini new file mode 100644 index 0000000000..35c099cccc --- /dev/null +++ b/wpt-metadata/chromedriver/headless/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini @@ -0,0 +1,3 @@ +[response_completed_cached.py] + [test_cached_redirect] + expected: FAIL diff --git a/wpt-metadata/mapper/headless/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini b/wpt-metadata/mapper/headless/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini new file mode 100644 index 0000000000..1fdaf2fc4a --- /dev/null +++ b/wpt-metadata/mapper/headless/webdriver/tests/bidi/network/fetch_error/fetch_error.py.ini @@ -0,0 +1,2 @@ +[fetch_error.py] + expected: TIMEOUT diff --git a/wpt-metadata/mapper/headless/webdriver/tests/bidi/network/response_completed/response_completed.py.ini b/wpt-metadata/mapper/headless/webdriver/tests/bidi/network/response_completed/response_completed.py.ini index acde9fac86..cf98402e7a 100644 --- a/wpt-metadata/mapper/headless/webdriver/tests/bidi/network/response_completed/response_completed.py.ini +++ b/wpt-metadata/mapper/headless/webdriver/tests/bidi/network/response_completed/response_completed.py.ini @@ -1,4 +1,5 @@ [response_completed.py] + expected: TIMEOUT [test_response_status[101-Switching Protocols\]] expected: FAIL diff --git a/wpt-metadata/mapper/headless/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini b/wpt-metadata/mapper/headless/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini new file mode 100644 index 0000000000..35c099cccc --- /dev/null +++ b/wpt-metadata/mapper/headless/webdriver/tests/bidi/network/response_completed/response_completed_cached.py.ini @@ -0,0 +1,3 @@ +[response_completed_cached.py] + [test_cached_redirect] + expected: FAIL From 7cfd00af98f02ff7758e0b978e6f40d50007d61d Mon Sep 17 00:00:00 2001 From: browser-automation-bot <133232582+browser-automation-bot@users.noreply.github.com> Date: Wed, 16 Jul 2025 10:55:19 +0200 Subject: [PATCH 3/3] test: expectations update the #3575 (#3581) Update the expectations for PR #3575. Automatically generated by https://github.com/GoogleChromeLabs/chromium-bidi/blob/main/.github/workflows/wpt.yml --- .../tests/bidi/input/perform_actions/key_events.py.ini | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 wpt-metadata/chromedriver/headful/webdriver/tests/bidi/input/perform_actions/key_events.py.ini diff --git a/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/input/perform_actions/key_events.py.ini b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/input/perform_actions/key_events.py.ini new file mode 100644 index 0000000000..d8e3cfe9f3 --- /dev/null +++ b/wpt-metadata/chromedriver/headful/webdriver/tests/bidi/input/perform_actions/key_events.py.ini @@ -0,0 +1,3 @@ +[key_events.py] + [test_non_printable_key_sends_events[\\ue00c-ESCAPE\]] + expected: FAIL