-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IndexedDB: add WPT to verify factory behavior when doc not fully active
WPT for w3c/IndexedDB#412 Bug: 1473972 Change-Id: I83ce4c771232cae663753a8e12ff5b959dc9f484
- Loading branch information
1 parent
29c8bd8
commit b9c0a17
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!doctype html> | ||
<title>indexedDB methods throw after document deactivation.</title> | ||
<meta charset="utf8"> | ||
<meta name="timeout" content="long"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="resources/support-promises.js"></script> | ||
<script> | ||
'use strict'; | ||
|
||
promise_test(async testCase => { | ||
await deleteAllDatabases(testCase); | ||
|
||
let frame = document.createElement('iframe'); | ||
frame.src = location; | ||
document.body.append(frame); | ||
let frameIdb = frame.contentWindow.indexedDB; | ||
|
||
let dbName = databaseName(testCase); | ||
let req1 = frameIdb.open(dbName); | ||
assert_not_equals(req1, null); | ||
frame.remove(); | ||
|
||
let req2; | ||
assert_throws_dom('FooError', | ||
() => { req2 = frameIdb.open(dbName); }, | ||
'After document is inactive, open() should throw.'); | ||
assert_equals(req2, null); | ||
}, 'Foo'); | ||
|
||
</script> |