-
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.
IDB WPTs: Extend idbrequest WPTs to run on workers
This set of IndexedDB WPTs currently only run in a window environment. This change extends them to also run in dedicated, shared, and service worker environments. Bug: 41455766 Change-Id: I19b3e1fe6e4342529970edb906b39be505702388 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6214757 Reviewed-by: Steve Becker <[email protected]> Commit-Queue: Rahul Singh <[email protected]> Cr-Commit-Position: refs/heads/main@{#1413284}
- Loading branch information
1 parent
184a7bf
commit 402df69
Showing
5 changed files
with
83 additions
and
94 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
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,24 @@ | ||
// META: title=IDBRequest.error | ||
// META: global=window,worker | ||
// META: script=resources/support.js | ||
|
||
'use strict'; | ||
|
||
async_test(t => { | ||
let open = createdb(t); | ||
open.onupgradeneeded = t.step_func(e => { | ||
let db = e.target.result; | ||
db.createObjectStore('store'); | ||
}); | ||
open.onsuccess = t.step_func(e => { | ||
let db = e.target.result; | ||
let request = | ||
db.transaction('store', 'readonly').objectStore('store').get(0); | ||
|
||
assert_equals(request.readyState, 'pending'); | ||
assert_throws_dom( | ||
'InvalidStateError', () => request.error, | ||
'IDBRequest.error should throw if request is pending'); | ||
t.done(); | ||
}); | ||
}, 'IDBRequest.error throws if ready state is pending'); |
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
// META: title=IDBRequest.result | ||
// META: global=window,worker | ||
// META: script=resources/support.js | ||
|
||
'use strict'; | ||
|
||
async_test(t => { | ||
let open = createdb(t); | ||
open.onupgradeneeded = t.step_func(e => { | ||
let db = e.target.result; | ||
db.createObjectStore('store'); | ||
}); | ||
open.onsuccess = t.step_func(e => { | ||
let db = e.target.result; | ||
let request = | ||
db.transaction('store', 'readonly').objectStore('store').get(0); | ||
|
||
assert_equals(request.readyState, 'pending'); | ||
assert_throws_dom( | ||
'InvalidStateError', () => request.result, | ||
'IDBRequest.result should throw if request is pending'); | ||
t.done(); | ||
}); | ||
}, 'IDBRequest.result throws if ready state is pending'); |
This file was deleted.
Oops, something went wrong.