Bug 1912144 [wpt PR 47517] - Do not wait for events to be dispatched to IDBRequest, a=testonly

Automatic update from web-platform-tests
Do not wait for events to be dispatched to IDBRequest (#47517)

The test expects event to be dispatched to IDBRequest after its execution
context is stopped, but this is not standard behavior. WebKit and Blink can stop
dispatching event as soon as iframe is detached (iframe.remove() is invoked),
which leads to test timeout. Since the goal of the test is to verify the accessor
is still valid after execution context is destroyed (no exception is thrown), we
can just check readyState without wait. We only check the type instead of value
as different engines handle the destruction differently, so the state may not be
updated right away.
--

wpt-commits: fee8ca2d5f4462af5f1dd2cb31b4e38c7256f410
wpt-pr: 47517
This commit is contained in:
Sihui 2024-08-08 22:42:56 +00:00 коммит произвёл moz-wptsync-bot
Родитель b21b6b790b
Коммит ae6ecfac47
1 изменённых файлов: 1 добавлений и 5 удалений

Просмотреть файл

@ -21,11 +21,7 @@ promise_test(async t => {
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');
assert_equals(typeof openRequest.readyState, 'string');
}, 'readyState accessor is valid after execution context is destroyed');
</script>