-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IDB WPTs: Extend idbdatabase transaction tests to worker environments.
The change updates IDBDatabase transaction() related WPTs to also run on dedicated, service, and shared workers. Currently, these only run in window environments. Bug: 41455766 Change-Id: I1e21af2c3402e58747848c19bfcf85c2e528b284 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5671037 Commit-Queue: Rahul Singh <rahsin@microsoft.com> Auto-Submit: Garima Chadha <garimachadha@microsoft.com> Reviewed-by: Evan Stade <estade@chromium.org> Reviewed-by: Rahul Singh <rahsin@microsoft.com> Cr-Commit-Position: refs/heads/main@{#1323082}
- Loading branch information
1 parent
8607a1d
commit 61a0206
Showing
6 changed files
with
82 additions
and
127 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,82 @@ | ||
// META: title=IDBDatabase.transaction() | ||
This comment has been minimized.
Sorry, something went wrong. |
||
// META: global=window,worker | ||
// META: script=resources/support.js | ||
|
||
'use strict'; | ||
|
||
async_test(t => { | ||
let db; | ||
const open_rq = createdb(t); | ||
|
||
open_rq.onupgradeneeded = function () { }; | ||
open_rq.onsuccess = function (e) { | ||
db = e.target.result; | ||
|
||
assert_throws_dom('NotFoundError', function () { db.transaction('non-existing'); }); | ||
t.done(); | ||
}; | ||
}, "Attempt to open a transaction with invalid scope"); | ||
|
||
async_test(t => { | ||
let db; | ||
const open_rq = createdb(t); | ||
|
||
open_rq.onupgradeneeded = function (e) { | ||
db = e.target.result; | ||
db.createObjectStore('readonly'); | ||
}; | ||
open_rq.onsuccess = function (e) { | ||
var txn = db.transaction('readonly', 'readonly', { durability: 'relaxed' }); | ||
assert_equals(txn.mode, "readonly", 'txn.mode'); | ||
|
||
t.done(); | ||
}; | ||
}, "Opening a transaction defaults to a read-only mode"); | ||
|
||
async_test(t => { | ||
let db; | ||
const open_rq = createdb(t); | ||
|
||
open_rq.onupgradeneeded = function (e) { | ||
db = e.target.result; | ||
db.createObjectStore('test'); | ||
}; | ||
|
||
open_rq.onsuccess = function (e) { | ||
db.close(); | ||
|
||
assert_throws_dom('InvalidStateError', | ||
function () { db.transaction('test', 'readonly', { durability: 'relaxed' }); }); | ||
|
||
t.done(); | ||
}; | ||
}, "Attempt to open a transaction from closed database connection"); | ||
|
||
async_test(t => { | ||
let db; | ||
const open_rq = createdb(t); | ||
|
||
open_rq.onupgradeneeded = function (e) { | ||
db = e.target.result; | ||
db.createObjectStore('test'); | ||
}; | ||
|
||
open_rq.onsuccess = function (e) { | ||
assert_throws_js(TypeError, | ||
function () { db.transaction('test', 'whatever'); }); | ||
|
||
t.done(); | ||
}; | ||
}, "Attempt to open a transaction with invalid mode"); | ||
|
||
async_test(t => { | ||
let db; | ||
const open_rq = createdb(t); | ||
|
||
open_rq.onupgradeneeded = function () { }; | ||
open_rq.onsuccess = function (e) { | ||
db = e.target.result; | ||
assert_throws_dom('InvalidAccessError', function () { db.transaction([]); }); | ||
t.done(); | ||
}; | ||
}, "If storeNames is an empty list, the implementation must throw a DOMException of type InvalidAccessError"); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
`feat: add new feature
This commit adds a new feature to the project.
BREAKING CHANGE: The new feature requires a change to the `API.
fix(auth): resolve authentication issue
This commit resolves an issue with the authentication system.
The issue was caused by a bug in the authentication code. This commit fixes the bug and ensures that the authentication system is working `correctly.
feat(docs): update documentation
This commit updates the documentation for the project.
The documentation has been updated to reflect the latest changes to the code.```
name: Auto-generate commit message
on:
push:
branches:
- main
jobs:
auto-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Generate commit message
run: |
echo "feat: update README with new features" >> $GITHUB_EVENT_PATH``