fix: open no approval window for a site-connection prompt already answered (closes #287)
When a site-connection prompt was decided before the toolbar popup raised for it had loaded, that popup was torn down, chrome.action.openPopup() rejected, and the background opened its fallback window for the answered approval and only then removed it. In the Chrome end-to-end suite the next test could take that window for its own prompt and lose it under its wait. openApprovalWindow() now returns before creating a window when the approval is no longer pending. The blocklist test clicked its self-closing Reject with a plain click; it now clicks it as the other site Reject does, with the click witnessed. Model: opus-5-5
This commit is contained in:
+4
-2
@@ -2738,7 +2738,7 @@ async function closeApprovalPages(ctx) {
|
||||
// #btn-reject on the site prompt — NOT self-proving. A page that went away
|
||||
// without the click landing disconnects the approval port, the background
|
||||
// settles that as 4001, and 4001 is exactly what assertUserRejection
|
||||
// accepts. That call site arms the click trace below and asserts it.
|
||||
// accepts. Both call sites arm the click trace below and assert it.
|
||||
//
|
||||
// A button that is missing or unclickable raises a different error, which is
|
||||
// rethrown.
|
||||
@@ -3124,7 +3124,9 @@ test("a connect request from a blocklisted site is flagged (#219)", async (env)
|
||||
// Not remembered: a remembered decision for this origin would
|
||||
// outlive the test.
|
||||
await popup.uncheck("#approve-remember");
|
||||
await popup.click("#btn-reject");
|
||||
await armClickTrace(env, popup, "#btn-reject");
|
||||
await clickAndClose(popup, "#btn-reject");
|
||||
await assertClickLanded(env, "#btn-reject");
|
||||
|
||||
await assertUserRejection(
|
||||
phishingDapp,
|
||||
|
||||
Reference in New Issue
Block a user