author | Numfor Mbiziwo-Tiapo <nums@google.com> |
Fri, 07 Aug 2020 12:39:09 +0000 | |
changeset 544784 | 3745b033265ff9eb4a6ebd21782fbaadfcb5b841 |
parent 544783 | 3842825edffbb062e5ab30cc2a8217ae1eb19ee1 |
child 544785 | b5c5c9f7060f9f8e3daeb0a2d2b504fa4d9e82f6 |
push id | 124254 |
push user | wptsync@mozilla.com |
push date | Sat, 15 Aug 2020 07:08:45 +0000 |
treeherder | autoland@3f1068b2fb00 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | testonly |
bugs | 1655193, 24746, 1087927, 2310110, 793656 |
milestone | 81.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
testing/web-platform/tests/IndexedDB/idbobjectstore_putall.tentative.any.js | file | annotate | diff | comparison | revisions |
--- a/testing/web-platform/tests/IndexedDB/idbobjectstore_putall.tentative.any.js +++ b/testing/web-platform/tests/IndexedDB/idbobjectstore_putall.tentative.any.js @@ -1,30 +1,31 @@ // META: script=support-promises.js promise_test(async testCase => { const db = await createDatabase(testCase, db => { const store = createBooksStore(testCase, db); - let values = [ - {isbn: 'one', title: 'title1'}, - {isbn: 'two', title: 'title2'}, - {isbn: 'three', title: 'title3'} - ]; - const putAllRequests = store.putAll(values); - putAllRequests.forEach(async request => { - await promiseForRequest(testCase, request); - }); }); - - const txn = db.transaction(['books'], 'readonly'); + const txn = db.transaction(['books'], 'readwrite'); const objectStore = txn.objectStore('books'); - const getRequest1 = objectStore.get('one'); - const getRequest2 = objectStore.get('two'); - const getRequest3 = objectStore.get('three'); + let values = [ + {isbn: 'one', title: 'title1'}, + {isbn: 'two', title: 'title2'}, + {isbn: 'three', title: 'title3'} + ]; + let putAllRequest = objectStore.putAll(values); + await promiseForRequest(testCase, putAllRequest); await promiseForTransaction(testCase, txn); + + const txn2 = db.transaction(['books'], 'readonly'); + const objectStore2 = txn2.objectStore('books'); + const getRequest1 = objectStore2.get('one'); + const getRequest2 = objectStore2.get('two'); + const getRequest3 = objectStore2.get('three'); + await promiseForTransaction(testCase, txn2); assert_array_equals( [getRequest1.result.title, getRequest2.result.title, getRequest3.result.title], ['title1', 'title2', 'title3'], 'All three retrieved titles should match those that were put.'); db.close(); -}, 'Data can be successfully inputted into an object store using putAll.'); \ No newline at end of file +}, 'Data can be successfully inputted into an object store using putAll.');