Bug 1655193 [wpt PR 24746] - Updating the putAll implementation to return one request., a=testonly
authorNumfor Mbiziwo-Tiapo <nums@google.com>
Fri, 07 Aug 2020 12:39:09 +0000
changeset 544784 3745b033265ff9eb4a6ebd21782fbaadfcb5b841
parent 544783 3842825edffbb062e5ab30cc2a8217ae1eb19ee1
child 544785 b5c5c9f7060f9f8e3daeb0a2d2b504fa4d9e82f6
push id124254
push userwptsync@mozilla.com
push dateSat, 15 Aug 2020 07:08:45 +0000
treeherderautoland@3f1068b2fb00 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1655193, 24746, 1087927, 2310110, 793656
milestone81.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
Bug 1655193 [wpt PR 24746] - Updating the putAll implementation to return one request., a=testonly Automatic update from web-platform-tests Updating the putAll implementation to return one request. This change updates the existing putAll implementation to match the explainer more. It does not yet support the put-all-or-none behavior, but it does only return one request now. Design Doc: https://docs.google.com/document/d/1wawQ8Pl-Vi6GQN5-y2UVkcghipcOGg0WRAC0ZyBkezg/edit# Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1087927 Change-Id: I2c5e9d2d71801eaab3c1c9e94a3968afb8d109b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2310110 Commit-Queue: Numfor Mbiziwo-tiapo <nums@google.com> Commit-Queue: Daniel Murphy <dmurph@chromium.org> Reviewed-by: Daniel Murphy <dmurph@chromium.org> Reviewed-by: Olivier Yiptong <oyiptong@chromium.org> Cr-Commit-Position: refs/heads/master@{#793656} -- wpt-commits: 18b9e70e4a3c3cc30cd05f34bff9093b0313b93e wpt-pr: 24746
testing/web-platform/tests/IndexedDB/idbobjectstore_putall.tentative.any.js
--- 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.');