forked from mirrors/gecko-dev
Automatic update from web-platform-tests Update IndexedDB web tests to durability relaxed Updates IndexedDB web tests to use the durability relaxed option for transactions. This will speed up trybots. Bug: 1258341 Change-Id: I0bfdc1e8adb1490d41b196f6711bdb4131dbe4bc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3984246 Reviewed-by: Evan Stade <estade@chromium.org> Commit-Queue: Nathan Memmott <memmott@chromium.org> Cr-Commit-Position: refs/heads/main@{#1063963} -- wpt-commits: 8ce3ff8d1c66775db8c21692270ff0e05c366630 wpt-pr: 36674
34 lines
1 KiB
HTML
34 lines
1 KiB
HTML
<!doctype html>
|
|
<meta charset=utf-8>
|
|
<title>IndexedDB: The source of requests made against indexes</title>
|
|
<meta name="help" href="https://w3c.github.io/IndexedDB/#dom-idbrequest-source">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="resources/support.js"></script>
|
|
<script>
|
|
|
|
[
|
|
index => index.get(0),
|
|
index => index.getKey(0),
|
|
index => index.getAll(),
|
|
index => index.getAllKeys(),
|
|
index => index.count(),
|
|
|
|
index => index.openCursor(),
|
|
index => index.openKeyCursor()
|
|
].forEach(func => indexeddb_test(
|
|
(t, db) => {
|
|
const store = db.createObjectStore('store', {autoIncrement: true});
|
|
store.createIndex('index', 'kp');
|
|
},
|
|
(t, db) => {
|
|
const tx = db.transaction('store', 'readwrite', {durability: 'relaxed'});
|
|
const index = tx.objectStore('store').index('index');
|
|
assert_equals(func(index).source, index,
|
|
`${func}.source should be the index itself`);
|
|
t.done();
|
|
},
|
|
`The source of the request from ${func} is the index itself`
|
|
));
|
|
|
|
</script>
|