Skip to content

Commit

Permalink
chore: add todo for waitFor* / browser.disconnected event ordering (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt authored Aug 12, 2024
1 parent f8f6209 commit 78a4474
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Playwright/Core/BrowserType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ void OnPipeClosed(string reason = null)
}
browser?.DidClose();
connection.DoClose(reason ?? closeError);
// TODO: Backport https://github.com/microsoft/playwright/commit/d8d5289e8692c9b1265d23ee66988d1ac5122f33
// Give a chance to any API call promises to reject upon page/context closure.
// This happens naturally when we receive page.onClose and browser.onClose from the server
// in separate tasks. However, upon pipe closure we used to dispatch them all synchronously
// here and promises did not have a chance to reject.
// The order of rejects vs closure is a part of the API contract and our test runner
// relies on it to attribute rejections to the right test.
}
pipe.Closed += (_, reason) => OnPipeClosed(reason);
connection.OnMessage = async (object message, bool _) =>
Expand Down

0 comments on commit 78a4474

Please sign in to comment.