Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /IndexedDB/ready-state-destroyed-execution-context.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset=utf-8>
<title>readyState is valid when the execution context is destroyed</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=resources/support.js></script>
<script>
function load_iframe() {
return new Promise(resolve => {
const iframe = document.createElement('iframe');
iframe.onload = () => { resolve(iframe); };
document.documentElement.appendChild(iframe);
});
}
promise_test(async t => {
const iframe = await load_iframe();
const dbname = location + '-' + t.name;
const openRequest = iframe.contentWindow.indexedDB.open(dbname);
assert_equals(openRequest.readyState, 'pending');
iframe.remove();
assert_equals(typeof openRequest.readyState, 'string');
}, 'readyState accessor is valid after execution context is destroyed');
</script>