From 1849930aff8c8fb16ad56e280ceff2292688a89c Mon Sep 17 00:00:00 2001 From: Jari Jalkanen Date: Mon, 25 Mar 2024 06:08:19 +0000 Subject: [PATCH] Handle delay between context invalidation and IDB request state. Differential Revision: https://phabricator.services.mozilla.com/D203270 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1878146 gecko-commit: 0d93f14cf7ca90ca61ea3ecd31b6992446a4a77c gecko-reviewers: asuth --- IndexedDB/ready-state-destroyed-execution-context.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/IndexedDB/ready-state-destroyed-execution-context.html b/IndexedDB/ready-state-destroyed-execution-context.html index 8194052391a779..6b2677fae799bf 100644 --- a/IndexedDB/ready-state-destroyed-execution-context.html +++ b/IndexedDB/ready-state-destroyed-execution-context.html @@ -21,6 +21,10 @@ const openRequest = iframe.contentWindow.indexedDB.open(dbname); assert_equals(openRequest.readyState, 'pending'); iframe.remove(); + await new Promise(resolve => { + openRequest.onerror = resolve; + openRequest.onsuccess = resolve; + }); assert_equals(openRequest.readyState, 'done'); }, 'readyState accessor is valid after execution context is destroyed');