Skip to content

Commit e1606ac

Browse files
fix(webdriver): redirects emitting events (#12338)
1 parent c2244d3 commit e1606ac

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

packages/puppeteer-core/src/bidi/HTTPRequest.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ export class BidiHTTPRequest extends HTTPRequest {
6767
#initialize() {
6868
this.#request.on('redirect', request => {
6969
const httpRequest = BidiHTTPRequest.from(request, this.#frame, this);
70+
request.once('success', () => {
71+
this.#frame
72+
.page()
73+
.trustedEmitter.emit(PageEvent.RequestFinished, httpRequest);
74+
});
75+
76+
request.once('error', () => {
77+
this.#frame
78+
.page()
79+
.trustedEmitter.emit(PageEvent.RequestFailed, httpRequest);
80+
});
7081
void httpRequest.finalizeInterceptions();
7182
});
7283
this.#request.once('success', data => {

test/TestExpectations.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4087,13 +4087,6 @@
40874087
"expectations": ["FAIL", "PASS"],
40884088
"comment": "TODO: add a comment explaining why this expectation is required (include links to issues)"
40894089
},
4090-
{
4091-
"testIdPattern": "[network.spec] network Network Events should support redirects",
4092-
"platforms": ["linux"],
4093-
"parameters": ["chrome", "headless", "webDriverBiDi"],
4094-
"expectations": ["FAIL"],
4095-
"comment": "Fix in next PR"
4096-
},
40974090
{
40984091
"testIdPattern": "[network.spec] network raw network headers Same-origin set-cookie subresource",
40994092
"platforms": ["darwin", "linux", "win32"],

0 commit comments

Comments
 (0)