Skip to content

Commit

Permalink
fix(webdriver): redirects emitting events (#12338)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightning00Blade committed Apr 26, 2024
1 parent c2244d3 commit e1606ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 11 additions & 0 deletions packages/puppeteer-core/src/bidi/HTTPRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
7 changes: 0 additions & 7 deletions test/TestExpectations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit e1606ac

Please sign in to comment.