Skip to content

Commit

Permalink
IDB WPTs: Extend idbtransaction-objectStore related tests to workers
Browse files Browse the repository at this point in the history
The update modifies idbtransaction-objectStore related WPTs to run not
only in window environments but also on dedicated, service, and shared
workers.

Bug: 41455766
Change-Id: I78c3ac5bece152c71343b7ca01618ca9789e3ab1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5913117
Auto-Submit: Garima Chadha <[email protected]>
Reviewed-by: Steve Becker <[email protected]>
Reviewed-by: Rahul Singh <[email protected]>
Commit-Queue: Garima Chadha <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1409462}
  • Loading branch information
Garima Chadha authored and chromium-wpt-export-bot committed Jan 22, 2025
1 parent b0074f3 commit 719c62b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 36 deletions.
23 changes: 23 additions & 0 deletions IndexedDB/idbtransaction-objectStore-exception-order.any.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// META: global=window,worker
// META: title=IndexedDB: IDBTransaction objectStore() Exception Ordering
// META: script=resources/support.js

// Spec: https://w3c.github.io/IndexedDB/#dom-idbtransaction-objectstore

'use strict';

indexeddb_test(
(t, db) => {
const store = db.createObjectStore('s');
},
(t, db) => {
const tx = db.transaction('s', 'readonly');
tx.oncomplete = t.step_func(() => {
assert_throws_dom('InvalidStateError', () => { tx.objectStore('nope'); },
'"finished" check (InvalidStateError) should precede ' +
'"name in scope" check (NotFoundError)');
t.done();
});
},
'IDBTransaction.objectStore exception order: InvalidStateError vs. NotFoundError'
);
26 changes: 0 additions & 26 deletions IndexedDB/idbtransaction-objectStore-exception-order.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<!doctype html>
<meta charset=utf-8>
<title>IndexedDB: IDBTransaction objectStore() when transaction is finished</title>
<link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbtransaction-objectstore">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/support.js"></script>
<script>
// META: global=window,worker
// META: title=IndexedDB: IDBTransaction objectStore() when transaction is finished
// META: script=resources/support.js

// Spec: https://w3c.github.io/IndexedDB/#dom-idbtransaction-objectstore

'use strict';

indexeddb_test(
(t, db) => {
Expand All @@ -20,5 +19,3 @@
},
'IDBTransaction objectStore() behavior when transaction is finished'
);

</script>

0 comments on commit 719c62b

Please sign in to comment.