fune/testing/web-platform/tests/IndexedDB/idbdatabase-deleteObjectStore-exception-order.htm
Ari Chivukula 8dd06510b1 Bug 1770831 [wpt PR 34171] - [IndexedDB] Cleanup WPT directory, a=testonly
Automatic update from web-platform-tests
[IndexedDB] Cleanup WPT directory

Some common/resource files were in the root directory. This moves them
to the /resources/ directory and fixes up include paths.

Bug: 1218100
Change-Id: If84f7d1670e9416c95eb0fd96de63add4dcacedf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3661378
Auto-Submit: Ari Chivukula <arichiv@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1006619}

--

wpt-commits: 96ea2c2b7bf09644db195f0d878074615faef9e4
wpt-pr: 34171
2022-05-25 08:46:09 +00:00

45 lines
1.5 KiB
HTML

<!DOCTYPE html>
<title>IndexedDB: IDBDatabase deleteObjectStore() Exception Ordering</title>
<meta charset=utf-8>
<link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbdatabase-deleteobjectstore">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/support.js"></script>
<script>
indexeddb_test(
(t, db, txn) => {
db.createObjectStore('s');
txn.onabort = () => {
setTimeout(t.step_func(() => {
assert_throws_dom(
'InvalidStateError', () => { db.deleteObjectStore('s'); },
'"running an upgrade transaction" check (InvalidStateError) ' +
'should precede "not active" check (TransactionInactiveError)');
t.done();
}), 0);
};
txn.abort();
},
(t, db) => { t.assert_unreached('open should fail'); },
'IDBDatabase.deleteObjectStore exception order: ' +
'InvalidStateError vs. TransactionInactiveError',
{ upgrade_will_abort: true }
);
indexeddb_test(
(t, db, txn) => {
txn.abort();
assert_throws_dom(
'TransactionInactiveError', () => { db.deleteObjectStore('nope'); },
'"not active" check (TransactionInactiveError) should precede ' +
'"name in database" check (NotFoundError)');
t.done();
},
(t, db) => { t.assert_unreached('open should fail'); },
'IDBDatabase.deleteObjectStore exception order: ' +
'TransactionInactiveError vs. NotFoundError',
{ upgrade_will_abort: true }
);
</script>