fix(webdriver): redirects emitting events (#12338)

This commit is contained in:
Nikolay Vitkov 2024-04-26 12:28:11 +02:00 committed by GitHub
parent c2244d301a
commit e1606acfc8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View File

@ -67,6 +67,17 @@ export class BidiHTTPRequest extends HTTPRequest {
#initialize() {
this.#request.on('redirect', request => {
const httpRequest = BidiHTTPRequest.from(request, this.#frame, this);
request.once('success', () => {
this.#frame
.page()
.trustedEmitter.emit(PageEvent.RequestFinished, httpRequest);
});
request.once('error', () => {
this.#frame
.page()
.trustedEmitter.emit(PageEvent.RequestFailed, httpRequest);
});
void httpRequest.finalizeInterceptions();
});
this.#request.once('success', data => {

View File

@ -4087,13 +4087,6 @@
"expectations": ["FAIL", "PASS"],
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
},
{
"testIdPattern": "[network.spec] network Network Events should support redirects",
"platforms": ["linux"],
"parameters": ["chrome", "headless", "webDriverBiDi"],
"expectations": ["FAIL"],
"comment": "Fix in next PR"
},
{
"testIdPattern": "[network.spec] network raw network headers Same-origin set-cookie subresource",
"platforms": ["darwin", "linux", "win32"],