Re-sync web-platform-tests/IndexedDB from upstream
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Sep 2019 16:47:54 +0000 (16:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Sep 2019 16:47:54 +0000 (16:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202179

Patch by Alexey Shvayka <shvaikalesh@gmail.com> on 2019-09-25
Reviewed by Alex Christensen.

Re-sync web-platform-tests/IndexedDB from upstream a0f781e4d4e9.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/*: Updated.

LayoutTests:

* TestExpectations:
* platform/ios/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:
* tests-options.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250347 268f45cc-cd09-0410-ab3c-d52691b4dbfc

167 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/META.yml [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/OWNERS [deleted file]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-key-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-key.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-keys-bypass-setters-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-keys-bypass-setters.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-chain-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-chain.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-setters-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-setters.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception-expected.txt
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/fire-success-event-exception-expected.txt
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/fire-success-event-exception.html
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception-expected.txt
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception.html
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any.html [moved from LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.any.html with 100% similarity]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any.worker.html [moved from LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker.html with 100% similarity]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_advance_index2.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_advance_index3.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_advance_index5.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_continue_index5.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_continue_index6.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_continue_invalid.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_iterating.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_iterating_index.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_iterating_index2.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_iterating_objectstore.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_iterating_objectstore2.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_update_objectstore4-expected.txt
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor_update_objectstore4.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbdatabase-createObjectStore-exception-order.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbdatabase_createObjectStore10-1000ends.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbdatabase_createObjectStore7-expected.txt
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbdatabase_createObjectStore7.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbdatabase_deleteObjectStore4-not_reused.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbdatabase_transaction4-expected.txt
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbdatabase_transaction4.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-databases-opaque-origin-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-databases-opaque-origin.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-origin-isolation-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-origin-isolation.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_deleteDatabase3.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_open10.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_open11.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_open12.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_open2.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_open4.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_open5.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-multientry-arraykeypath.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-multientry-big.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-multientry.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-abort.html
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_indexNames.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore-rename-abort.html
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex15-autoincrement-expected.txt
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex15-autoincrement.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex3-usable-right-away.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex4-deleteIndex-event_order.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex5-emptykeypath.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex6-event_order.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex7-event_order.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex8-valid_keys.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_deleted.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbtransaction-oncomplete.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbtransaction_abort.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbversionchangeevent.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any-expected.txt [moved from LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.any-expected.txt with 95% similarity]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.worker-expected.txt [moved from LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker-expected.txt with 82% similarity]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.any.js [deleted file]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-common.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.serviceworker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.serviceworker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.serviceworker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.serviceworker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.serviceworker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.serviceworker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/keygenerator-constrainterror.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/keygenerator-overflow.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/keyorder.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/keypath-special-identifiers.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/keypath_maxsize.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/request_bubble-and-capture.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/resources/idbfactory-origin-isolation-iframe.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/resources/w3c-import.log [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/support-promises.js
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/support.js
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-lifetime-blocked.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-lifetime.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-requestqueue.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction_bubble-and-capture.htm
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/w3c-import.log
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/wasm-module-value-expected.txt [deleted file]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/wasm-module-value.html [deleted file]
LayoutTests/imported/w3c/web-platform-tests/IndexedDB/writer-starvation.htm
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/tests-options.json

index 8856242..e7b3591 100644 (file)
@@ -1,3 +1,18 @@
+2019-09-25  Alexey Shvayka  <shvaikalesh@gmail.com>
+
+        Re-sync web-platform-tests/IndexedDB from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=202179
+
+        Reviewed by Alex Christensen.
+
+        Re-sync web-platform-tests/IndexedDB from upstream a0f781e4d4e9.
+
+        * TestExpectations:
+        * platform/ios/TestExpectations:
+        * platform/mac-wk1/TestExpectations:
+        * platform/mac/TestExpectations:
+        * tests-options.json:
+
 2019-09-25  Jonathan Bedard  <jbedard@apple.com>
 
         Unreviewed, rolling out r250324.
index bfae6b4..2401e84 100644 (file)
@@ -1004,7 +1004,6 @@ webkit.org/b/191508 fast/css-grid-layout/crash-large-positions.html [ Skip ]
 imported/w3c/web-platform-tests/css/css-scoping/css-scoping-shadow-host-namespace.html [ ImageOnlyFailure ]
 imported/w3c/web-platform-tests/IndexedDB/abort-in-initial-upgradeneeded.html [ Pass Failure ]
 imported/w3c/web-platform-tests/IndexedDB/clone-before-keypath-eval.html [ Pass Failure ]
-imported/w3c/web-platform-tests/IndexedDB/bindings-inject-key.html [ Pass Failure ]
 
 # Those WPT tests are flaky when failing.
 imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1.html [ Pass Failure ]
@@ -2145,7 +2144,7 @@ storage/indexeddb/deletedatabase-delayed-by-versionchange.html [ Skip ]
 storage/indexeddb/properties-disabled-at-runtime.html [ Failure ]
 
 # In debug builds, runs too slowly for the test timeout.
-[ Debug ] imported/w3c/web-platform-tests/IndexedDB/idbindex-multientry-big.htm [ Failure ]
+[ Debug ] imported/w3c/web-platform-tests/IndexedDB/idbindex-multientry-big.htm [ Pass Failure ]
 
 # Test is crashing
 webkit.org/b/184065 imported/w3c/web-platform-tests/IndexedDB/keypath-exceptions.htm [ Skip ]
@@ -2842,8 +2841,8 @@ webkit.org/b/184802 http/tests/security/contentTypeOptions/nosniff-importScript-
 
 webkit.org/b/181100 inspector/worker/worker-recover-if-inspector-close.html [ Pass Failure ]
 
-[ Debug ] imported/w3c/web-platform-tests/IndexedDB/interleaved-cursors-large.html [ Failure ]
-[ Debug ] imported/w3c/web-platform-tests/IndexedDB/interleaved-cursors-small.html [ Failure ]
+[ Debug ] imported/w3c/web-platform-tests/IndexedDB/interleaved-cursors-large.html [ Pass Failure ]
+[ Debug ] imported/w3c/web-platform-tests/IndexedDB/interleaved-cursors-small.html [ Pass Failure ]
 webkit.org/b/186574 media/video-buffering-allowed.html [ Pass Failure ]
 
 ### WebL Conformance Suite 2.0.0 tests that do not yet have support as of webkit.org/b/189686. Enable as support is implemented. ###
index 743d170..d9df2aa 100644 (file)
@@ -1,3 +1,14 @@
+2019-09-25  Alexey Shvayka  <shvaikalesh@gmail.com>
+
+        Re-sync web-platform-tests/IndexedDB from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=202179
+
+        Reviewed by Alex Christensen.
+
+        Re-sync web-platform-tests/IndexedDB from upstream a0f781e4d4e9.
+
+        * web-platform-tests/IndexedDB/*: Updated.
+
 2019-09-24  Antoine Quint  <graouts@apple.com>
 
         [Web Animations] Removing an element should only cancel its declarative animations
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/META.yml b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/META.yml
new file mode 100644 (file)
index 0000000..89cbe2b
--- /dev/null
@@ -0,0 +1,5 @@
+spec: https://w3c.github.io/IndexedDB/
+suggested_reviewers:
+  - odinho
+  - inexorabletash
+  - zqzhang
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/OWNERS b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/OWNERS
deleted file mode 100644 (file)
index 33bf235..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-@odinho
-@inexorabletash
-@chunywang
-@dumbmatter
-@zqzhang
-@yunxiaoxie
-@zhaozihao
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-key-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-key-expected.txt
deleted file mode 100644 (file)
index 82eb5a3..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-PASS Returning keys to script should bypass prototype setters 
-PASS Returning values to script should bypass prototype setters 
-PASS Returning values to script should bypass prototype chain 
-
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-key.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-key.html
deleted file mode 100644 (file)
index 821b009..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<!doctype html>
-<meta charset=utf-8>
-<title>IndexedDB: ES bindings - Inject a key into a value</title>
-<meta name="help" href="https://w3c.github.io/IndexedDB/#inject-key-into-value">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="support.js"></script>
-<script>
-
-indexeddb_test(
-  (t, db) => {
-    db.createObjectStore('store');
-  },
-  (t, db) => {
-    const tx = db.transaction('store', 'readwrite');
-    const request = tx.objectStore('store').put(
-        'value', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'key']);
-
-    const setter_called = false;
-    Object.defineProperty(Object.prototype, '10', {
-      configurable: true,
-      set: t.step_func((value) => { setter_called = true; }),
-    });
-    request.onerror = t.unreached_func('request should not fail');
-    request.onsuccess = t.step_func(() => {
-      const result = request.result;
-      assert_false(setter_called,
-                   'Setter should not be called for key result.');
-      assert_true(
-          result.hasOwnProperty('10'),
-          'Result should have own-property overriding prototype setter.');
-      assert_equals(result[10], 'key',
-                    'Result should have expected property.');
-
-      delete Object.prototype['10'];
-      t.done();
-    });
-  },
-  'Returning keys to script should bypass prototype setters'
-);
-
-indexeddb_test(
-  (t, db) => {
-    db.createObjectStore('store', {autoIncrement: true, keyPath: 'id'});
-  },
-  (t, db) => {
-    const tx = db.transaction('store', 'readwrite');
-    tx.objectStore('store').put({});
-    const request = tx.objectStore('store').get(1);
-
-    const setter_called = false;
-    Object.defineProperty(Object.prototype, 'id', {
-      configurable: true,
-      set: t.step_func(function(value) { setter_called = true; }),
-    });
-    request.onerror = t.unreached_func('request should not fail');
-    request.onsuccess = t.step_func(function() {
-        const result = request.result;
-      assert_false(setter_called,
-                   'Setter should not be called for key result.');
-      assert_true(
-          result.hasOwnProperty('id'),
-          'Result should have own-property overriding prototype setter.');
-      assert_equals(result.id, 1,
-                    'Own property should match primary key generator value');
-
-      delete Object.prototype['id'];
-      t.done();
-    });
-  },
-  'Returning values to script should bypass prototype setters'
-);
-
-indexeddb_test(
-  (t, db) => {
-    db.createObjectStore('store', {autoIncrement: true, keyPath: 'a.b.c'});
-  },
-  (t, db) => {
-    const tx = db.transaction('store', 'readwrite');
-    tx.objectStore('store').put({});
-    const request = tx.objectStore('store').get(1);
-
-    Object.prototype.a = {b: {c: 'on proto'}};
-
-    request.onerror = t.unreached_func('request should not fail');
-    request.onsuccess = t.step_func(function() {
-      const result = request.result;
-      assert_true(result.hasOwnProperty('a'),
-                  'Result should have own-properties overriding prototype.');
-      assert_true(result.a.hasOwnProperty('b'),
-                  'Result should have own-properties overriding prototype.');
-      assert_true(result.a.b.hasOwnProperty('c'),
-                  'Result should have own-properties overriding prototype.');
-      assert_equals(result.a.b.c, 1,
-                    'Own property should match primary key generator value');
-      assert_equals(Object.prototype.a.b.c, 'on proto',
-                  'Prototype should not be modified');
-      t.done();
-    });
-  },
-  'Returning values to script should bypass prototype chain'
-);
-
-</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-keys-bypass-setters-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-keys-bypass-setters-expected.txt
new file mode 100644 (file)
index 0000000..3affd78
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS Returning keys to script should bypass prototype setters 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-keys-bypass-setters.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-keys-bypass-setters.html
new file mode 100644 (file)
index 0000000..91d586b
--- /dev/null
@@ -0,0 +1,35 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>IndexedDB: ES bindings - Inject a key into a value - Keys bypass setters</title>
+<meta name="help"
+href="https://w3c.github.io/IndexedDB/#inject-key-into-value-keys-bypass-setters">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support-promises.js"></script>
+<script>
+
+promise_test(async t => {
+  const db = await createDatabase(t, db => {
+    db.createObjectStore('store');
+  });
+
+  let setter_called = false;
+  Object.defineProperty(Object.prototype, '10', {
+    configurable: true,
+    set: value => { setter_called = true; },
+  });
+  t.add_cleanup(() => { delete Object.prototype['10']; });
+
+  const tx = db.transaction('store', 'readwrite');
+  const result = await promiseForRequest(t, tx.objectStore('store').put(
+      'value', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'key']));
+
+  assert_false(setter_called,
+               'Setter should not be called for key result.');
+  assert_true(result.hasOwnProperty('10'),
+              'Result should have own-property overriding prototype setter.');
+  assert_equals(result[10], 'key',
+                'Result should have expected property.');
+}, 'Returning keys to script should bypass prototype setters');
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-chain-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-chain-expected.txt
new file mode 100644 (file)
index 0000000..4f00772
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS Returning values to script should bypass prototype chain 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-chain.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-chain.html
new file mode 100644 (file)
index 0000000..02fdb8a
--- /dev/null
@@ -0,0 +1,35 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>IndexedDB: ES bindings - Inject a key into a value - Values bypass chain</title>
+<meta name="help"
+href="https://w3c.github.io/IndexedDB/#inject-key-into-value-values-bypass-chain">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support-promises.js"></script>
+<script>
+
+promise_test(async t => {
+  const db = await createDatabase(t, db => {
+    db.createObjectStore('store', {autoIncrement: true, keyPath: 'a.b.c'});
+  });
+
+  Object.prototype.a = {b: {c: 'on proto'}};
+  t.add_cleanup(() => { delete Object.prototype.a; });
+
+  const tx = db.transaction('store', 'readwrite');
+  tx.objectStore('store').put({});
+  const result = await promiseForRequest(t, tx.objectStore('store').get(1));
+
+  assert_true(result.hasOwnProperty('a'),
+              'Result should have own-properties overriding prototype.');
+  assert_true(result.a.hasOwnProperty('b'),
+              'Result should have own-properties overriding prototype.');
+  assert_true(result.a.b.hasOwnProperty('c'),
+              'Result should have own-properties overriding prototype.');
+  assert_equals(result.a.b.c, 1,
+                'Own property should match primary key generator value');
+  assert_equals(Object.prototype.a.b.c, 'on proto',
+                'Prototype should not be modified');
+}, 'Returning values to script should bypass prototype chain');
+
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-setters-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-setters-expected.txt
new file mode 100644 (file)
index 0000000..5e1641b
--- /dev/null
@@ -0,0 +1,3 @@
+
+PASS Returning values to script should bypass prototype setters 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-setters.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-setters.html
new file mode 100644 (file)
index 0000000..c16c0a4
--- /dev/null
@@ -0,0 +1,36 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>IndexedDB: ES bindings - Inject a key into a value - Values bypass
+  setters</title>
+<meta name="help"
+href="https://w3c.github.io/IndexedDB/#inject-key-into-value-values-bypass-setters">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="support-promises.js"></script>
+<script>
+
+promise_test(async t => {
+  const db = await createDatabase(t, db => {
+    db.createObjectStore('store', {autoIncrement: true, keyPath: 'id'});
+  });
+
+  let setter_called = false;
+  Object.defineProperty(Object.prototype, 'id', {
+    configurable: true,
+    set: value => { setter_called = true; },
+  });
+  t.add_cleanup(() => { delete Object.prototype['id']; });
+
+  const tx = db.transaction('store', 'readwrite');
+  tx.objectStore('store').put({});
+  const result = await promiseForRequest(t, tx.objectStore('store').get(1));
+
+  assert_false(setter_called,
+               'Setter should not be called for key result.');
+  assert_true(result.hasOwnProperty('id'),
+              'Result should have own-property overriding prototype setter.');
+  assert_equals(result.id, 1,
+                'Own property should match primary key generator value');
+}, 'Returning values to script should bypass prototype setters');
+
+</script>
index 72bd11c..d545726 100644 (file)
@@ -2,6 +2,8 @@
 PASS Exception in error event handler on request 
 PASS Exception in error event handler on request, with preventDefault 
 PASS Exception in error event listener on request 
+PASS Exception in error event listener ("handleEvent" lookup) on request 
+FAIL Exception in error event listener (non-callable "handleEvent") on request assert_equals: expected "AbortError" but got "ConstraintError"
 PASS Exception in second error event listener on request 
 PASS Exception in first error event listener on request, transaction active in second 
 PASS Exception in error event handler on transaction 
index fe0dc18..0a3f122 100644 (file)
@@ -21,6 +21,9 @@ function fire_error_event_test(func, description) {
       const request = store.add(0, 0);
       request.onsuccess = t.unreached_func('request should fail');
       func(t, db, tx, request);
+      tx.addEventListener('abort', t.step_func_done(() => {
+        assert_equals(tx.error.name, 'AbortError');
+      }));
     },
     description);
 }
@@ -31,9 +34,6 @@ fire_error_event_test((t, db, tx, request) => {
   request.onerror = () => {
     throw Error();
   };
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in error event handler on request');
 
 fire_error_event_test((t, db, tx, request) => {
@@ -41,30 +41,33 @@ fire_error_event_test((t, db, tx, request) => {
     e.preventDefault();
     throw Error();
   };
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in error event handler on request, with preventDefault');
 
 fire_error_event_test((t, db, tx, request) => {
   request.addEventListener('error', () => {
     throw Error();
   });
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in error event listener on request');
 
 fire_error_event_test((t, db, tx, request) => {
+  request.addEventListener('error', {
+    get handleEvent() {
+      throw new Error();
+    },
+  });
+}, 'Exception in error event listener ("handleEvent" lookup) on request');
+
+fire_error_event_test((t, db, tx, request) => {
+  request.addEventListener('error', {});
+}, 'Exception in error event listener (non-callable "handleEvent") on request');
+
+fire_error_event_test((t, db, tx, request) => {
   request.addEventListener('error', () => {
     // no-op
   });
   request.addEventListener('error', () => {
     throw Error();
   });
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in second error event listener on request');
 
 fire_error_event_test((t, db, tx, request) => {
@@ -77,10 +80,9 @@ fire_error_event_test((t, db, tx, request) => {
     assert_true(is_transaction_active(tx, 's'),
                 'Transaction should be active until dispatch completes');
   }));
-  tx.onabort = t.step_func_done(() => {
+  tx.addEventListener('abort', t.step_func(() => {
     assert_true(second_listener_called);
-    assert_equals(tx.error.name, 'AbortError');
-  });
+  }));
 }, 'Exception in first error event listener on request, ' +
    'transaction active in second');
 
@@ -90,9 +92,6 @@ fire_error_event_test((t, db, tx, request) => {
   tx.onerror = () => {
     throw Error();
   };
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in error event handler on transaction');
 
 fire_error_event_test((t, db, tx, request) => {
@@ -100,18 +99,12 @@ fire_error_event_test((t, db, tx, request) => {
     e.preventDefault();
     throw Error();
   };
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in error event handler on transaction, with preventDefault');
 
 fire_error_event_test((t, db, tx, request) => {
   tx.addEventListener('error', () => {
     throw Error();
   });
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in error event listener on transaction');
 
 fire_error_event_test((t, db, tx, request) => {
@@ -121,9 +114,6 @@ fire_error_event_test((t, db, tx, request) => {
   tx.addEventListener('error', () => {
     throw Error();
   });
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in second error event listener on transaction');
 
 fire_error_event_test((t, db, tx, request) => {
@@ -136,10 +126,9 @@ fire_error_event_test((t, db, tx, request) => {
     assert_true(is_transaction_active(tx, 's'),
                 'Transaction should be active until dispatch completes');
   }));
-  tx.onabort = t.step_func_done(() => {
+  tx.addEventListener('abort', t.step_func(() => {
     assert_true(second_listener_called);
-    assert_equals(tx.error.name, 'AbortError');
-  });
+  }));
 }, 'Exception in first error event listener on transaction, ' +
    'transaction active in second');
 
@@ -149,9 +138,6 @@ fire_error_event_test((t, db, tx, request) => {
   db.onerror = () => {
     throw Error();
   };
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in error event handler on connection');
 
 fire_error_event_test((t, db, tx, request) => {
@@ -159,18 +145,12 @@ fire_error_event_test((t, db, tx, request) => {
     e.preventDefault()
     throw Error();
   };
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in error event handler on connection, with preventDefault');
 
 fire_error_event_test((t, db, tx, request) => {
   db.addEventListener('error', () => {
     throw Error();
   });
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in error event listener on connection');
 
 fire_error_event_test((t, db, tx, request) => {
@@ -180,9 +160,6 @@ fire_error_event_test((t, db, tx, request) => {
   db.addEventListener('error', () => {
     throw Error();
   });
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in second error event listener on connection');
 
 fire_error_event_test((t, db, tx, request) => {
@@ -195,10 +172,9 @@ fire_error_event_test((t, db, tx, request) => {
     assert_true(is_transaction_active(tx, 's'),
                 'Transaction should be active until dispatch completes');
   }));
-  tx.onabort = t.step_func_done(() => {
+  tx.addEventListener('abort', t.step_func(() => {
     assert_true(second_listener_called);
-    assert_equals(tx.error.name, 'AbortError');
-  });
+  }));
 }, 'Exception in first error event listener on connection, ' +
    'transaction active in second');
 
index 292541b..287453e 100644 (file)
@@ -1,6 +1,8 @@
 
 PASS Exception in success event handler on request 
 PASS Exception in success event listener on request 
+PASS Exception in success event listener ("handleEvent" lookup) on request 
+FAIL Exception in success event listener (non-callable "handleEvent") on request assert_unreached: transaction should abort Reached unreachable code
 PASS Exception in second success event listener on request 
 PASS Exception in first success event listener, tx active in second 
 
index c4e5506..ab0ac44 100644 (file)
@@ -19,6 +19,9 @@ function fire_success_event_test(func, description) {
       const store = tx.objectStore('s');
       const request = store.get(0);
       func(t, db, tx, request);
+      tx.addEventListener('abort', t.step_func_done(() => {
+        assert_equals(tx.error.name, 'AbortError');
+      }));
     },
     description);
 }
@@ -27,30 +30,35 @@ fire_success_event_test((t, db, tx, request) => {
   request.onsuccess = () => {
     throw Error();
   };
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in success event handler on request');
 
 fire_success_event_test((t, db, tx, request) => {
   request.addEventListener('success', () => {
     throw Error();
   });
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in success event listener on request');
 
 fire_success_event_test((t, db, tx, request) => {
+  request.addEventListener('success', {
+    get handleEvent() {
+      throw new Error();
+    },
+  });
+}, 'Exception in success event listener ("handleEvent" lookup) on request');
+
+fire_success_event_test((t, db, tx, request) => {
+  request.addEventListener('success', {
+    handleEvent: null,
+  });
+}, 'Exception in success event listener (non-callable "handleEvent") on request');
+
+fire_success_event_test((t, db, tx, request) => {
   request.addEventListener('success', () => {
     // no-op
   });
   request.addEventListener('success', () => {
     throw Error();
   });
-  tx.onabort = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in second success event listener on request');
 
 fire_success_event_test((t, db, tx, request) => {
@@ -63,10 +71,9 @@ fire_success_event_test((t, db, tx, request) => {
     assert_true(is_transaction_active(tx, 's'),
                 'Transaction should be active until dispatch completes');
   }));
-  tx.onabort = t.step_func_done(() => {
+  tx.addEventListener('abort', t.step_func(() => {
     assert_true(second_listener_called);
-    assert_equals(tx.error.name, 'AbortError');
-  });
+  }));
 }, 'Exception in first success event listener, tx active in second');
 
 </script>
index 741edd5..3f95ec3 100644 (file)
@@ -1,10 +1,13 @@
-CONSOLE MESSAGE: line 26: Error
+CONSOLE MESSAGE: line 31: Error
 CONSOLE MESSAGE: line 37: Error
-CONSOLE MESSAGE: line 51: Error
-CONSOLE MESSAGE: line 63: Error
+CONSOLE MESSAGE: line 44: Error
+CONSOLE MESSAGE: line 62: Error
+CONSOLE MESSAGE: line 70: Error
 
 PASS Exception in upgradeneeded handler 
 PASS Exception in upgradeneeded listener 
+PASS Exception in upgradeneeded "handleEvent" lookup 
+FAIL Exception in upgradeneeded due to non-callable "handleEvent" assert_unreached: open should fail Reached unreachable code
 PASS Exception in second upgradeneeded listener 
 PASS Exception in first upgradeneeded listener, tx active in second 
 
index 5db452e..1a8163a 100644 (file)
@@ -15,48 +15,55 @@ function fire_upgradeneeded_event_test(func, description) {
     del.onerror = t.unreached_func('deleteDatabase should succeed');
     const open = indexedDB.open(dbname, 1);
     open.onsuccess = t.unreached_func('open should fail');
+    let tx;
+    open.addEventListener('upgradeneeded', () => {
+      tx = open.transaction;
+    });
     func(t, open);
+    open.addEventListener('error', t.step_func_done(() => {
+      assert_equals(tx.error.name, 'AbortError');
+    }));
   }, description);
 }
 
 fire_upgradeneeded_event_test((t, open) => {
-  let tx;
   open.onupgradeneeded = () => {
-    tx = open.transaction;
     throw Error();
   };
-  open.onerror = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in upgradeneeded handler');
 
 fire_upgradeneeded_event_test((t, open) => {
-  let tx;
   open.addEventListener('upgradeneeded', () => {
-    tx = open.transaction;
     throw Error();
   });
-  open.onerror = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in upgradeneeded listener');
 
 fire_upgradeneeded_event_test((t, open) => {
-  let tx;
+  open.addEventListener('upgradeneeded', {
+    get handleEvent() {
+      throw new Error();
+    },
+  });
+}, 'Exception in upgradeneeded "handleEvent" lookup');
+
+fire_upgradeneeded_event_test((t, open) => {
+  open.addEventListener('upgradeneeded', {
+    get handleEvent() {
+      return 10;
+    },
+  });
+}, 'Exception in upgradeneeded due to non-callable "handleEvent"');
+
+fire_upgradeneeded_event_test((t, open) => {
   open.addEventListener('upgradeneeded', () => {
     // No-op.
   });
   open.addEventListener('upgradeneeded', () => {
-    tx = open.transaction;
     throw Error();
   });
-  open.onerror = t.step_func_done(() => {
-    assert_equals(tx.error.name, 'AbortError');
-  });
 }, 'Exception in second upgradeneeded listener');
 
 fire_upgradeneeded_event_test((t, open) => {
-  let tx;
   let second_listener_called = false;
   open.addEventListener('upgradeneeded', () => {
     open.result.createObjectStore('s');
@@ -64,14 +71,12 @@ fire_upgradeneeded_event_test((t, open) => {
   });
   open.addEventListener('upgradeneeded', t.step_func(() => {
     second_listener_called = true;
-    tx = open.transaction;
-    assert_true(is_transaction_active(tx, 's'),
+    assert_true(is_transaction_active(open.transaction, 's'),
                 'Transaction should be active until dispatch completes');
   }));
-  open.onerror = t.step_func_done(() => {
+  open.addEventListener('error', t.step_func(() => {
     assert_true(second_listener_called);
-    assert_equals(tx.error.name, 'AbortError');
-  });
+  }));
 }, 'Exception in first upgradeneeded listener, tx active in second');
 
 </script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any-expected.txt
new file mode 100644 (file)
index 0000000..e2dffac
--- /dev/null
@@ -0,0 +1,7 @@
+
+FAIL Ensure that databases() returns a promise. promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+FAIL Enumerate one database. promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+FAIL Enumerate multiple databases. promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+FAIL Make sure an empty list is returned for the case of no databases. promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+FAIL Ensure that databases() doesn't pick up changes that haven't commited. promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any.js
new file mode 100644 (file)
index 0000000..823cfce
--- /dev/null
@@ -0,0 +1,117 @@
+// META: script=support-promises.js
+
+promise_test(async testCase => {
+  assert_true(indexedDB.databases() instanceof Promise,
+      "databases() should return a promise.");
+}, "Ensure that databases() returns a promise.");
+
+promise_test(async testCase => {
+  // Delete any databases that may not have been cleaned up after previous test
+  // runs.
+  await deleteAllDatabases(testCase);
+
+  const db_name = "TestDatabase";
+  const db = await createNamedDatabase(testCase, db_name, ()=>{});
+  const databases_result = await indexedDB.databases();
+  db.close();
+  const expected_result = {"name": db_name, "version": 1};
+  assert_equals(
+      databases_result.length,
+      1,
+      "The result of databases() should contain one result per database.");
+  assert_true(
+      databases_result[0].name === expected_result.name
+          && databases_result[0].version === expected_result.version,
+      "The result of databases() should be a sequence of the correct names "
+      + "and versions of all databases for the origin.");
+}, "Enumerate one database.");
+
+promise_test(async testCase => {
+  // Delete any databases that may not have been cleaned up after previous test
+  // runs.
+  await deleteAllDatabases(testCase);
+
+  const db_name1 = "TestDatabase1";
+  const db_name2 = "TestDatabase2";
+  const db_name3 = "TestDatabase3";
+  const db1 = await createNamedDatabase(testCase, db_name1, ()=>{});
+  const db2 = await createNamedDatabase(testCase, db_name2, ()=>{});
+  const db3 = await createNamedDatabase(testCase, db_name3, ()=>{});
+  db1.close();
+  db2.close();
+  db3.close();
+  const version_promise =
+      await migrateNamedDatabase(testCase, db_name2, 2, () => {});
+  const databases_result = await indexedDB.databases();
+  const expected_result = [
+    {"name": db_name1, "version": 1},
+    {"name": db_name2, "version": 2},
+    {"name": db_name3, "version": 1},
+  ];
+  assert_equals(
+      databases_result.length,
+      expected_result.length,
+      "The result of databases() should contain one result per database.");
+  for ( let i = 0; i < expected_result.length; i += 1 ) {
+    result = expected_result[i];
+    assert_true(
+        databases_result.some(
+            e => e.name === result.name && e.version === result.version),
+        "The result of databases() should be a sequence of the correct names "
+        + "and versions of all databases for the origin.");
+  }
+}, "Enumerate multiple databases.");
+
+promise_test(async testCase => {
+  // Add some databases and close their connections.
+  const db1 = await createNamedDatabase(testCase, "DB1", () => {});
+  const db2 = await createNamedDatabase(testCase, "DB2", () => {});
+  db1.close();
+  db2.close();
+
+  // Delete any databases that may not have been cleaned up after previous test
+  // runs as well as the two databases made above.
+  await deleteAllDatabases(testCase);
+
+  // Make sure the databases are no longer returned.
+  const databases_result = await indexedDB.databases();
+  assert_equals(
+      databases_result.length,
+      0,
+      "The result of databases() should be an empty sequence for the case of "
+      + "no databases for the origin.");
+}, "Make sure an empty list is returned for the case of no databases.");
+
+promise_test(async testCase => {
+  // Delete any databases that may not have been cleaned up after previous test
+  // runs as well as the two databases made above.
+  await deleteAllDatabases(testCase);
+
+  const db1 = await createNamedDatabase(testCase, "DB1", ()=>{});
+  const db2 = await createNamedDatabase(testCase, "DB2", async () => {
+    const databases_result1 = await indexedDB.databases();
+    assert_equals(
+        databases_result1.length,
+        1,
+        "The result of databases() should be only those databases which have "
+        + "been created at the time of calling, regardless of versionchange "
+        + "transactions currently running.");
+  });
+  db1.close();
+  db2.close();
+  const databases_result2 = await indexedDB.databases();
+  assert_equals(
+      databases_result2.length,
+      2,
+      "The result of databases() should include all databases which have "
+      + "been created at the time of calling.");
+  await migrateNamedDatabase(testCase, "DB2", 2, async () => {
+    const databases_result3 = await indexedDB.databases();
+    assert_true(
+        databases_result3[0].version === 1
+        && databases_result3[1].version === 1,
+        "The result of databases() should contain the versions of databases "
+        + "at the time of calling, regardless of versionchange transactions "
+        + "currently running.");
+  });
+}, "Ensure that databases() doesn't pick up changes that haven't commited.");
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..e2dffac
--- /dev/null
@@ -0,0 +1,7 @@
+
+FAIL Ensure that databases() returns a promise. promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+FAIL Enumerate one database. promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+FAIL Enumerate multiple databases. promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+FAIL Make sure an empty list is returned for the case of no databases. promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+FAIL Ensure that databases() doesn't pick up changes that haven't commited. promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any-expected.txt
new file mode 100644 (file)
index 0000000..ef68b85
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL Any errors in callbacks that run after an explicit commit will not stop the commit from being processed. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.js
new file mode 100644 (file)
index 0000000..3b8d148
--- /dev/null
@@ -0,0 +1,45 @@
+// META: script=support-promises.js
+
+/**
+ * This file contains a test that was separated out from the rest of the idb
+ * explict commit tests because it requires the flag 'allow_uncaught_exception',
+ * which prevents unintentionally thrown errors from failing tests.
+ *
+ * @author andreasbutler@google.com
+ */
+
+setup({allow_uncaught_exception:true});
+
+promise_test(async testCase => {
+  // Register an event listener that will prevent the intentionally thrown
+  // error from bubbling up to the window and failing the testharness. This
+  // is necessary because currently allow_uncaught_exception does not behave
+  // as expected for promise_test.
+  //
+  // Git issue: https://github.com/web-platform-tests/wpt/issues/14041
+  self.addEventListener('error', (event) => { event.preventDefault(); });
+
+  const db = await createDatabase(testCase, async db => {
+    await createBooksStore(testCase, db);
+  });
+
+  const txn = db.transaction(['books'], 'readwrite');
+  const objectStore = txn.objectStore('books');
+  const putRequest = objectStore.put({isbn:'one', title:'title'});
+  txn.commit();
+  putRequest.onsuccess = () => {
+    throw new Error('This error thrown after an explicit commit should not ' +
+        'prevent the transaction from committing.');
+  }
+  await promiseForTransaction(testCase, txn);
+
+  // Ensure that despite the uncaught error after the put request, the explicit
+  // commit still causes the request to be committed.
+  const txn2 = db.transaction(['books'], 'readwrite');
+  const objectStore2 = txn2.objectStore('books');
+  const getRequest = objectStore2.get('one');
+  await promiseForTransaction(testCase, txn2);
+
+  assert_equals(getRequest.result.title, 'title');
+}, 'Any errors in callbacks that run after an explicit commit will not stop '
+   + 'the commit from being processed.');
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..ef68b85
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL Any errors in callbacks that run after an explicit commit will not stop the commit from being processed. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any-expected.txt
new file mode 100644 (file)
index 0000000..12caeb6
--- /dev/null
@@ -0,0 +1,14 @@
+
+FAIL Explicitly committed data can be read back out. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL commit() on a version change transaction does not cause errors. txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)
+FAIL A committed transaction becomes inactive immediately. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL A committed transaction is inactive in future request callbacks. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL Puts issued after commit are not fulfilled. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL Calling commit on an aborted transaction throws. assert_throws: The transaction should have been aborted. function "() => { txn.commit(); }" threw object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
+FAIL Calling commit on a committed transaction throws. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL Calling abort on a committed transaction throws and does not prevent persisting the data. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL Calling txn.commit() when txn is inactive should throw. assert_throws: The transaction should be inactive so calling commit should throw. function "() => { txn.commit(); }" threw object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
+FAIL Transactions with same scope should stay in program order, even if one calls commit. promise_test: Unhandled rejection with value: object "TypeError: txn2.commit is not a function. (In 'txn2.commit()', 'txn2.commit' is undefined)"
+FAIL Transactions that explicitly commit and have errors should abort. promise_test: Unhandled rejection with value: object "TypeError: txn1.commit is not a function. (In 'txn1.commit()', 'txn1.commit' is undefined)"
+FAIL Transactions that handle all errors properly should be behave as expected when an explicit commit is called in an onerror handler. promise_test: Unhandled rejection with value: object "TypeError: txn1.commit is not a function. (In 'txn1.commit()', 'txn1.commit' is undefined)"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.js
new file mode 100644 (file)
index 0000000..12e56cc
--- /dev/null
@@ -0,0 +1,292 @@
+// META: script=support-promises.js
+
+/**
+ * This file contains the webplatform tests for the explicit commit() method
+ * of the IndexedDB transaction API.
+ *
+ * @author andreasbutler@google.com
+ */
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  const txn = db.transaction(['books'], 'readwrite');
+  const objectStore = txn.objectStore('books');
+  objectStore.put({isbn: 'one', title: 'title1'});
+  objectStore.put({isbn: 'two', title: 'title2'});
+  objectStore.put({isbn: 'three', title: 'title3'});
+  txn.commit();
+  await promiseForTransaction(testCase, txn);
+
+  const txn2 = db.transaction(['books'], 'readonly');
+  const objectStore2 = txn2.objectStore('books');
+  const getRequestitle1 = objectStore2.get('one');
+  const getRequestitle2 = objectStore2.get('two');
+  const getRequestitle3 = objectStore2.get('three');
+  txn2.commit();
+  await promiseForTransaction(testCase, txn2);
+  assert_array_equals(
+      [getRequestitle1.result.title,
+          getRequestitle2.result.title,
+          getRequestitle3.result.title],
+      ['title1', 'title2', 'title3'],
+      'All three retrieved titles should match those that were put.');
+  db.close();
+}, 'Explicitly committed data can be read back out.');
+
+
+promise_test(async testCase => {
+  let db = await createDatabase(testCase, () => {});
+  assert_equals(1, db.version, 'A database should be created as version 1');
+  db.close();
+
+  // Upgrade the versionDB database and explicitly commit its versionchange
+  // transaction.
+  db = await migrateDatabase(testCase, 2, (db, txn) => {
+    txn.commit();
+  });
+  assert_equals(2, db.version,
+      'The database version should have been incremented regardless of '
+      + 'whether the versionchange transaction was explicitly or implicitly '
+      + 'committed.');
+  db.close();
+}, 'commit() on a version change transaction does not cause errors.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  const txn = db.transaction(['books'], 'readwrite');
+  const objectStore = txn.objectStore('books');
+  txn.commit();
+  assert_throws('TransactionInactiveError',
+      () => { objectStore.put({isbn: 'one', title: 'title1'}); },
+      'After commit is called, the transaction should be inactive.');
+  db.close();
+}, 'A committed transaction becomes inactive immediately.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  const txn = db.transaction(['books'], 'readwrite');
+  const objectStore = txn.objectStore('books');
+  const putRequest = objectStore.put({isbn: 'one', title: 'title1'});
+  putRequest.onsuccess = testCase.step_func(() => {
+    assert_throws('TransactionInactiveError',
+      () => { objectStore.put({isbn:'two', title:'title2'}); },
+      'The transaction should not be active in the callback of a request after '
+      + 'commit() is called.');
+  });
+  txn.commit();
+  await promiseForTransaction(testCase, txn);
+  db.close();
+}, 'A committed transaction is inactive in future request callbacks.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  const txn = db.transaction(['books'], 'readwrite');
+  const objectStore = txn.objectStore('books');
+  txn.commit();
+
+  assert_throws('TransactionInactiveError',
+      () => { objectStore.put({isbn:'one', title:'title1'}); },
+      'After commit is called, the transaction should be inactive.');
+
+  const txn2 = db.transaction(['books'], 'readonly');
+  const objectStore2 = txn2.objectStore('books');
+  const getRequest = objectStore2.get('one');
+  await promiseForTransaction(testCase, txn2);
+  assert_equals(getRequest.result, undefined);
+
+  db.close();
+}, 'Puts issued after commit are not fulfilled.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  const txn = db.transaction(['books'], 'readwrite');
+  const objectStore = txn.objectStore('books');
+  txn.abort();
+  assert_throws('InvalidStateError',
+      () => { txn.commit(); },
+      'The transaction should have been aborted.');
+  db.close();
+}, 'Calling commit on an aborted transaction throws.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  const txn = db.transaction(['books'], 'readwrite');
+  const objectStore = txn.objectStore('books');
+  txn.commit();
+  assert_throws('InvalidStateError',
+      () => { txn.commit(); },
+      'The transaction should have already committed.');
+  db.close();
+}, 'Calling commit on a committed transaction throws.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  const txn = db.transaction(['books'], 'readwrite');
+  const objectStore = txn.objectStore('books');
+  const putRequest = objectStore.put({isbn:'one', title:'title1'});
+  txn.commit();
+  assert_throws('InvalidStateError',
+      () => { txn.abort(); },
+      'The transaction should already have committed.');
+  const txn2 = db.transaction(['books'], 'readwrite');
+  const objectStore2 = txn2.objectStore('books');
+  const getRequest = objectStore2.get('one');
+  await promiseForTransaction(testCase, txn2);
+  assert_equals(
+      getRequest.result.title,
+      'title1',
+      'Explicitly committed data should be gettable.');
+  db.close();
+}, 'Calling abort on a committed transaction throws and does not prevent '
+   + 'persisting the data.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  const txn = db.transaction(['books'], 'readwrite');
+  const objectStore = txn.objectStore('books');
+  const releaseTxnFunction = keepAlive(testCase, txn, 'books');
+
+  // Break up the scope of execution to force the transaction into an inactive
+  // state.
+  await timeoutPromise(0);
+
+  assert_throws('InvalidStateError',
+      () => { txn.commit(); },
+      'The transaction should be inactive so calling commit should throw.');
+  releaseTxnFunction();
+  db.close();
+}, 'Calling txn.commit() when txn is inactive should throw.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+    createNotBooksStore(testCase, db);
+  });
+  // Txn1 should commit before txn2, even though txn2 uses commit().
+  const txn1 = db.transaction(['books'], 'readwrite');
+  txn1.objectStore('books').put({isbn: 'one', title: 'title1'});
+  const releaseTxnFunction = keepAlive(testCase, txn1, 'books');
+
+  const txn2 = db.transaction(['books'], 'readwrite');
+  txn2.objectStore('books').put({isbn:'one', title:'title2'});
+  txn2.commit();
+
+  // Exercise the IndexedDB transaction ordering by executing one with a
+  // different scope.
+  const txn3 = db.transaction(['not_books'], 'readwrite');
+  txn3.objectStore('not_books').put({'title': 'not_title'}, 'key');
+  txn3.oncomplete = function() {
+    releaseTxnFunction();
+  }
+  await Promise.all([promiseForTransaction(testCase, txn1),
+                     promiseForTransaction(testCase, txn2)]);
+
+  // Read the data back to verify that txn2 executed last.
+  const txn4 = db.transaction(['books'], 'readonly');
+  const getRequest4 = txn4.objectStore('books').get('one');
+  await promiseForTransaction(testCase, txn4);
+  assert_equals(getRequest4.result.title, 'title2');
+  db.close();
+}, 'Transactions with same scope should stay in program order, even if one '
+   + 'calls commit.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  // Txn1 creates the book 'one' so the 'add()' below fails.
+  const txn1 = db.transaction(['books'], 'readwrite');
+  txn1.objectStore('books').add({isbn:'one', title:'title1'});
+  txn1.commit();
+  await promiseForTransaction(testCase, txn1);
+
+  // Txn2 should abort, because the 'add' call is invalid, and commit() was
+  // called.
+  const txn2 = db.transaction(['books'], 'readwrite');
+  const objectStore2 = txn2.objectStore('books');
+  objectStore2.put({isbn:'two', title:'title2'});
+  const addRequest = objectStore2.add({isbn:'one', title:'title2'});
+  txn2.commit();
+  txn2.oncomplete = () => { assert_unreached(
+    'Transaction with invalid "add" call should not be completed.'); };
+
+  // Wait for the transaction to complete. We have to explicitly wait for the
+  // error signal on the transaction because of the nature of the test tooling.
+  await Promise.all([
+      requestWatcher(testCase, addRequest).wait_for('error'),
+      transactionWatcher(testCase, txn2).wait_for(['error', 'abort'])
+  ]);
+
+  // Read the data back to verify that txn2 was aborted.
+  const txn3 = db.transaction(['books'], 'readonly');
+  const objectStore3 = txn3.objectStore('books');
+  const getRequest1 = objectStore3.get('one');
+  const getRequest2 = objectStore3.count('two');
+  await promiseForTransaction(testCase, txn3);
+  assert_equals(getRequest1.result.title, 'title1');
+  assert_equals(getRequest2.result, 0);
+  db.close();
+}, 'Transactions that explicitly commit and have errors should abort.');
+
+
+promise_test(async testCase => {
+  const db = await createDatabase(testCase, db => {
+    createBooksStore(testCase, db);
+  });
+  const txn1 = db.transaction(['books'], 'readwrite');
+  txn1.objectStore('books').add({isbn: 'one', title: 'title1'});
+  txn1.commit();
+  await promiseForTransaction(testCase, txn1);
+
+  // The second add request will throw an error, but the onerror handler will
+  // appropriately catch the error allowing the valid put request on the
+  // transaction to commit.
+  const txn2 = db.transaction(['books'], 'readwrite');
+  const objectStore2 = txn2.objectStore('books');
+  objectStore2.put({isbn: 'two', title:'title2'});
+  const addRequest = objectStore2.add({isbn: 'one', title:'unreached_title'});
+  addRequest.onerror = (event) => {
+    event.preventDefault();
+    addRequest.transaction.commit();
+  };
+
+  // Wait for the transaction to complete. We have to explicitly wait for the
+  // error signal on the transaction because of the nature of the test tooling.
+  await transactionWatcher(testCase,txn2).wait_for(['error', 'complete'])
+
+  // Read the data back to verify that txn2 was committed.
+  const txn3 = db.transaction(['books'], 'readonly');
+  const objectStore3 = txn3.objectStore('books');
+  const getRequest1 = objectStore3.get('one');
+  const getRequest2 = objectStore3.get('two');
+  await promiseForTransaction(testCase, txn3);
+  assert_equals(getRequest1.result.title, 'title1');
+  assert_equals(getRequest2.result.title, 'title2');
+  db.close();
+}, 'Transactions that handle all errors properly should be behave as ' +
+   'expected when an explicit commit is called in an onerror handler.');
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..12caeb6
--- /dev/null
@@ -0,0 +1,14 @@
+
+FAIL Explicitly committed data can be read back out. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL commit() on a version change transaction does not cause errors. txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)
+FAIL A committed transaction becomes inactive immediately. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL A committed transaction is inactive in future request callbacks. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL Puts issued after commit are not fulfilled. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL Calling commit on an aborted transaction throws. assert_throws: The transaction should have been aborted. function "() => { txn.commit(); }" threw object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
+FAIL Calling commit on a committed transaction throws. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL Calling abort on a committed transaction throws and does not prevent persisting the data. promise_test: Unhandled rejection with value: object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)"
+FAIL Calling txn.commit() when txn is inactive should throw. assert_throws: The transaction should be inactive so calling commit should throw. function "() => { txn.commit(); }" threw object "TypeError: txn.commit is not a function. (In 'txn.commit()', 'txn.commit' is undefined)" that is not a DOMException InvalidStateError: property "code" is equal to undefined, expected 11
+FAIL Transactions with same scope should stay in program order, even if one calls commit. promise_test: Unhandled rejection with value: object "TypeError: txn2.commit is not a function. (In 'txn2.commit()', 'txn2.commit' is undefined)"
+FAIL Transactions that explicitly commit and have errors should abort. promise_test: Unhandled rejection with value: object "TypeError: txn1.commit is not a function. (In 'txn1.commit()', 'txn1.commit' is undefined)"
+FAIL Transactions that handle all errors properly should be behave as expected when an explicit commit is called in an onerror handler. promise_test: Unhandled rejection with value: object "TypeError: txn1.commit is not a function. (In 'txn1.commit()', 'txn1.commit' is undefined)"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any-expected.txt
new file mode 100644 (file)
index 0000000..06cbf4c
--- /dev/null
@@ -0,0 +1,6 @@
+
+FAIL cursor.request from IDBObjectStore.openCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
+FAIL cursor.request from IDBObjectStore.openKeyCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
+FAIL cursor.request from IDBIndex.openCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
+FAIL cursor.request from IDBIndex.openKeyCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.js
new file mode 100644 (file)
index 0000000..60e6854
--- /dev/null
@@ -0,0 +1,41 @@
+// META: script=support.js
+
+function cursorRequestTest({ useIndex, useKeyCursor }) {
+  indexeddb_test(
+    (t, db) => {
+      const objStore = db.createObjectStore("my_objectstore");
+      objStore.add("data",  1);
+      objStore.createIndex("my_index", "");
+    },
+    (t, db) => {
+      const tx = db.transaction("my_objectstore");
+      let source = tx.objectStore("my_objectstore");
+      if (useIndex) source = source.index('my_index');
+      const req = useKeyCursor ? source.openKeyCursor() : source.openCursor();
+      let cursor;
+
+      req.onsuccess = t.step_func(() => {
+        cursor = req.result;
+        assert_equals(cursor.request, req, 'cursor.request');
+        assert_readonly(cursor, 'request');
+        assert_equals(cursor.request, cursor.request, 'cursor.request does not change');
+      });
+
+      req.transaction.oncomplete = t.step_func(() => {
+        setTimeout(t.step_func(() => {
+          assert_equals(cursor.request, req, 'cursor.request after transaction complete');
+          t.done();
+        }), 0);
+      });
+
+      req.transaction.onerror = t.unreached_func('Transaction error');
+    },
+    `cursor.request from ${useIndex ? 'IDBIndex' : 'IDBObjectStore'}.${useKeyCursor ? 'openKeyCursor' : 'openCursor'}`
+  );
+}
+
+for (const useIndex of [false, true]) {
+  for (const useKeyCursor of [false, true]) {
+    cursorRequestTest({ useIndex, useKeyCursor });
+  }
+}
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..06cbf4c
--- /dev/null
@@ -0,0 +1,6 @@
+
+FAIL cursor.request from IDBObjectStore.openCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
+FAIL cursor.request from IDBObjectStore.openKeyCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
+FAIL cursor.request from IDBIndex.openCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
+FAIL cursor.request from IDBIndex.openKeyCursor assert_equals: cursor.request expected (object) object "[object IDBRequest]" but got (undefined) undefined
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
index 539c824..77b812e 100644 (file)
@@ -10,7 +10,7 @@
 <script>
 
     var db,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" },
                   { pKey: "primaryKey_1", iKey: "indexKey_1" } ];
 
index 5adf3f0..b41427f 100644 (file)
@@ -10,7 +10,7 @@
 <script type="text/javascript">
 
     var db,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       records = [ { pKey: "primaryKey_0", iKey: "indexKey_0" },
                   { pKey: "primaryKey_1", iKey: "indexKey_1" } ];
 
index 452c0f1..88b4ed8 100644 (file)
@@ -11,7 +11,7 @@
 <script>
     var db,
       count = 0,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       records = [ { pKey: "primaryKey_0",   iKey: "indexKey_0" },
                   { pKey: "primaryKey_1",   iKey: "indexKey_1" },
                   { pKey: "primaryKey_1-2", iKey: "indexKey_1" } ],
index abe0e65..101d5db 100644 (file)
@@ -11,7 +11,7 @@
 <script>
 
     var db,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       records = [ { pKey: "primaryKey_0",   iKey: "indexKey_0" },
                   { pKey: "primaryKey_1",   iKey: "indexKey_1" },
                   { pKey: "primaryKey_1-2", iKey: "indexKey_1" },
index cf5bd40..0040ca7 100644 (file)
@@ -11,7 +11,7 @@
 <script>
 
     var db,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       records = [ { pKey: "primaryKey_0",   iKey: "indexKey_0" },
                   { pKey: "primaryKey_1",   iKey: "indexKey_1" },
                   { pKey: "primaryKey_1-2", iKey: "indexKey_1" },
index dea07bc..bd22cfe 100644 (file)
@@ -8,7 +8,7 @@
 <script>
 
     var db,
-      t = async_test(document.title, {timeout: 10000});
+      t = async_test();
 
     var open_rq = createdb(t);
     open_rq.onupgradeneeded = function(e) {
index d9be6b6..b555d74 100644 (file)
@@ -8,7 +8,7 @@
 <script>
     var db,
       count = 0,
-      t = async_test(document.title, {timeout: 10000});
+      t = async_test();
 
     var open_rq = createdb(t);
     open_rq.onupgradeneeded = function(e) {
index 559cce6..950fa77 100644 (file)
@@ -8,7 +8,7 @@
 <script>
     var db,
       count = 0,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       records = [ { pKey: "primaryKey_0", obj: { iKey: "iKey_0" }},
                   { pKey: "primaryKey_1", obj: { iKey: "iKey_1" }},
                   { pKey: "primaryKey_2", obj: { iKey: "iKey_2" }} ],
index 91a8383..9110a2e 100644 (file)
@@ -8,7 +8,7 @@
 <script>
     var db,
       count = 0,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       records = [ { pKey: "primaryKey_0", obj: { iKey: "iKey_0" }},
                   { pKey: "primaryKey_2", obj: { iKey: "iKey_2" }} ],
 
index c4c8d57..4d54de8 100644 (file)
@@ -8,7 +8,7 @@
 <script>
     var db,
       count = 0,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       records = [ { pKey: "primaryKey_0" },
                   { pKey: "primaryKey_1" },
                   { pKey: "primaryKey_2" } ],
index 899b2ac..299d4c1 100644 (file)
@@ -8,7 +8,7 @@
 <script>
     var db,
       count = 0,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       records = [ { pKey: "primaryKey_0" },
                   { pKey: "primaryKey_2" } ],
       expected_records = [ { pKey: "primaryKey_0" },
index cbd0b1f..07209e5 100644 (file)
@@ -8,7 +8,7 @@
 <script>
 
     var db,
-      t = async_test(document.title, {timeout: 10000})
+      t = async_test()
 
     var open_rq = createdb(t);
     open_rq.onupgradeneeded = function(e) {
index 50b3adb..8705501 100644 (file)
@@ -8,9 +8,13 @@
 <script>
 
 indexeddb_test(
-  (t, db, txn) => {
+  (t, db, txn, rq) => {
     db.createObjectStore('s');
 
+    // Acknowledge the error, to prevent window.error from firing in
+    // browsers that implement that.
+    rq.onerror = e => { e.preventDefault(); };
+
     txn.onabort = () => {
       setTimeout(t.step_func(() => {
         assert_throws(
index 5739f8c..69b91c5 100644 (file)
@@ -1,3 +1,3 @@
 
-PASS IDBDatabase.createObjectStore() - create an object store with an unknown optional parameter 
+PASS IDBDatabase.createObjectStore() - create an object store with an unknown optional parameter  
 
index 515c499..ca3369f 100644 (file)
@@ -7,7 +7,7 @@
 
 <script>
     var db,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       open_rq = createdb(t);
 
     open_rq.onupgradeneeded = function(e) {
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-databases-opaque-origin-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-databases-opaque-origin-expected.txt
new file mode 100644 (file)
index 0000000..0679f39
--- /dev/null
@@ -0,0 +1,4 @@
+
+FAIL IDBFactory.databases() in non-sandboxed iframe should not reject assert_equals: IDBFactory.databases() should not reject expected "no exception" but got "indexedDB.databases undefined"
+FAIL IDBFactory.databases() in sandboxed iframe should reject assert_equals: Promise should be rejected with SecurityError expected "SecurityError" but got "indexedDB.databases undefined"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-databases-opaque-origin.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-databases-opaque-origin.html
new file mode 100644 (file)
index 0000000..5f1b307
--- /dev/null
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>IDBFactory.databases() and opaque origins</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+
+function load_iframe(src, sandbox) {
+  return new Promise(resolve => {
+    const iframe = document.createElement('iframe');
+    iframe.onload = () => { resolve(iframe); };
+    if (sandbox)
+      iframe.sandbox = sandbox;
+    iframe.srcdoc = src;
+    iframe.style.display = 'none';
+    document.documentElement.appendChild(iframe);
+  });
+}
+
+function wait_for_message(iframe) {
+  return new Promise(resolve => {
+    self.addEventListener('message', function listener(e) {
+      if (e.source === iframe.contentWindow) {
+        resolve(e.data);
+        self.removeEventListener('message', listener);
+      }
+    });
+  });
+}
+
+const script =
+  '<script>' +
+  '  window.onmessage = () => {' +
+  '    try { ' +
+  '      if (!indexedDB || !indexedDB.databases) {' +
+  '        window.parent.postMessage({result: "indexedDB.databases undefined"}, "*")' +
+  '      }' +
+  '      indexedDB.databases().then(' +
+  '        () => window.parent.postMessage({result: "no exception"}, "*"),' +
+  '        ex => window.parent.postMessage({result: ex.name}, "*"));' +
+  '    } catch(e) { ' +
+  '      window.parent.postMessage({result: e.name + " thrown, not rejected"}, "*")' +
+  '    }'+
+  '  };' +
+  '<\/script>';
+
+promise_test(async t => {
+  const iframe = await load_iframe(script);
+  iframe.contentWindow.postMessage({}, '*');
+  const message = await wait_for_message(iframe);
+  assert_equals(message.result, 'no exception',
+                'IDBFactory.databases() should not reject');
+}, 'IDBFactory.databases() in non-sandboxed iframe should not reject');
+
+promise_test(async t => {
+  const iframe = await load_iframe(script, 'allow-scripts');
+  iframe.contentWindow.postMessage({}, '*');
+  const message = await wait_for_message(iframe);
+  assert_equals(message.result, 'SecurityError',
+                'Promise should be rejected with SecurityError');
+}, 'IDBFactory.databases() in sandboxed iframe should reject');
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-origin-isolation-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-origin-isolation-expected.txt
new file mode 100644 (file)
index 0000000..a33098e
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL Test to make sure that origins have separate locking schemes promise_test: Unhandled rejection with value: object "TypeError: indexedDB.databases is not a function. (In 'indexedDB.databases()', 'indexedDB.databases' is undefined)"
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-origin-isolation.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-origin-isolation.html
new file mode 100644 (file)
index 0000000..3f20087
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Databases on different origins use separate locking</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/get-host-info.sub.js"></script>
+<script src="support.js"></script>
+<script src="support-promises.js"></script>
+<script>
+
+var host_info = get_host_info();
+
+promise_test(async testCase => {
+  await deleteAllDatabases(testCase);
+
+  // Create an iframe to open and hold a database on a different origin.
+  var iframe = document.createElement('iframe');
+  var newLocation = window.location.href.replace('www', 'www2');
+
+  const keepalive_watcher = new EventWatcher(testCase, window, 'message');
+  iframe.src = host_info.HTTP_REMOTE_ORIGIN +
+      '/IndexedDB/resources/idbfactory-origin-isolation-iframe.html';
+  document.body.appendChild(iframe);
+
+  // Wait until the iframe starts its transaction.
+  var event = await keepalive_watcher.wait_for('message');
+  assert_equals("keep_alive_started", event.data);
+
+  // Create our own database with the same name, and perform a simple get.
+  const db = await createNamedDatabase(
+      testCase, 'db-isolation-test', database => {
+        database.createObjectStore('s');
+      });
+  const tx = db.transaction('s');
+  var request = tx.objectStore('s').get(0);
+  request.onsuccess = testCase.step_func_done();
+  request.onerror = testCase.unreached_func("There should be no errors.");
+}, "Test to make sure that origins have separate locking schemes");
+
+</script>
+
+<div id="log"></div>
index e1cab41..ebc55dd 100644 (file)
@@ -9,7 +9,7 @@
 
 <script>
     var db
-    var open_rq = createdb(async_test(document.title, {timeout: 10000}), undefined, 9)
+    var open_rq = createdb(async_test(), undefined, 9)
 
     open_rq.onupgradeneeded = function(e) {
         db = e.target.result
index c0ac71a..9767f26 100644 (file)
@@ -7,7 +7,7 @@
 
 <script>
     var db, db2;
-    var open_rq = createdb(async_test(document.title, {timeout: 10000}), undefined, 9);
+    var open_rq = createdb(async_test(), undefined, 9);
 
     open_rq.onupgradeneeded = function(e) {
         db = e.target.result;
index 88c59bd..ae7f0e2 100644 (file)
@@ -8,7 +8,7 @@
 <script>
     var db;
     var count_done = 0;
-    var open_rq = createdb(async_test(document.title, {timeout: 10000}));
+    var open_rq = createdb(async_test());
 
     open_rq.onupgradeneeded = function(e) {
         db = e.target.result;
index 763c480..f6a1310 100644 (file)
@@ -7,7 +7,7 @@
 
 <script>
     var db;
-    var open_rq = createdb(async_test(document.title, {timeout: 10000}), undefined, 9);
+    var open_rq = createdb(async_test(document.title), undefined, 9);
     var open2_t = async_test(document.title + " - second upgrade");
 
     open_rq.onupgradeneeded = function(e) {
index e4d54ee..ba72b78 100644 (file)
@@ -6,12 +6,13 @@
 <script src=support.js></script>
 
 <script>
-    var open_rq = createdb(async_test(), 'database_name', 13);
+    var database_name = document.location + '-database_name';
+    var open_rq = createdb(async_test(), database_name, 13);
 
     open_rq.onupgradeneeded = function(e) {};
     open_rq.onsuccess = function(e) {
         var db = e.target.result;
-        assert_equals(db.name, 'database_name', 'db.name');
+        assert_equals(db.name, database_name, 'db.name');
         assert_equals(db.version, 13, 'db.version');
         this.done();
     }
index 15ca666..9571d82 100644 (file)
@@ -6,7 +6,7 @@
 <script src=support.js></script>
 
 <script>
-    var open_rq = createdb(async_test(), 'database_name');
+    var open_rq = createdb(async_test(), document.location + '-database_name');
 
     open_rq.onupgradeneeded = function(e) {
         assert_equals(e.target.result.version, 1, "db.version");
index d9460bb..eef37ef 100644 (file)
@@ -6,7 +6,7 @@
 <script src=support.js></script>
 
 <script>
-    var open_rq = createdb(async_test(), 'database_name');
+    var open_rq = createdb(async_test(), document.location + '-database_name');
 
     open_rq.onupgradeneeded = function() {};
     open_rq.onsuccess = function(e) {
index 3e584a6..e99c8ad 100644 (file)
@@ -9,7 +9,7 @@
 <script src="support.js"></script>
 
 <script>
-    createdb(async_test(document.title, {timeout: 10000})).onupgradeneeded = function(e) {
+    createdb(async_test()).onupgradeneeded = function(e) {
         var store = e.target.result.createObjectStore("store");
 
         assert_throws('InvalidAccessError', function() {
index 4f9df36..bcaea97 100644 (file)
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <meta charset="utf-8">
 <title>IDBIndex.multiEntry - a 1000 entry multiEntry array</title>
+<meta name="timeout" content="long">
 <link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal">
 <link rel=help href="http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#key-construct">
 <link rel=assert title="XXX">
@@ -10,8 +11,8 @@
 
 <script>
     var db,
-        t_add = async_test("Adding one item with 1000 multiEntry keys", { timeout: 10000 }),
-        t_get = async_test("Getting the one item by 1000 indeced keys ", { timeout: 10000 });
+        t_add = async_test("Adding one item with 1000 multiEntry keys"),
+        t_get = async_test("Getting the one item by 1000 indeced keys ");
 
     var open_rq = createdb(t_add);
     var obj = { test: 'yo', idxkeys: [] };
index 5077f48..ff88055 100644 (file)
@@ -12,7 +12,7 @@
     var db,
         expected_keys = [1, 2, 2, 3, 3];
 
-    var open_rq = createdb(async_test(document.title, {timeout: 10000}))
+    var open_rq = createdb(async_test())
 
     open_rq.onupgradeneeded = function(e) {
         db = e.target.result;
index b14d301..b61988e 100644 (file)
@@ -39,9 +39,8 @@ promise_test(testCase => {
             'versionchange transaction is aborted');
 
         const request = indexedDB.open(dbName, 1);
-        return requestWatcher(testCase, request).wait_for('success');
-    }).then(event => {
-        const database = event.target.result;
+        return promiseForRequest(testCase, request);
+    }).then(database => {
         const transaction = database.transaction('books', 'readonly');
         const store = transaction.objectStore('books');
         assert_array_equals(
@@ -95,9 +94,8 @@ promise_test(testCase => {
             'versionchange transaction is aborted');
 
         const request = indexedDB.open(dbName, 1);
-        return requestWatcher(testCase, request).wait_for('success');
-    }).then(event => {
-        const database = event.target.result;
+        return promiseForRequest(testCase, request);
+    }).then(database => {
         const transaction = database.transaction('not_books', 'readonly');
         const store = transaction.objectStore('not_books');
         assert_array_equals(
index 3099b45..f80c4c1 100644 (file)
@@ -8,7 +8,7 @@
 
 <script>
     var db,
-      t = async_test(document.title, {timeout: 10000});
+      t = async_test();
 
     var open_rq = createdb(t);
     open_rq.onupgradeneeded = function(e) {
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any-expected.txt
new file mode 100644 (file)
index 0000000..e000496
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL IDBIndex's keyPath attribute returns the same object. assert_equals: Same object instance is returned each time keyPath is inspected expected ["a", "b"] but got ["a", "b"]
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.js
new file mode 100644 (file)
index 0000000..19cf231
--- /dev/null
@@ -0,0 +1,30 @@
+// META: title=IndexedDB: IDBIndex keyPath attribute - same object
+// META: script=support.js
+
+indexeddb_test(
+  (t, db) => {
+    const store = db.createObjectStore('store', {keyPath: ['a', 'b']});
+    store.createIndex('index', ['a', 'b']);
+  },
+  (t, db) => {
+    const tx = db.transaction('store');
+    const store = tx.objectStore('store');
+    const index = store.index('index');
+    assert_equals(typeof index.keyPath, 'object', 'keyPath is an object');
+    assert_true(Array.isArray(index.keyPath), 'keyPath is an array');
+
+    assert_equals(
+      index.keyPath, index.keyPath,
+      'Same object instance is returned each time keyPath is inspected');
+
+    const tx2 = db.transaction('store');
+    const store2 = tx2.objectStore('store');
+    const index2 = store2.index('index');
+
+    assert_not_equals(
+      index.keyPath, index2.keyPath,
+      'Different instances are returned from different index instances.');
+
+    t.done();
+  },
+  `IDBIndex's keyPath attribute returns the same object.`);
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..e000496
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL IDBIndex's keyPath attribute returns the same object. assert_equals: Same object instance is returned each time keyPath is inspected expected ["a", "b"] but got ["a", "b"]
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
index 6e16c31..75893cd 100644 (file)
@@ -40,9 +40,8 @@ promise_test(testCase => {
                 'IDBObjectStore.name should not reflect the rename any more ' +
                 'after the versionchange transaction is aborted');
         const request = indexedDB.open(dbName, 1);
-        return requestWatcher(testCase, request).wait_for('success');
-    }).then(event => {
-        const database = event.target.result;
+        return promiseForRequest(testCase, request);
+    }).then(database => {
         assert_array_equals(
             database.objectStoreNames, ['books'],
             'IDBDatabase.objectStoreNames should not reflect the rename ' +
@@ -107,9 +106,8 @@ promise_test(testCase => {
             'should be empty after the versionchange transaction is aborted ' +
             'returns');
         const request = indexedDB.open(dbName, 1);
-        return requestWatcher(testCase, request).wait_for('success');
-    }).then(event => {
-        const database = event.target.result;
+        return promiseForRequest(testCase, request);
+    }).then(database => {
         assert_array_equals(
             database.objectStoreNames, [],
             'IDBDatabase.objectStoreNames should not reflect the creation or ' +
index 87ea39c..c66b815 100644 (file)
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <meta charset=utf-8>
 <title>IDBObjectStore.createIndex() - AutoIncrement in Compound Index</title>
+<meta name="timeout" content="long">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="support.js"></script>
     },
     "Auto-Increment Primary Key"
   );
+
+  indexeddb_test(
+    function(t, db, txn) {
+      // Auto-increment
+      var store = db.createObjectStore("Store3", {keyPath: "id", autoIncrement: true});
+      store.createIndex("CompoundKey", ["num", "id", "other"]);
+
+      var num = 100;
+
+      // Add data to Store3 - valid keys
+      // Objects will be stored in Store3 and keys will get added
+      // to the CompoundKeys index.
+      store.put({num: num++, other: 0});
+      store.put({num: num++, other: [0]});
+
+      // Add data - missing key
+      // Objects will be stored in Store3 but keys won't get added to
+      // the CompoundKeys index because the 'other' keypath doesn't
+      // resolve to a value.
+      store.put({num: num++});
+
+      // Add data to Store3 - invalid keys
+      // Objects will be stored in Store3 but keys won't get added to
+      // the CompoundKeys index because the 'other' property values
+      // aren't valid keys.
+      store.put({num: num++, other: null});
+      store.put({num: num++, other: {}});
+      store.put({num: num++, other: [null]});
+      store.put({num: num++, other: [{}]});
+    },
+    function(t, db) {
+      var store = db.transaction("Store3", "readwrite").objectStore("Store3");
+      const keys = [];
+      let count;
+      store.count().onsuccess = t.step_func(e => { count = e.target.result; });
+      store.index("CompoundKey").openCursor().onsuccess = t.step_func(function(e) {
+        const cursor = e.target.result;
+        if (cursor !== null) {
+          keys.push(cursor.key);
+          cursor.continue();
+          return;
+        }
+
+        // Done iteration, check results.
+        assert_equals(count, 7, 'Expected all 7 records to be stored.');
+        assert_equals(keys.length, 2, 'Expected exactly two index entries.');
+        assert_array_equals(keys[0], [100, 1, 0]);
+        assert_object_equals(keys[1], [101, 2, [0]]);
+        t.done();
+      });
+    },
+    "Auto-Increment Primary Key - invalid key values elsewhere"
+  );
 </script>
index f4b9b98..727ddd2 100644 (file)
@@ -9,7 +9,7 @@
 
 <script>
     var db, aborted,
-      t = async_test(document.title, {timeout:19000})
+      t = async_test()
 
     var open_rq = createdb(t);
     open_rq.onupgradeneeded = function(e) {
index 228dfc4..5d6d7b4 100644 (file)
@@ -9,7 +9,7 @@
 <script>
     var db,
       events = [],
-      t = async_test(document.title, {timeout: 10000})
+      t = async_test()
 
     var open_rq = createdb(t);
     open_rq.onupgradeneeded = function(e) {
index 29fadc0..f8fa9ee 100644 (file)
@@ -8,7 +8,7 @@
 
 <script>
     var db, aborted,
-      t = async_test(document.title, {timeout: 10000})
+      t = async_test()
 
     var open_rq = createdb(t);
     open_rq.onupgradeneeded = function(e) {
index 3dcb733..302bb86 100644 (file)
@@ -16,7 +16,7 @@
 
     var db,
       events = [],
-      t = async_test(document.title, {timeout: 10000})
+      t = async_test()
 
     var open_rq = createdb(t);
     open_rq.onupgradeneeded = function(e) {
index 682307c..b8bc9c5 100644 (file)
@@ -18,7 +18,7 @@
 
     var db,
       events = [],
-      t = async_test(document.title, {timeout: 10000})
+      t = async_test()
 
     var open_rq = createdb(t);
     open_rq.onupgradeneeded = function(e) {
index 6174523..25841f1 100644 (file)
@@ -9,7 +9,7 @@
 
 <script>
     var db,
-      t = async_test(document.title, {timeout:19000}),
+      t = async_test(),
       now = new Date(),
       mar18 = new Date(1111111111111),
       ar = ["Yay", 2, -Infinity],
index 7493463..4a5c0cc 100644 (file)
@@ -11,7 +11,7 @@
 <script>
     var db,
       add_success = false,
-      t = async_test(document.title, {timeout: 10000})
+      t = async_test()
 
     var open_rq = createdb(t);
     open_rq.onupgradeneeded = function(e) {
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any-expected.txt
new file mode 100644 (file)
index 0000000..bc34746
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL IDBObjectStore's keyPath attribute returns the same object. assert_equals: Same object instance is returned each time keyPath is inspected expected ["a", "b"] but got ["a", "b"]
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.js
new file mode 100644 (file)
index 0000000..91c3674
--- /dev/null
@@ -0,0 +1,27 @@
+// META: title=IndexedDB: IDBObjectStore keyPath attribute - same object
+// META: script=support.js
+
+indexeddb_test(
+  (t, db) => {
+    db.createObjectStore('store', {keyPath: ['a', 'b']});
+  },
+  (t, db) => {
+    const tx = db.transaction('store');
+    const store = tx.objectStore('store');
+    assert_equals(typeof store.keyPath, 'object', 'keyPath is an object');
+    assert_true(Array.isArray(store.keyPath), 'keyPath is an array');
+
+    assert_equals(
+      store.keyPath, store.keyPath,
+      'Same object instance is returned each time keyPath is inspected');
+
+    const tx2 = db.transaction('store');
+    const store2 = tx2.objectStore('store');
+
+    assert_not_equals(
+      store.keyPath, store2.keyPath,
+      'Different instances are returned from different store instances.');
+
+    t.done();
+  },
+  `IDBObjectStore's keyPath attribute returns the same object.`);
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..bc34746
--- /dev/null
@@ -0,0 +1,3 @@
+
+FAIL IDBObjectStore's keyPath attribute returns the same object. assert_equals: Same object instance is returned each time keyPath is inspected expected ["a", "b"] but got ["a", "b"]
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
index 7c295c7..647678a 100644 (file)
@@ -7,7 +7,7 @@
 
 <script>
     var db, store,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       open_rq = createdb(t),
       stages = [];
 
index 1f37bb4..8f19bc7 100644 (file)
@@ -8,7 +8,7 @@
 
 <script>
     var db, aborted,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       record = { indexedProperty: "bar" };
 
     var open_rq = createdb(t);
index 36b997f..e7ffeca 100644 (file)
@@ -13,7 +13,7 @@
 <script>
 
     var db,
-        t = async_test(document.title, {timeout: 10000});
+        t = async_test();
 
     t.step(function() {
         var openrq = indexedDB.open('db', 3);
@@ -1,5 +1,5 @@
 
-PASS Test driver 
+PASS idl_test setup 
 PASS Partial interface mixin WindowOrWorkerGlobalScope: original interface mixin defined 
 PASS IDBRequest interface: existence and properties of interface object 
 PASS IDBRequest interface object length 
@@ -30,10 +30,10 @@ PASS IDBVersionChangeEvent interface: existence and properties of interface prot
 PASS IDBVersionChangeEvent interface: existence and properties of interface prototype object's @@unscopables property 
 PASS IDBVersionChangeEvent interface: attribute oldVersion 
 PASS IDBVersionChangeEvent interface: attribute newVersion 
-PASS IDBVersionChangeEvent must be primary interface of [object IDBVersionChangeEvent] 
-PASS Stringification of [object IDBVersionChangeEvent] 
-PASS IDBVersionChangeEvent interface: [object IDBVersionChangeEvent] must inherit property "oldVersion" with the proper type 
-PASS IDBVersionChangeEvent interface: [object IDBVersionChangeEvent] must inherit property "newVersion" with the proper type 
+PASS IDBVersionChangeEvent must be primary interface of new IDBVersionChangeEvent("type") 
+PASS Stringification of new IDBVersionChangeEvent("type") 
+PASS IDBVersionChangeEvent interface: new IDBVersionChangeEvent("type") must inherit property "oldVersion" with the proper type 
+PASS IDBVersionChangeEvent interface: new IDBVersionChangeEvent("type") must inherit property "newVersion" with the proper type 
 PASS IDBFactory interface: existence and properties of interface object 
 PASS IDBFactory interface object length 
 PASS IDBFactory interface object name 
@@ -183,4 +183,6 @@ PASS IDBTransaction interface: operation abort()
 PASS IDBTransaction interface: attribute onabort 
 PASS IDBTransaction interface: attribute oncomplete 
 PASS IDBTransaction interface: attribute onerror 
+PASS Window interface: attribute indexedDB 
+PASS WorkerGlobalScope interface: existence and properties of interface object 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.js
new file mode 100644 (file)
index 0000000..efb8466
--- /dev/null
@@ -0,0 +1,24 @@
+// META: global=window,worker
+// META: script=/resources/WebIDLParser.js
+// META: script=/resources/idlharness.js
+
+idl_test(
+  ['IndexedDB'],
+  ['html', 'dom'],
+  idl_array => {
+    idl_array.add_objects({
+      IDBCursor: [],
+      IDBCursorWithValue: [],
+      IDBDatabase: [],
+      IDBFactory: [self.indexedDB],
+      IDBIndex: [],
+      IDBKeyRange: [IDBKeyRange.only(0)],
+      IDBObjectStore: [],
+      IDBOpenDBRequest: [],
+      IDBRequest: [],
+      IDBTransaction: [],
+      IDBVersionChangeEvent: ['new IDBVersionChangeEvent("type")'],
+      DOMStringList: [],
+    });
+  }
+);
@@ -1,37 +1,6 @@
 
-PASS Test driver 
+PASS idl_test setup 
 PASS Partial interface mixin WindowOrWorkerGlobalScope: original interface mixin defined 
-PASS EventListener interface: existence and properties of interface object 
-PASS NodeList interface: existence and properties of interface object 
-PASS HTMLCollection interface: existence and properties of interface object 
-PASS MutationObserver interface: existence and properties of interface object 
-PASS MutationRecord interface: existence and properties of interface object 
-PASS Node interface: existence and properties of interface object 
-PASS Document interface: existence and properties of interface object 
-PASS XMLDocument interface: existence and properties of interface object 
-PASS DOMImplementation interface: existence and properties of interface object 
-PASS DocumentType interface: existence and properties of interface object 
-PASS DocumentFragment interface: existence and properties of interface object 
-PASS ShadowRoot interface: existence and properties of interface object 
-PASS Element interface: existence and properties of interface object 
-PASS NamedNodeMap interface: existence and properties of interface object 
-PASS Attr interface: existence and properties of interface object 
-PASS CharacterData interface: existence and properties of interface object 
-PASS Text interface: existence and properties of interface object 
-PASS CDATASection interface: existence and properties of interface object 
-PASS ProcessingInstruction interface: existence and properties of interface object 
-PASS Comment interface: existence and properties of interface object 
-PASS AbstractRange interface: existence and properties of interface object 
-PASS StaticRange interface: existence and properties of interface object 
-PASS Range interface: existence and properties of interface object 
-PASS NodeIterator interface: existence and properties of interface object 
-PASS TreeWalker interface: existence and properties of interface object 
-PASS NodeFilter interface: existence and properties of interface object 
-PASS DOMTokenList interface: existence and properties of interface object 
-PASS XPathResult interface: existence and properties of interface object 
-PASS XPathExpression interface: existence and properties of interface object 
-PASS XPathNSResolver interface: existence and properties of interface object 
-PASS XPathEvaluator interface: existence and properties of interface object 
 PASS IDBRequest interface: existence and properties of interface object 
 PASS IDBRequest interface object length 
 PASS IDBRequest interface object name 
@@ -61,10 +30,10 @@ PASS IDBVersionChangeEvent interface: existence and properties of interface prot
 PASS IDBVersionChangeEvent interface: existence and properties of interface prototype object's @@unscopables property 
 PASS IDBVersionChangeEvent interface: attribute oldVersion 
 PASS IDBVersionChangeEvent interface: attribute newVersion 
-PASS IDBVersionChangeEvent must be primary interface of [object IDBVersionChangeEvent] 
-PASS Stringification of [object IDBVersionChangeEvent] 
-PASS IDBVersionChangeEvent interface: [object IDBVersionChangeEvent] must inherit property "oldVersion" with the proper type 
-PASS IDBVersionChangeEvent interface: [object IDBVersionChangeEvent] must inherit property "newVersion" with the proper type 
+PASS IDBVersionChangeEvent must be primary interface of new IDBVersionChangeEvent("type") 
+PASS Stringification of new IDBVersionChangeEvent("type") 
+PASS IDBVersionChangeEvent interface: new IDBVersionChangeEvent("type") must inherit property "oldVersion" with the proper type 
+PASS IDBVersionChangeEvent interface: new IDBVersionChangeEvent("type") must inherit property "newVersion" with the proper type 
 PASS IDBFactory interface: existence and properties of interface object 
 PASS IDBFactory interface object length 
 PASS IDBFactory interface object name 
@@ -214,4 +183,6 @@ PASS IDBTransaction interface: operation abort()
 PASS IDBTransaction interface: attribute onabort 
 PASS IDBTransaction interface: attribute oncomplete 
 PASS IDBTransaction interface: attribute onerror 
+PASS Window interface: existence and properties of interface object 
+PASS WorkerGlobalScope interface: attribute indexedDB 
 
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces-expected.txt
deleted file mode 100644 (file)
index 9dde02f..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-IndexedDB IDL tests
-
-
-PASS IndexedDB IDL tests 
-FAIL Window interface: attribute indexedDB assert_true: The prototype object must have a property "indexedDB" expected true got false
-PASS Unscopable handled correctly for indexedDB property on Window 
-PASS IDBRequest interface: existence and properties of interface object 
-PASS IDBRequest interface object length 
-PASS IDBRequest interface object name 
-PASS IDBRequest interface: existence and properties of interface prototype object 
-PASS IDBRequest interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBRequest interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBRequest interface: attribute result 
-PASS Unscopable handled correctly for result property on IDBRequest 
-PASS IDBRequest interface: attribute error 
-PASS Unscopable handled correctly for error property on IDBRequest 
-PASS IDBRequest interface: attribute source 
-PASS Unscopable handled correctly for source property on IDBRequest 
-PASS IDBRequest interface: attribute transaction 
-PASS Unscopable handled correctly for transaction property on IDBRequest 
-PASS IDBRequest interface: attribute readyState 
-PASS Unscopable handled correctly for readyState property on IDBRequest 
-PASS IDBRequest interface: attribute onsuccess 
-PASS Unscopable handled correctly for onsuccess property on IDBRequest 
-PASS IDBRequest interface: attribute onerror 
-PASS Unscopable handled correctly for onerror property on IDBRequest 
-PASS IDBOpenDBRequest interface: existence and properties of interface object 
-PASS IDBOpenDBRequest interface object length 
-PASS IDBOpenDBRequest interface object name 
-PASS IDBOpenDBRequest interface: existence and properties of interface prototype object 
-PASS IDBOpenDBRequest interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBOpenDBRequest interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBOpenDBRequest interface: attribute onblocked 
-PASS Unscopable handled correctly for onblocked property on IDBOpenDBRequest 
-PASS IDBOpenDBRequest interface: attribute onupgradeneeded 
-PASS Unscopable handled correctly for onupgradeneeded property on IDBOpenDBRequest 
-PASS IDBVersionChangeEvent interface: existence and properties of interface object 
-PASS IDBVersionChangeEvent interface object length 
-PASS IDBVersionChangeEvent interface object name 
-PASS IDBVersionChangeEvent interface: existence and properties of interface prototype object 
-PASS IDBVersionChangeEvent interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBVersionChangeEvent interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBVersionChangeEvent interface: attribute oldVersion 
-PASS Unscopable handled correctly for oldVersion property on IDBVersionChangeEvent 
-PASS IDBVersionChangeEvent interface: attribute newVersion 
-PASS Unscopable handled correctly for newVersion property on IDBVersionChangeEvent 
-PASS IDBVersionChangeEvent must be primary interface of new IDBVersionChangeEvent('foo') 
-PASS Stringification of new IDBVersionChangeEvent('foo') 
-PASS IDBVersionChangeEvent interface: new IDBVersionChangeEvent('foo') must inherit property "oldVersion" with the proper type 
-PASS IDBVersionChangeEvent interface: new IDBVersionChangeEvent('foo') must inherit property "newVersion" with the proper type 
-PASS IDBFactory interface: existence and properties of interface object 
-PASS IDBFactory interface object length 
-PASS IDBFactory interface object name 
-PASS IDBFactory interface: existence and properties of interface prototype object 
-PASS IDBFactory interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBFactory interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBFactory interface: operation open(DOMString, unsigned long long) 
-PASS Unscopable handled correctly for open(DOMString, unsigned long long) on IDBFactory 
-PASS IDBFactory interface: operation deleteDatabase(DOMString) 
-PASS Unscopable handled correctly for deleteDatabase(DOMString) on IDBFactory 
-PASS IDBFactory interface: operation cmp(any, any) 
-PASS Unscopable handled correctly for cmp(any, any) on IDBFactory 
-PASS IDBFactory must be primary interface of window.indexedDB 
-PASS Stringification of window.indexedDB 
-PASS IDBFactory interface: window.indexedDB must inherit property "open(DOMString, unsigned long long)" with the proper type 
-PASS IDBFactory interface: calling open(DOMString, unsigned long long) on window.indexedDB with too few arguments must throw TypeError 
-PASS IDBFactory interface: window.indexedDB must inherit property "deleteDatabase(DOMString)" with the proper type 
-PASS IDBFactory interface: calling deleteDatabase(DOMString) on window.indexedDB with too few arguments must throw TypeError 
-PASS IDBFactory interface: window.indexedDB must inherit property "cmp(any, any)" with the proper type 
-PASS IDBFactory interface: calling cmp(any, any) on window.indexedDB with too few arguments must throw TypeError 
-PASS IDBDatabase interface: existence and properties of interface object 
-PASS IDBDatabase interface object length 
-PASS IDBDatabase interface object name 
-PASS IDBDatabase interface: existence and properties of interface prototype object 
-PASS IDBDatabase interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBDatabase interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBDatabase interface: attribute name 
-PASS Unscopable handled correctly for name property on IDBDatabase 
-PASS IDBDatabase interface: attribute version 
-PASS Unscopable handled correctly for version property on IDBDatabase 
-PASS IDBDatabase interface: attribute objectStoreNames 
-PASS Unscopable handled correctly for objectStoreNames property on IDBDatabase 
-PASS IDBDatabase interface: operation transaction([object Object],[object Object], IDBTransactionMode) 
-PASS Unscopable handled correctly for transaction([object Object],[object Object], IDBTransactionMode) on IDBDatabase 
-PASS IDBDatabase interface: operation close() 
-PASS Unscopable handled correctly for close() on IDBDatabase 
-PASS IDBDatabase interface: operation createObjectStore(DOMString, IDBObjectStoreParameters) 
-PASS Unscopable handled correctly for createObjectStore(DOMString, IDBObjectStoreParameters) on IDBDatabase 
-PASS IDBDatabase interface: operation deleteObjectStore(DOMString) 
-PASS Unscopable handled correctly for deleteObjectStore(DOMString) on IDBDatabase 
-PASS IDBDatabase interface: attribute onabort 
-PASS Unscopable handled correctly for onabort property on IDBDatabase 
-PASS IDBDatabase interface: attribute onclose 
-PASS Unscopable handled correctly for onclose property on IDBDatabase 
-PASS IDBDatabase interface: attribute onerror 
-PASS Unscopable handled correctly for onerror property on IDBDatabase 
-PASS IDBDatabase interface: attribute onversionchange 
-PASS Unscopable handled correctly for onversionchange property on IDBDatabase 
-PASS IDBObjectStore interface: existence and properties of interface object 
-PASS IDBObjectStore interface object length 
-PASS IDBObjectStore interface object name 
-PASS IDBObjectStore interface: existence and properties of interface prototype object 
-PASS IDBObjectStore interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBObjectStore interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBObjectStore interface: attribute name 
-PASS Unscopable handled correctly for name property on IDBObjectStore 
-PASS IDBObjectStore interface: attribute keyPath 
-PASS Unscopable handled correctly for keyPath property on IDBObjectStore 
-PASS IDBObjectStore interface: attribute indexNames 
-PASS Unscopable handled correctly for indexNames property on IDBObjectStore 
-PASS IDBObjectStore interface: attribute transaction 
-PASS Unscopable handled correctly for transaction property on IDBObjectStore 
-PASS IDBObjectStore interface: attribute autoIncrement 
-PASS Unscopable handled correctly for autoIncrement property on IDBObjectStore 
-PASS IDBObjectStore interface: operation put(any, any) 
-PASS Unscopable handled correctly for put(any, any) on IDBObjectStore 
-PASS IDBObjectStore interface: operation add(any, any) 
-PASS Unscopable handled correctly for add(any, any) on IDBObjectStore 
-PASS IDBObjectStore interface: operation delete(any) 
-PASS Unscopable handled correctly for delete(any) on IDBObjectStore 
-PASS IDBObjectStore interface: operation clear() 
-PASS Unscopable handled correctly for clear() on IDBObjectStore 
-PASS IDBObjectStore interface: operation get(any) 
-PASS Unscopable handled correctly for get(any) on IDBObjectStore 
-PASS IDBObjectStore interface: operation getKey(any) 
-PASS Unscopable handled correctly for getKey(any) on IDBObjectStore 
-PASS IDBObjectStore interface: operation getAll(any, unsigned long) 
-PASS Unscopable handled correctly for getAll(any, unsigned long) on IDBObjectStore 
-PASS IDBObjectStore interface: operation getAllKeys(any, unsigned long) 
-PASS Unscopable handled correctly for getAllKeys(any, unsigned long) on IDBObjectStore 
-PASS IDBObjectStore interface: operation count(any) 
-PASS Unscopable handled correctly for count(any) on IDBObjectStore 
-PASS IDBObjectStore interface: operation openCursor(any, IDBCursorDirection) 
-PASS Unscopable handled correctly for openCursor(any, IDBCursorDirection) on IDBObjectStore 
-PASS IDBObjectStore interface: operation openKeyCursor(any, IDBCursorDirection) 
-PASS Unscopable handled correctly for openKeyCursor(any, IDBCursorDirection) on IDBObjectStore 
-PASS IDBObjectStore interface: operation index(DOMString) 
-PASS Unscopable handled correctly for index(DOMString) on IDBObjectStore 
-PASS IDBObjectStore interface: operation createIndex(DOMString, [object Object],[object Object], IDBIndexParameters) 
-PASS Unscopable handled correctly for createIndex(DOMString, [object Object],[object Object], IDBIndexParameters) on IDBObjectStore 
-PASS IDBObjectStore interface: operation deleteIndex(DOMString) 
-PASS Unscopable handled correctly for deleteIndex(DOMString) on IDBObjectStore 
-PASS IDBIndex interface: existence and properties of interface object 
-PASS IDBIndex interface object length 
-PASS IDBIndex interface object name 
-PASS IDBIndex interface: existence and properties of interface prototype object 
-PASS IDBIndex interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBIndex interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBIndex interface: attribute name 
-PASS Unscopable handled correctly for name property on IDBIndex 
-PASS IDBIndex interface: attribute objectStore 
-PASS Unscopable handled correctly for objectStore property on IDBIndex 
-PASS IDBIndex interface: attribute keyPath 
-PASS Unscopable handled correctly for keyPath property on IDBIndex 
-PASS IDBIndex interface: attribute multiEntry 
-PASS Unscopable handled correctly for multiEntry property on IDBIndex 
-PASS IDBIndex interface: attribute unique 
-PASS Unscopable handled correctly for unique property on IDBIndex 
-PASS IDBIndex interface: operation get(any) 
-PASS Unscopable handled correctly for get(any) on IDBIndex 
-PASS IDBIndex interface: operation getKey(any) 
-PASS Unscopable handled correctly for getKey(any) on IDBIndex 
-PASS IDBIndex interface: operation getAll(any, unsigned long) 
-PASS Unscopable handled correctly for getAll(any, unsigned long) on IDBIndex 
-PASS IDBIndex interface: operation getAllKeys(any, unsigned long) 
-PASS Unscopable handled correctly for getAllKeys(any, unsigned long) on IDBIndex 
-PASS IDBIndex interface: operation count(any) 
-PASS Unscopable handled correctly for count(any) on IDBIndex 
-PASS IDBIndex interface: operation openCursor(any, IDBCursorDirection) 
-PASS Unscopable handled correctly for openCursor(any, IDBCursorDirection) on IDBIndex 
-PASS IDBIndex interface: operation openKeyCursor(any, IDBCursorDirection) 
-PASS Unscopable handled correctly for openKeyCursor(any, IDBCursorDirection) on IDBIndex 
-PASS IDBKeyRange interface: existence and properties of interface object 
-PASS IDBKeyRange interface object length 
-PASS IDBKeyRange interface object name 
-PASS IDBKeyRange interface: existence and properties of interface prototype object 
-PASS IDBKeyRange interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBKeyRange interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBKeyRange interface: attribute lower 
-PASS Unscopable handled correctly for lower property on IDBKeyRange 
-PASS IDBKeyRange interface: attribute upper 
-PASS Unscopable handled correctly for upper property on IDBKeyRange 
-PASS IDBKeyRange interface: attribute lowerOpen 
-PASS Unscopable handled correctly for lowerOpen property on IDBKeyRange 
-PASS IDBKeyRange interface: attribute upperOpen 
-PASS Unscopable handled correctly for upperOpen property on IDBKeyRange 
-PASS IDBKeyRange interface: operation only(any) 
-PASS Unscopable handled correctly for only(any) on IDBKeyRange 
-PASS IDBKeyRange interface: operation lowerBound(any, boolean) 
-PASS Unscopable handled correctly for lowerBound(any, boolean) on IDBKeyRange 
-PASS IDBKeyRange interface: operation upperBound(any, boolean) 
-PASS Unscopable handled correctly for upperBound(any, boolean) on IDBKeyRange 
-PASS IDBKeyRange interface: operation bound(any, any, boolean, boolean) 
-PASS Unscopable handled correctly for bound(any, any, boolean, boolean) on IDBKeyRange 
-PASS IDBKeyRange interface: operation includes(any) 
-PASS Unscopable handled correctly for includes(any) on IDBKeyRange 
-PASS IDBKeyRange must be primary interface of IDBKeyRange.only(0) 
-PASS Stringification of IDBKeyRange.only(0) 
-PASS IDBKeyRange interface: IDBKeyRange.only(0) must inherit property "lower" with the proper type 
-PASS IDBKeyRange interface: IDBKeyRange.only(0) must inherit property "upper" with the proper type 
-PASS IDBKeyRange interface: IDBKeyRange.only(0) must inherit property "lowerOpen" with the proper type 
-PASS IDBKeyRange interface: IDBKeyRange.only(0) must inherit property "upperOpen" with the proper type 
-PASS IDBKeyRange interface: IDBKeyRange.only(0) must inherit property "only(any)" with the proper type 
-PASS IDBKeyRange interface: calling only(any) on IDBKeyRange.only(0) with too few arguments must throw TypeError 
-PASS IDBKeyRange interface: IDBKeyRange.only(0) must inherit property "lowerBound(any, boolean)" with the proper type 
-PASS IDBKeyRange interface: calling lowerBound(any, boolean) on IDBKeyRange.only(0) with too few arguments must throw TypeError 
-PASS IDBKeyRange interface: IDBKeyRange.only(0) must inherit property "upperBound(any, boolean)" with the proper type 
-PASS IDBKeyRange interface: calling upperBound(any, boolean) on IDBKeyRange.only(0) with too few arguments must throw TypeError 
-PASS IDBKeyRange interface: IDBKeyRange.only(0) must inherit property "bound(any, any, boolean, boolean)" with the proper type 
-PASS IDBKeyRange interface: calling bound(any, any, boolean, boolean) on IDBKeyRange.only(0) with too few arguments must throw TypeError 
-PASS IDBKeyRange interface: IDBKeyRange.only(0) must inherit property "includes(any)" with the proper type 
-PASS IDBKeyRange interface: calling includes(any) on IDBKeyRange.only(0) with too few arguments must throw TypeError 
-PASS IDBCursor interface: existence and properties of interface object 
-PASS IDBCursor interface object length 
-PASS IDBCursor interface object name 
-PASS IDBCursor interface: existence and properties of interface prototype object 
-PASS IDBCursor interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBCursor interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBCursor interface: attribute source 
-PASS Unscopable handled correctly for source property on IDBCursor 
-PASS IDBCursor interface: attribute direction 
-PASS Unscopable handled correctly for direction property on IDBCursor 
-PASS IDBCursor interface: attribute key 
-PASS Unscopable handled correctly for key property on IDBCursor 
-PASS IDBCursor interface: attribute primaryKey 
-PASS Unscopable handled correctly for primaryKey property on IDBCursor 
-PASS IDBCursor interface: operation advance(unsigned long) 
-PASS Unscopable handled correctly for advance(unsigned long) on IDBCursor 
-PASS IDBCursor interface: operation continue(any) 
-PASS Unscopable handled correctly for continue(any) on IDBCursor 
-PASS IDBCursor interface: operation continuePrimaryKey(any, any) 
-PASS Unscopable handled correctly for continuePrimaryKey(any, any) on IDBCursor 
-PASS IDBCursor interface: operation update(any) 
-PASS Unscopable handled correctly for update(any) on IDBCursor 
-PASS IDBCursor interface: operation delete() 
-PASS Unscopable handled correctly for delete() on IDBCursor 
-PASS IDBCursorWithValue interface: existence and properties of interface object 
-PASS IDBCursorWithValue interface object length 
-PASS IDBCursorWithValue interface object name 
-PASS IDBCursorWithValue interface: existence and properties of interface prototype object 
-PASS IDBCursorWithValue interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBCursorWithValue interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBCursorWithValue interface: attribute value 
-PASS Unscopable handled correctly for value property on IDBCursorWithValue 
-PASS IDBTransaction interface: existence and properties of interface object 
-PASS IDBTransaction interface object length 
-PASS IDBTransaction interface object name 
-PASS IDBTransaction interface: existence and properties of interface prototype object 
-PASS IDBTransaction interface: existence and properties of interface prototype object's "constructor" property 
-PASS IDBTransaction interface: existence and properties of interface prototype object's @@unscopables property 
-PASS IDBTransaction interface: attribute objectStoreNames 
-PASS Unscopable handled correctly for objectStoreNames property on IDBTransaction 
-PASS IDBTransaction interface: attribute mode 
-PASS Unscopable handled correctly for mode property on IDBTransaction 
-PASS IDBTransaction interface: attribute db 
-PASS Unscopable handled correctly for db property on IDBTransaction 
-PASS IDBTransaction interface: attribute error 
-PASS Unscopable handled correctly for error property on IDBTransaction 
-PASS IDBTransaction interface: operation objectStore(DOMString) 
-PASS Unscopable handled correctly for objectStore(DOMString) on IDBTransaction 
-PASS IDBTransaction interface: operation abort() 
-PASS Unscopable handled correctly for abort() on IDBTransaction 
-PASS IDBTransaction interface: attribute onabort 
-PASS Unscopable handled correctly for onabort property on IDBTransaction 
-PASS IDBTransaction interface: attribute oncomplete 
-PASS Unscopable handled correctly for oncomplete property on IDBTransaction 
-PASS IDBTransaction interface: attribute onerror 
-PASS Unscopable handled correctly for onerror property on IDBTransaction 
-
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.any.js
deleted file mode 100644 (file)
index f1b2a99..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// META: script=/resources/WebIDLParser.js
-// META: script=/resources/idlharness.js
-
-promise_test(async t => {
-  const [html, dom, indexeddb] = await Promise.all([
-    '/interfaces/html.idl',
-    '/interfaces/dom.idl',
-    '/interfaces/IndexedDB.idl',
-  ].map(url => fetch(url).then(response => response.text())));
-
-  const idl_array = new IdlArray();
-  idl_array.add_untested_idls(html, { only: ['WindowOrWorkerGlobalScope'] });
-  idl_array.add_untested_idls(dom);
-  idl_array.add_idls(indexeddb);
-  idl_array.add_objects({
-    IDBCursor: [],
-    IDBCursorWithValue: [],
-    IDBDatabase: [],
-    IDBFactory: [self.indexedDB],
-    IDBIndex: [],
-    IDBKeyRange: [IDBKeyRange.only(0)],
-    IDBObjectStore: [],
-    IDBOpenDBRequest: [],
-    IDBRequest: [],
-    IDBTransaction: [],
-    IDBVersionChangeEvent: [new IDBVersionChangeEvent('')],
-    DOMStringList: [],
-  });
-
-  idl_array.test();
-}, 'Test driver');
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-common.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-common.js
new file mode 100644 (file)
index 0000000..45c8ffe
--- /dev/null
@@ -0,0 +1,93 @@
+// Returns the "name" property written to the object with the given ID.
+function nameForId(id) {
+  return `Object ${id}`;
+}
+
+// Initial database setup used by all the reading-autoincrement tests.
+async function setupAutoincrementDatabase(testCase) {
+  const database = await createDatabase(testCase, database => {
+    const store = database.createObjectStore(
+        'store', { autoIncrement: true, keyPath: 'id' });
+    store.createIndex('by_name', 'name', { unique: true });
+    store.createIndex('by_id', 'id', { unique: true });
+
+    // Cover writing from the initial upgrade transaction.
+    for (let i = 1; i <= 16; ++i) {
+      if (i % 2 == 0) {
+        store.put({name: nameForId(i), id: i});
+      } else {
+        store.put({name: nameForId(i)});
+      }
+    }
+  });
+
+  // Cover writing from a subsequent transaction.
+  const transaction = database.transaction(['store'], 'readwrite');
+  const store = transaction.objectStore('store');
+  for (let i = 17; i <= 32; ++i) {
+    if (i % 2 == 0) {
+      store.put({name: nameForId(i), id: i});
+    } else {
+      store.put({name: nameForId(i)});
+    }
+  }
+  await promiseForTransaction(testCase, transaction);
+
+  return database;
+}
+
+// Returns the IDs used by the object store, sorted as strings.
+//
+// This is used to determine the correct order of records when retrieved from an
+// index that uses stringified IDs.
+function idsSortedByStringCompare() {
+  const stringIds = [];
+  for (let i = 1; i <= 32; ++i)
+    stringIds.push(i);
+  stringIds.sort((a, b) => indexedDB.cmp(`${a}`, `${b}`));
+  return stringIds;
+}
+
+async function iterateCursor(testCase, cursorRequest, callback) {
+  // This uses requestWatcher() directly instead of using promiseForRequest()
+  // inside the loop to avoid creating multiple EventWatcher instances. In turn,
+  // this avoids ending up with O(N) listeners for the request and O(N^2)
+  // dispatched events.
+  const eventWatcher = requestWatcher(testCase, cursorRequest);
+  while (true) {
+    const event = await eventWatcher.wait_for('success');
+    const cursor = event.target.result;
+    if (cursor === null)
+      return;
+    callback(cursor);
+    cursor.continue();
+  }
+}
+
+// Returns equivalent information to getAllKeys() by iterating a cursor.
+//
+// Returns an array with one dictionary per entry in the source. The dictionary
+// has the properties "key" and "primaryKey".
+async function getAllKeysViaCursor(testCase, cursorSource) {
+  const results = [];
+  await iterateCursor(testCase, cursorSource.openKeyCursor(), cursor => {
+    results.push({ key: cursor.key, primaryKey: cursor.primaryKey });
+  });
+  return results;
+}
+
+// Returns equivalent information to getAll() by iterating a cursor.
+//
+// Returns an array with one dictionary per entry in the source. The dictionary
+// has the properties "key", "primaryKey" and "value".
+async function getAllViaCursor(testCase, cursorSource) {
+  const results = [];
+  await iterateCursor(testCase, cursorSource.openCursor(), cursor => {
+    results.push({
+      key: cursor.key,
+      primaryKey: cursor.primaryKey,
+      value: cursor.value,
+    });
+  });
+  return results;
+}
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any-expected.txt
new file mode 100644 (file)
index 0000000..3e715a4
--- /dev/null
@@ -0,0 +1,6 @@
+
+PASS IDBIndex.openCursor() iterates over an index on the autoincrement key 
+PASS IDBIndex.openKeyCursor() iterates over an index on the autoincrement key 
+PASS IDBIndex.openCursor() iterates over an index not covering the autoincrement key 
+PASS IDBIndex.openKeyCursor() iterates over an index not covering the autoincrement key 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.js
new file mode 100644 (file)
index 0000000..d793876
--- /dev/null
@@ -0,0 +1,88 @@
+// META: global=window,dedicatedworker,sharedworker,serviceworker
+// META: script=../support-promises.js
+// META: script=./reading-autoincrement-common.js
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const index = store.index('by_id');
+
+  const result = await getAllViaCursor(testCase, index);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i) {
+    assert_equals(result[i - 1].key, i, 'Autoincrement index key');
+    assert_equals(result[i - 1].primaryKey, i, 'Autoincrement primary key');
+    assert_equals(result[i - 1].value.id, i, 'Autoincrement key in value');
+    assert_equals(result[i - 1].value.name, nameForId(i),
+                  'String property in value');
+  }
+
+  database.close();
+}, 'IDBIndex.openCursor() iterates over an index on the autoincrement key');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const index = store.index('by_id');
+
+  const result = await getAllKeysViaCursor(testCase, index);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i) {
+    assert_equals(result[i - 1].key, i, 'Autoincrement index key');
+    assert_equals(result[i - 1].primaryKey, i, 'Autoincrement primary key');
+  }
+
+  database.close();
+}, 'IDBIndex.openKeyCursor() iterates over an index on the autoincrement key');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const index = store.index('by_name');
+
+  const stringSortedIds = idsSortedByStringCompare();
+
+  const result = await getAllViaCursor(testCase, index);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i) {
+    assert_equals(result[i - 1].key, nameForId(stringSortedIds[i - 1]),
+                  'Index key');
+    assert_equals(result[i - 1].primaryKey, stringSortedIds[i - 1],
+                  'Autoincrement primary key');
+    assert_equals(result[i - 1].value.id, stringSortedIds[i - 1],
+                  'Autoincrement key in value');
+    assert_equals(result[i - 1].value.name, nameForId(stringSortedIds[i - 1]),
+                  'String property in value');
+  }
+
+  database.close();
+}, 'IDBIndex.openCursor() iterates over an index not covering the ' +
+   'autoincrement key');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const index = store.index('by_name');
+
+  const stringSortedIds = idsSortedByStringCompare();
+
+  const result = await getAllKeysViaCursor(testCase, index);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i) {
+    assert_equals(result[i - 1].key, nameForId(stringSortedIds[i - 1]),
+                  'Index key');
+    assert_equals(result[i - 1].primaryKey, stringSortedIds[i - 1],
+                  'Autoincrement primary key');
+  }
+
+  database.close();
+}, 'IDBIndex.openKeyCursor() iterates over an index not covering the ' +
+   'autoincrement key');
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker-expected.txt
new file mode 100644 (file)
index 0000000..3e715a4
--- /dev/null
@@ -0,0 +1,6 @@
+
+PASS IDBIndex.openCursor() iterates over an index on the autoincrement key 
+PASS IDBIndex.openKeyCursor() iterates over an index on the autoincrement key 
+PASS IDBIndex.openCursor() iterates over an index not covering the autoincrement key 
+PASS IDBIndex.openKeyCursor() iterates over an index not covering the autoincrement key 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..3e715a4
--- /dev/null
@@ -0,0 +1,6 @@
+
+PASS IDBIndex.openCursor() iterates over an index on the autoincrement key 
+PASS IDBIndex.openKeyCursor() iterates over an index on the autoincrement key 
+PASS IDBIndex.openCursor() iterates over an index not covering the autoincrement key 
+PASS IDBIndex.openKeyCursor() iterates over an index not covering the autoincrement key 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any-expected.txt
new file mode 100644 (file)
index 0000000..3f97be1
--- /dev/null
@@ -0,0 +1,8 @@
+
+PASS IDBIndex.getAll() for an index on the autoincrement key 
+PASS IDBIndex.getAllKeys() for an index on the autoincrement key 
+PASS IDBIndex.get() for an index on the autoincrement key 
+PASS IDBIndex.getAll() for an index not covering the autoincrement key 
+PASS IDBIndex.getAllKeys() returns correct result for an index not covering the autoincrement key 
+PASS IDBIndex.get() for an index not covering the autoincrement key 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.js
new file mode 100644 (file)
index 0000000..d945b78
--- /dev/null
@@ -0,0 +1,108 @@
+// META: global=window,dedicatedworker,sharedworker,serviceworker
+// META: script=../support-promises.js
+// META: script=./reading-autoincrement-common.js
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const index = store.index('by_id');
+  const request = index.getAll();
+  const result = await promiseForRequest(testCase, request);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i) {
+    assert_equals(result[i - 1].id, i, 'Autoincrement key');
+    assert_equals(result[i - 1].name, nameForId(i), 'String property');
+  }
+
+  database.close();
+}, 'IDBIndex.getAll() for an index on the autoincrement key');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const index = store.index('by_id');
+  const request = index.getAllKeys();
+  const result = await promiseForRequest(testCase, request);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i)
+    assert_equals(result[i - 1], i, 'Autoincrement key');
+
+  database.close();
+}, 'IDBIndex.getAllKeys() for an index on the autoincrement key');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const index = store.index('by_id');
+
+  for (let i = 1; i <= 32; ++i) {
+    const request = index.get(i);
+    const result = await promiseForRequest(testCase, request);
+    assert_equals(result.id, i, 'autoincrement key');
+    assert_equals(result.name, nameForId(i), 'string property');
+  }
+
+  database.close();
+}, 'IDBIndex.get() for an index on the autoincrement key');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const stringSortedIds = idsSortedByStringCompare();
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const index = store.index('by_name');
+  const request = index.getAll();
+  const result = await promiseForRequest(testCase, request);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i) {
+    assert_equals(result[i - 1].id, stringSortedIds[i - 1],
+                  'autoincrement key');
+    assert_equals(result[i - 1].name, nameForId(stringSortedIds[i - 1]),
+                  'string property');
+  }
+
+  database.close();
+}, 'IDBIndex.getAll() for an index not covering the autoincrement key');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const stringSortedIds = idsSortedByStringCompare();
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const index = store.index('by_name');
+  const request = index.getAllKeys();
+  const result = await promiseForRequest(testCase, request);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i)
+    assert_equals(result[i - 1], stringSortedIds[i - 1], 'String property');
+
+  database.close();
+}, 'IDBIndex.getAllKeys() returns correct result for an index not covering ' +
+   'the autoincrement key');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const index = store.index('by_name');
+
+  for (let i = 1; i <= 32; ++i) {
+    const request = index.get(nameForId(i));
+    const result = await promiseForRequest(testCase, request);
+    assert_equals(result.id, i, 'Autoincrement key');
+    assert_equals(result.name, nameForId(i), 'String property');
+  }
+
+  database.close();
+}, 'IDBIndex.get() for an index not covering the autoincrement key');
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.serviceworker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.serviceworker-expected.txt
new file mode 100644 (file)
index 0000000..3f97be1
--- /dev/null
@@ -0,0 +1,8 @@
+
+PASS IDBIndex.getAll() for an index on the autoincrement key 
+PASS IDBIndex.getAllKeys() for an index on the autoincrement key 
+PASS IDBIndex.get() for an index on the autoincrement key 
+PASS IDBIndex.getAll() for an index not covering the autoincrement key 
+PASS IDBIndex.getAllKeys() returns correct result for an index not covering the autoincrement key 
+PASS IDBIndex.get() for an index not covering the autoincrement key 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.serviceworker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.serviceworker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..3f97be1
--- /dev/null
@@ -0,0 +1,8 @@
+
+PASS IDBIndex.getAll() for an index on the autoincrement key 
+PASS IDBIndex.getAllKeys() for an index on the autoincrement key 
+PASS IDBIndex.get() for an index on the autoincrement key 
+PASS IDBIndex.getAll() for an index not covering the autoincrement key 
+PASS IDBIndex.getAllKeys() returns correct result for an index not covering the autoincrement key 
+PASS IDBIndex.get() for an index not covering the autoincrement key 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any-expected.txt
new file mode 100644 (file)
index 0000000..253c360
--- /dev/null
@@ -0,0 +1,4 @@
+
+PASS IDBObjectStore.openCursor() iterates over an autoincrement store 
+PASS IDBObjectStore.openKeyCursor() iterates over an autoincrement store 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.js
new file mode 100644 (file)
index 0000000..0597109
--- /dev/null
@@ -0,0 +1,38 @@
+// META: global=window,dedicatedworker,sharedworker,serviceworker
+// META: script=../support-promises.js
+// META: script=./reading-autoincrement-common.js
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+
+  const result = await getAllViaCursor(testCase, store);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i) {
+    assert_equals(result[i - 1].key, i, 'Autoincrement key');
+    assert_equals(result[i - 1].primaryKey, i, 'Autoincrement primary key');
+    assert_equals(result[i - 1].value.id, i, 'Autoincrement key in value');
+    assert_equals(result[i - 1].value.name, nameForId(i),
+                  'string property in value');
+  }
+
+  database.close();
+}, 'IDBObjectStore.openCursor() iterates over an autoincrement store');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+
+  const result = await getAllKeysViaCursor(testCase, store);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i) {
+    assert_equals(result[i - 1].key, i, 'Incorrect autoincrement key');
+    assert_equals(result[i - 1].primaryKey, i, 'Incorrect primary key');
+  }
+
+  database.close();
+}, 'IDBObjectStore.openKeyCursor() iterates over an autoincrement store');
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.serviceworker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.serviceworker-expected.txt
new file mode 100644 (file)
index 0000000..253c360
--- /dev/null
@@ -0,0 +1,4 @@
+
+PASS IDBObjectStore.openCursor() iterates over an autoincrement store 
+PASS IDBObjectStore.openKeyCursor() iterates over an autoincrement store 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.serviceworker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.serviceworker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..253c360
--- /dev/null
@@ -0,0 +1,4 @@
+
+PASS IDBObjectStore.openCursor() iterates over an autoincrement store 
+PASS IDBObjectStore.openKeyCursor() iterates over an autoincrement store 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any-expected.txt
new file mode 100644 (file)
index 0000000..4d64a94
--- /dev/null
@@ -0,0 +1,5 @@
+
+PASS IDBObjectStore.getAll() for an autoincrement store 
+PASS IDBObjectStore.getAllKeys() for an autoincrement store 
+PASS IDBObjectStore.get() for an autoincrement store 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.js
new file mode 100644 (file)
index 0000000..bbba6a3
--- /dev/null
@@ -0,0 +1,49 @@
+// META: global=window,dedicatedworker,sharedworker,serviceworker
+// META: script=../support-promises.js
+// META: script=./reading-autoincrement-common.js
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const request = store.getAll();
+  const result = await promiseForRequest(testCase, request);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i) {
+    assert_equals(result[i - 1].id, i, 'Autoincrement key');
+    assert_equals(result[i - 1].name, nameForId(i), 'String property');
+  }
+
+  database.close();
+}, 'IDBObjectStore.getAll() for an autoincrement store');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+  const request = store.getAllKeys();
+  const result = await promiseForRequest(testCase, request);
+  assert_equals(result.length, 32);
+  for (let i = 1; i <= 32; ++i)
+    assert_equals(result[i - 1], i, 'Autoincrement key');
+
+  database.close();
+}, 'IDBObjectStore.getAllKeys() for an autoincrement store');
+
+promise_test(async testCase => {
+  const database = await setupAutoincrementDatabase(testCase);
+
+  const transaction = database.transaction(['store'], 'readonly');
+  const store = transaction.objectStore('store');
+
+  for (let i = 1; i <= 32; ++i) {
+    const request = store.get(i);
+    const result = await promiseForRequest(testCase, request);
+    assert_equals(result.id, i, 'Autoincrement key');
+    assert_equals(result.name, nameForId(i), 'String property');
+  }
+
+  database.close();
+}, 'IDBObjectStore.get() for an autoincrement store');
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.serviceworker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.serviceworker-expected.txt
new file mode 100644 (file)
index 0000000..4d64a94
--- /dev/null
@@ -0,0 +1,5 @@
+
+PASS IDBObjectStore.getAll() for an autoincrement store 
+PASS IDBObjectStore.getAllKeys() for an autoincrement store 
+PASS IDBObjectStore.get() for an autoincrement store 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.serviceworker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.serviceworker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..4d64a94
--- /dev/null
@@ -0,0 +1,5 @@
+
+PASS IDBObjectStore.getAll() for an autoincrement store 
+PASS IDBObjectStore.getAllKeys() for an autoincrement store 
+PASS IDBObjectStore.get() for an autoincrement store 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/w3c-import.log
new file mode 100644 (file)
index 0000000..5f3d8c7
--- /dev/null
@@ -0,0 +1,21 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-common.js
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.js
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.js
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.js
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.js
index ee2e247..2caad10 100644 (file)
@@ -9,7 +9,7 @@
 <script>
 
     var db,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       objects = [1, null, {id: 2}, null, 2.00001, 5, null, {id: 6} ],
       expected = [1, 2, 2.00001, 3, 5, 6],
       errors = 0;
index d069f0a..67f809d 100644 (file)
@@ -11,7 +11,7 @@
 <script>
 
     var db,
-      t = async_test(document.title, {timeout: 10000}),
+      t = async_test(),
       overflow_error_fired = false,
       objects =  [9007199254740991, null, "error", 2, "error" ],
       expected_keys = [2, 9007199254740991, 9007199254740992];
index 1896333..7f073dd 100644 (file)
@@ -22,7 +22,7 @@
 
     function keysort(desc, unsorted, expected) {
         var db,
-            t = async_test("Database readback sort - " + desc, { timeout: 10000 }),
+            t = async_test("Database readback sort - " + desc),
             store_name = 'store-' + Date.now() + Math.random();
 
         // The database test
index cb64d0b..0692bed 100644 (file)
@@ -54,6 +54,8 @@
         const result = request.result;
         assert_key_equals(result[testcase.property], key,
                           'Property should be used as key');
+      });
+      tx.oncomplete = t.step_func(function() {
         t.done();
       });
     },
index 835b7a3..83bd9cc 100644 (file)
@@ -11,7 +11,7 @@
 <script>
     function keypath(keypath, objects, expected_keys, desc) {
         var db,
-            t = async_test(document.title + " - " + (desc ? desc : keypath), { timeout: 10000 }),
+            t = async_test(document.title + " - " + (desc ? desc : keypath)),
             open_rq = createdb(t);
 
         open_rq.onupgradeneeded = function(e) {
index 319f228..21d72d7 100644 (file)
@@ -9,7 +9,7 @@
 <script>
     var events = [];
 
-    var open_rq = createdb(async_test(document.title, {timeout: 10000}));
+    var open_rq = createdb(async_test());
     open_rq.onupgradeneeded = function(e) {
         var db = e.target.result;
         var txn = e.target.transaction;
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/resources/idbfactory-origin-isolation-iframe.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/resources/idbfactory-origin-isolation-iframe.html
new file mode 100644 (file)
index 0000000..d405ea4
--- /dev/null
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>This iframe keeps a transaction on a database alive indefinitely to test</title>
+<script>
+
+// Keeps the passed transaction alive indefinitely (by making requests
+// against the named store). Returns a function that asserts that the
+// transaction has not already completed and then ends the request loop so that
+// the transaction may autocommit and complete.
+function keep_alive(tx, store_name) {
+  let completed = false;
+  tx.addEventListener('complete', () => { completed = true; });
+
+  let keepSpinning = true;
+
+  function spin() {
+    if (!keepSpinning)
+      return;
+    tx.objectStore(store_name).get(0).onsuccess = spin;
+  }
+  spin();
+
+  return () => {
+    assert_false(completed, 'Transaction completed while kept alive');
+    keepSpinning = false;
+  };
+}
+
+async function run() {
+  const dbs_to_delete = await indexedDB.databases();
+  for (const db_info of dbs_to_delete) {
+    let request = indexedDB.deleteDatabase(db_info.name);
+    await new Promise((resolve, reject) => {
+      request.onsuccess = resolve;
+      request.onerror = reject;
+    });
+  }
+
+  var openRequest = indexedDB.open('db-isolation-test');
+  openRequest.onupgradeneeded = () => {
+    openRequest.result.createObjectStore('s');
+  };
+  openRequest.onsuccess = () => {
+    var tx = openRequest.result.transaction('s');
+    keep_alive(tx, 's');
+    window.parent.postMessage("keep_alive_started", "*");
+  };
+}
+
+run();
+</script>
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/resources/w3c-import.log
new file mode 100644 (file)
index 0000000..06a0c0c
--- /dev/null
@@ -0,0 +1,17 @@
+The tests in this directory were imported from the W3C repository.
+Do NOT modify these tests directly in WebKit.
+Instead, create a pull request on the WPT github:
+       https://github.com/web-platform-tests/wpt
+
+Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
+
+Do NOT modify or remove this file.
+
+------------------------------------------------------------------------
+Properties requiring vendor prefixes:
+None
+Property values requiring vendor prefixes:
+None
+------------------------------------------------------------------------
+List of files:
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/resources/idbfactory-origin-isolation-iframe.html
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any-expected.txt
new file mode 100644 (file)
index 0000000..23c40b1
--- /dev/null
@@ -0,0 +1,4 @@
+CONSOLE MESSAGE: line 98: SyntaxError: No identifiers allowed directly after numeric literal
+
+FAIL Indexed DB and Structured Serializing/Deserializing SyntaxError: No identifiers allowed directly after numeric literal
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.js
new file mode 100644 (file)
index 0000000..8078aaf
--- /dev/null
@@ -0,0 +1,320 @@
+// META: script=support-promises.js
+// META: title=Indexed DB and Structured Serializing/Deserializing
+// META: timeout=long
+
+// Tests Indexed DB coverage of HTML's Safe "passing of structured data"
+// https://html.spec.whatwg.org/multipage/structured-data.html
+
+function describe(value) {
+  let type, str;
+  if (typeof value === 'object' && value) {
+    type = value.__proto__.constructor.name;
+    // Handle Number(-0), etc.
+    str = Object.is(value.valueOf(), -0) ? '-0' : String(value);
+  } else {
+    type = typeof value;
+    // Handle primitive -0.
+    str = Object.is(value, -0) ? '-0' : String(value);
+  }
+  return `${type}: ${str}`;
+}
+
+function cloneTest(value, verifyFunc) {
+  promise_test(async t => {
+    const db = await createDatabase(t, db => {
+      const store = db.createObjectStore('store');
+      // This index is not used, but evaluating key path on each put()
+      // call will exercise (de)serialization.
+      store.createIndex('index', 'dummyKeyPath');
+    });
+    t.add_cleanup(() => {
+      if (db) {
+        db.close();
+        indexedDB.deleteDatabase(db.name);
+      }
+    });
+    const tx = db.transaction('store', 'readwrite');
+    const store = tx.objectStore('store');
+    await promiseForRequest(t, store.put(value, 'key'));
+    const result = await promiseForRequest(t, store.get('key'));
+    await verifyFunc(value, result);
+    await promiseForTransaction(t, tx);
+  }, describe(value));
+}
+
+// Specialization of cloneTest() for objects, with common asserts.
+function cloneObjectTest(value, verifyFunc) {
+  cloneTest(value, async (orig, clone) => {
+    assert_not_equals(orig, clone);
+    assert_equals(typeof clone, 'object');
+    assert_equals(orig.__proto__, clone.__proto__);
+    await verifyFunc(orig, clone);
+  });
+}
+
+function cloneFailureTest(value) {
+  promise_test(async t => {
+    const db = await createDatabase(t, db => {
+      db.createObjectStore('store');
+    });
+    t.add_cleanup(() => {
+      if (db) {
+        db.close();
+        indexedDB.deleteDatabase(db.name);
+      }
+    });
+    const tx = db.transaction('store', 'readwrite');
+    const store = tx.objectStore('store');
+    assert_throws('DataCloneError', () => store.put(value, 'key'));
+  }, 'Not serializable: ' + describe(value));
+}
+
+//
+// ECMAScript types
+//
+
+// Primitive values: Undefined, Null, Boolean, Number, BigInt, String
+const booleans = [false, true];
+const numbers = [
+  NaN,
+  -Infinity,
+  -Number.MAX_VALUE,
+  -0xffffffff,
+  -0x80000000,
+  -0x7fffffff,
+  -1,
+  -Number.MIN_VALUE,
+  -0,
+  0,
+  1,
+  Number.MIN_VALUE,
+  0x7fffffff,
+  0x80000000,
+  0xffffffff,
+  Number.MAX_VALUE,
+  Infinity,
+];
+const bigints = [
+  -12345678901234567890n,
+  -1n,
+  0n,
+  1n,
+  12345678901234567890n,
+];
+const strings = [
+  '',
+  'this is a sample string',
+  'null(\0)',
+];
+
+[undefined, null].concat(booleans, numbers, bigints, strings)
+  .forEach(value => cloneTest(value, (orig, clone) => {
+    assert_equals(orig, clone);
+  }));
+
+// "Primitive" Objects (Boolean, Number, BigInt, String)
+[].concat(booleans, numbers, strings)
+  .forEach(value => cloneObjectTest(Object(value), (orig, clone) => {
+    assert_equals(orig.valueOf(), clone.valueOf());
+  }));
+
+// Dates
+[
+  new Date(-1e13),
+  new Date(-1e12),
+  new Date(-1e9),
+  new Date(-1e6),
+  new Date(-1e3),
+  new Date(0),
+  new Date(1e3),
+  new Date(1e6),
+  new Date(1e9),
+  new Date(1e12),
+  new Date(1e13)
+].forEach(value => cloneTest(value, (orig, clone) => {
+    assert_not_equals(orig, clone);
+    assert_equals(typeof clone, 'object');
+    assert_equals(orig.__proto__, clone.__proto__);
+    assert_equals(orig.valueOf(), clone.valueOf());
+  }));
+
+// Regular Expressions
+[
+  new RegExp(),
+  /abc/,
+  /abc/g,
+  /abc/i,
+  /abc/gi,
+  /abc/m,
+  /abc/mg,
+  /abc/mi,
+  /abc/mgi,
+  /abc/gimsuy,
+].forEach(value => cloneObjectTest(value, (orig, clone) => {
+  assert_equals(orig.toString(), clone.toString());
+}));
+
+// ArrayBuffer
+cloneObjectTest(new Uint8Array([0, 1, 254, 255]).buffer, (orig, clone) => {
+  assert_array_equals(new Uint8Array(orig), new Uint8Array(clone));
+});
+
+// TODO SharedArrayBuffer
+
+// Array Buffer Views
+[
+  new Uint8Array([]),
+  new Uint8Array([0, 1, 254, 255]),
+  new Uint16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF]),
+  new Uint32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF]),
+  new Int8Array([0, 1, 254, 255]),
+  new Int16Array([0x0000, 0x0001, 0xFFFE, 0xFFFF]),
+  new Int32Array([0x00000000, 0x00000001, 0xFFFFFFFE, 0xFFFFFFFF]),
+  new Uint8ClampedArray([0, 1, 254, 255]),
+  new Float32Array([-Infinity, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, Infinity, NaN]),
+  new Float64Array([-Infinity, -Number.MAX_VALUE, -Number.MIN_VALUE, 0,
+                    Number.MIN_VALUE, Number.MAX_VALUE, Infinity, NaN])
+].forEach(value => cloneObjectTest(value, (orig, clone) => {
+  assert_array_equals(orig, clone);
+}));
+
+// Map
+cloneObjectTest(new Map([[1,2],[3,4]]), (orig, clone) => {
+  assert_array_equals([...orig.keys()], [...clone.keys()]);
+  assert_array_equals([...orig.values()], [...clone.values()]);
+});
+
+// Set
+cloneObjectTest(new Set([1,2,3,4]), (orig, clone) => {
+  assert_array_equals([...orig.values()], [...clone.values()]);
+});
+
+// Error
+[
+  new Error(),
+  new Error('abc', 'def'),
+  new EvalError(),
+  new EvalError('ghi', 'jkl'),
+  new RangeError(),
+  new RangeError('ghi', 'jkl'),
+  new ReferenceError(),
+  new ReferenceError('ghi', 'jkl'),
+  new SyntaxError(),
+  new SyntaxError('ghi', 'jkl'),
+  new TypeError(),
+  new TypeError('ghi', 'jkl'),
+  new URIError(),
+  new URIError('ghi', 'jkl'),
+].forEach(value => cloneObjectTest(value, (orig, clone) => {
+  assert_equals(orig.name, clone.name);
+  assert_equals(orig.message, clone.message);
+}));
+
+// Arrays
+[
+  [],
+  [1,2,3],
+  Object.assign(
+    ['foo', 'bar'],
+    {10: true, 11: false, 20: 123, 21: 456, 30: null}),
+  Object.assign(
+    ['foo', 'bar'],
+    {a: true, b: false, foo: 123, bar: 456, '': null}),
+].forEach(value => cloneObjectTest(value, (orig, clone) => {
+  assert_array_equals(orig, clone);
+  assert_array_equals(Object.keys(orig), Object.keys(clone));
+  Object.keys(orig).forEach(key => {
+    assert_equals(orig[key], clone[key], `Property ${key}`);
+  });
+}));
+
+// Objects
+cloneObjectTest({foo: true, bar: false}, (orig, clone) => {
+  assert_array_equals(Object.keys(orig), Object.keys(clone));
+  Object.keys(orig).forEach(key => {
+    assert_equals(orig[key], clone[key], `Property ${key}`);
+  });
+});
+
+//
+// [Serializable] Platform objects
+//
+
+// TODO: Test these additional interfaces:
+// * DOMQuad
+// * DOMException
+// * DetectedText, DetectedFace, DetectedBarcode
+// * RTCCertificate
+
+// Geometry types
+[
+  new DOMMatrix(),
+  new DOMMatrixReadOnly(),
+  new DOMPoint(),
+  new DOMPointReadOnly(),
+  new DOMRect,
+  new DOMRectReadOnly(),
+].forEach(value => cloneObjectTest(value, (orig, clone) => {
+  Object.keys(orig.__proto__).forEach(key => {
+    assert_equals(orig[key], clone[key], `Property ${key}`);
+  });
+}));
+
+// ImageData
+const image_data = new ImageData(8, 8);
+for (let i = 0; i < 256; ++i) {
+  image_data.data[i] = i;
+}
+cloneObjectTest(image_data, (orig, clone) => {
+  assert_equals(orig.width, clone.width);
+  assert_equals(orig.height, clone.height);
+  assert_array_equals(orig.data, clone.data);
+});
+
+// Blob
+cloneObjectTest(
+  new Blob(['This is a test.'], {type: 'a/b'}),
+  async (orig, clone) => {
+    assert_equals(orig.size, clone.size);
+    assert_equals(orig.type, clone.type);
+    assert_equals(await orig.text(), await clone.text());
+  });
+
+// File
+cloneObjectTest(
+  new File(['This is a test.'], 'foo.txt', {type: 'c/d'}),
+  async (orig, clone) => {
+    assert_equals(orig.size, clone.size);
+    assert_equals(orig.type, clone.type);
+    assert_equals(orig.name, clone.name);
+    assert_equals(orig.lastModified, clone.lastModified);
+    assert_equals(String(orig.lastModifiedDate),
+                  String(clone.lastModifiedDate));
+    assert_equals(await orig.text(), await clone.text());
+  });
+
+
+// FileList - exposed in Workers, but not constructable.
+if ('document' in self) {
+  // TODO: Test with populated list.
+  cloneObjectTest(
+    Object.assign(document.createElement('input'),
+                  {type: 'file', multiple: true}).files,
+    async (orig, clone) => {
+      assert_equals(orig.length, clone.length);
+    });
+}
+
+//
+// Non-serializable types
+//
+[
+  // ECMAScript types
+  function() {},
+  Symbol('desc'),
+
+  // Non-[Serializable] platform objects
+  self,
+  new Event(''),
+  new MessageChannel()
+].forEach(cloneFailureTest);
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..23c40b1
--- /dev/null
@@ -0,0 +1,4 @@
+CONSOLE MESSAGE: line 98: SyntaxError: No identifiers allowed directly after numeric literal
+
+FAIL Indexed DB and Structured Serializing/Deserializing SyntaxError: No identifiers allowed directly after numeric literal
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
index 21e2163..8195be3 100644 (file)
@@ -5,11 +5,39 @@ function databaseName(testCase) {
   return 'db' + self.location.pathname + '-' + testCase.name;
 }
 
-// Creates an EventWatcher covering all the events that can be issued by
-// IndexedDB requests and transactions.
+// EventWatcher covering all the events defined on IndexedDB requests.
+//
+// The events cover IDBRequest and IDBOpenDBRequest.
 function requestWatcher(testCase, request) {
   return new EventWatcher(testCase, request,
-      ['abort', 'blocked', 'complete', 'error', 'success', 'upgradeneeded']);
+                          ['blocked', 'error', 'success', 'upgradeneeded']);
+}
+
+// EventWatcher covering all the events defined on IndexedDB transactions.
+//
+// The events cover IDBTransaction.
+function transactionWatcher(testCase, request) {
+  return new EventWatcher(testCase, request, ['abort', 'complete', 'error']);
+}
+
+// Promise that resolves with an IDBRequest's result.
+//
+// The promise only resolves if IDBRequest receives the "success" event. Any
+// other event causes the promise to reject with an error. This is correct in
+// most cases, but insufficient for indexedDB.open(), which issues
+// "upgradeneded" events under normal operation.
+function promiseForRequest(testCase, request) {
+  const eventWatcher = requestWatcher(testCase, request);
+  return eventWatcher.wait_for('success').then(event => event.target.result);
+}
+
+// Promise that resolves when an IDBTransaction completes.
+//
+// The promise resolves with undefined if IDBTransaction receives the "complete"
+// event, and rejects with an error for any other event.
+function promiseForTransaction(testCase, request) {
+  const eventWatcher = transactionWatcher(testCase, request);
+  return eventWatcher.wait_for('complete').then(() => {});
 }
 
 // Migrates an IndexedDB database whose name is unique for the test case.
@@ -64,7 +92,7 @@ function migrateNamedDatabase(
         requestEventPromise = new Promise((resolve, reject) => {
           request.onerror = event => {
             event.preventDefault();
-            resolve(event);
+            resolve(event.target.error);
           };
           request.onsuccess = () => reject(new Error(
               'indexedDB.open should not succeed for an aborted ' +
@@ -79,8 +107,7 @@ function migrateNamedDatabase(
       if (!shouldBeAborted) {
         request.onerror = null;
         request.onsuccess = null;
-        requestEventPromise =
-            requestWatcher(testCase, request).wait_for('success');
+        requestEventPromise = promiseForRequest(testCase, request);
       }
 
       // requestEventPromise needs to be the last promise in the chain, because
@@ -95,12 +122,10 @@ function migrateNamedDatabase(
           'indexedDB.open should not succeed without creating a ' +
           'versionchange transaction'));
     };
-  }).then(event => {
-    const database = event.target.result;
-    if (database) {
-      testCase.add_cleanup(() => { database.close(); });
-    }
-    return database || event.target.error;
+  }).then(databaseOrError => {
+    if (databaseOrError instanceof IDBDatabase)
+      testCase.add_cleanup(() => { databaseOrError.close(); });
+    return databaseOrError;
   });
 }
 
@@ -126,9 +151,7 @@ function createDatabase(testCase, setupCallback) {
 // close the database.
 function createNamedDatabase(testCase, databaseName, setupCallback) {
   const request = indexedDB.deleteDatabase(databaseName);
-  const eventWatcher = requestWatcher(testCase, request);
-
-  return eventWatcher.wait_for('success').then(event => {
+  return promiseForRequest(testCase, request).then(() => {
     testCase.add_cleanup(() => { indexedDB.deleteDatabase(databaseName); });
     return migrateNamedDatabase(testCase, databaseName, 1, setupCallback)
   });
@@ -152,9 +175,7 @@ function openDatabase(testCase, version) {
 // close the database.
 function openNamedDatabase(testCase, databaseName, version) {
   const request = indexedDB.open(databaseName, version);
-  const eventWatcher = requestWatcher(testCase, request);
-  return eventWatcher.wait_for('success').then(() => {
-    const database = request.result;
+  return promiseForRequest(testCase, request).then(database => {
     testCase.add_cleanup(() => { database.close(); });
     return database;
   });
@@ -215,9 +236,7 @@ function checkStoreIndexes (testCase, store, errorMessage) {
 function checkStoreGenerator(testCase, store, expectedKey, errorMessage) {
   const request = store.put(
       { title: 'Bedrock Nights ' + expectedKey, author: 'Barney' });
-  const eventWatcher = requestWatcher(testCase, request);
-  return eventWatcher.wait_for('success').then(() => {
-    const result = request.result;
+  return promiseForRequest(testCase, request).then(result => {
     assert_equals(result, expectedKey, errorMessage);
   });
 }
@@ -230,9 +249,7 @@ function checkStoreGenerator(testCase, store, expectedKey, errorMessage) {
 // is using it incorrectly.
 function checkStoreContents(testCase, store, errorMessage) {
   const request = store.get(123456);
-  const eventWatcher = requestWatcher(testCase, request);
-  return eventWatcher.wait_for('success').then(() => {
-    const result = request.result;
+  return promiseForRequest(testCase, request).then(result => {
     assert_equals(result.isbn, BOOKS_RECORD_DATA[0].isbn, errorMessage);
     assert_equals(result.author, BOOKS_RECORD_DATA[0].author, errorMessage);
     assert_equals(result.title, BOOKS_RECORD_DATA[0].title, errorMessage);
@@ -247,9 +264,7 @@ function checkStoreContents(testCase, store, errorMessage) {
 // is using it incorrectly.
 function checkAuthorIndexContents(testCase, index, errorMessage) {
   const request = index.get(BOOKS_RECORD_DATA[2].author);
-  const eventWatcher = requestWatcher(testCase, request);
-  return eventWatcher.wait_for('success').then(() => {
-    const result = request.result;
+  return promiseForRequest(testCase, request).then(result => {
     assert_equals(result.isbn, BOOKS_RECORD_DATA[2].isbn, errorMessage);
     assert_equals(result.title, BOOKS_RECORD_DATA[2].title, errorMessage);
   });
@@ -263,9 +278,7 @@ function checkAuthorIndexContents(testCase, index, errorMessage) {
 // is using it incorrectly.
 function checkTitleIndexContents(testCase, index, errorMessage) {
   const request = index.get(BOOKS_RECORD_DATA[2].title);
-  const eventWatcher = requestWatcher(testCase, request);
-  return eventWatcher.wait_for('success').then(() => {
-    const result = request.result;
+  return promiseForRequest(testCase, request).then(result => {
     assert_equals(result.isbn, BOOKS_RECORD_DATA[2].isbn, errorMessage);
     assert_equals(result.author, BOOKS_RECORD_DATA[2].author, errorMessage);
   });
@@ -290,3 +303,41 @@ function largeValue(size, seed) {
 
   return buffer;
 }
+
+async function deleteAllDatabases(testCase) {
+  const dbs_to_delete = await indexedDB.databases();
+  for( const db_info of dbs_to_delete) {
+    let request = indexedDB.deleteDatabase(db_info.name);
+    let eventWatcher = requestWatcher(testCase, request);
+    await eventWatcher.wait_for('success');
+  }
+}
+
+// Keeps the passed transaction alive indefinitely (by making requests
+// against the named store). Returns a function that asserts that the
+// transaction has not already completed and then ends the request loop so that
+// the transaction may autocommit and complete.
+function keepAlive(testCase, transaction, storeName) {
+  let completed = false;
+  transaction.addEventListener('complete', () => { completed = true; });
+
+  let keepSpinning = true;
+
+  function spin() {
+    if (!keepSpinning)
+      return;
+    transaction.objectStore(storeName).get(0).onsuccess = spin;
+  }
+  spin();
+
+  return testCase.step_func(() => {
+    assert_false(completed, 'Transaction completed while kept alive');
+    keepSpinning = false;
+  });
+}
+
+// Return a promise that resolves after a setTimeout finishes to break up the
+// scope of a function's execution.
+function timeoutPromise(ms) {
+  return new Promise(resolve => { setTimeout(resolve, ms); });
+}
index 5edbdac..d3b2bb7 100644 (file)
@@ -1,6 +1,3 @@
-var databaseName = "database";
-var databaseVersion = 1;
-
 /* Delete created databases
  *
  * Go through each finished test, see if it has an associated database. Close
@@ -170,18 +167,18 @@ function is_transaction_active(tx, store_name) {
   }
 }
 
-// Keep the passed transaction alive indefinitely (by making requests
-// against the named store). Returns a function to to let the
-// transaction finish, and asserts that the transaction is not yet
-// finished.
+// Keeps the passed transaction alive indefinitely (by making requests
+// against the named store). Returns a function that asserts that the
+// transaction has not already completed and then ends the request loop so that
+// the transaction may autocommit and complete.
 function keep_alive(tx, store_name) {
   let completed = false;
   tx.addEventListener('complete', () => { completed = true; });
 
-  let pin = true;
+  let keepSpinning = true;
 
   function spin() {
-    if (!pin)
+    if (!keepSpinning)
       return;
     tx.objectStore(store_name).get(0).onsuccess = spin;
   }
@@ -189,6 +186,6 @@ function keep_alive(tx, store_name) {
 
   return () => {
     assert_false(completed, 'Transaction completed while kept alive');
-    pin = false;
+    keepSpinning = false;
   };
 }
index b0c91ec..79ba82f 100644 (file)
@@ -11,7 +11,7 @@
 
     var db, db_got_versionchange, db2,
         events = [],
-        t = async_test(document.title, {timeout: 10000});
+        t = async_test();
 
     t.step(function() {
         var openrq = indexedDB.open('db', 3);
index c646286..2883644 100644 (file)
@@ -11,7 +11,7 @@
 
     var db, db_got_versionchange, db2,
         events = [],
-        t = async_test(document.title, {timeout: 10000});
+        t = async_test();
 
     t.step(function() {
         var openrq = indexedDB.open('db', 3);
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any-expected.txt
new file mode 100644 (file)
index 0000000..8693a62
--- /dev/null
@@ -0,0 +1,7 @@
+
+PASS Committed data can be read back out: case 0 
+PASS Committed data can be read back out: case 1 
+PASS Committed data can be read back out: case 2 
+PASS Committed data can be read back out: case 3 
+PASS Committed data can be read back out: case 4 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.js
new file mode 100644 (file)
index 0000000..2ba96ec
--- /dev/null
@@ -0,0 +1,40 @@
+// META: script=support-promises.js
+// META: timeout=long
+
+/**
+ * This file contains the webplatform smoke tests for the optional
+ * relaxedDurability parameter of the IndexedDB transaction API.
+ *
+ * @author enne@chromium.org
+ */
+
+// Smoke test optional parameter on IndexedDB.transaction.
+let cases = [
+  undefined,
+  {},
+  {durability: "default"},
+  {durability: "relaxed"},
+  {durability: "strict"},
+];
+
+for (let i = 0; i < cases.length; ++i) {
+  promise_test(async testCase => {
+    const db = await createDatabase(testCase, db => {
+      createBooksStore(testCase, db);
+    });
+    const txn = db.transaction(['books'], 'readwrite', cases[i]);
+    const objectStore = txn.objectStore('books');
+    objectStore.put({isbn: 'one', title: 'title1'});
+    await promiseForTransaction(testCase, txn);
+
+    const txn2 = db.transaction(['books'], 'readonly');
+    const objectStore2 = txn2.objectStore('books');
+    const getTitle1 = objectStore2.get('one');
+    await promiseForTransaction(testCase, txn2);
+    assert_array_equals(
+        [getTitle1.result.title],
+        ['title1'],
+        'The title should match that which was put.');
+    db.close();
+  }, 'Committed data can be read back out: case ' + i);
+}
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker-expected.txt
new file mode 100644 (file)
index 0000000..8693a62
--- /dev/null
@@ -0,0 +1,7 @@
+
+PASS Committed data can be read back out: case 0 
+PASS Committed data can be read back out: case 1 
+PASS Committed data can be read back out: case 2 
+PASS Committed data can be read back out: case 3 
+PASS Committed data can be read back out: case 4 
+
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.worker.html
new file mode 100644 (file)
index 0000000..2382913
--- /dev/null
@@ -0,0 +1 @@
+<!-- This file is required for WebKit test infrastructure to run the templated test -->
\ No newline at end of file
index b5706fe..9f28e81 100644 (file)
@@ -8,7 +8,7 @@
 
 <script>
 
-var db, t = async_test(document.title, {timeout: 10000}),
+var db, t = async_test(),
     keys = { txn: [], txn2: [] },
     open_rq = createdb(t)
 
index f4b5ec0..bffa930 100644 (file)
@@ -9,7 +9,7 @@
 <script>
     var events = [];
 
-    var open_rq = createdb(async_test(document.title, {timeout: 10000}));
+    var open_rq = createdb(async_test());
     open_rq.onupgradeneeded = function(e) {
         var db = e.target.result;
         var txn = e.target.transaction;
index 836ba1d..787cdb0 100644 (file)
@@ -1,7 +1,7 @@
 The tests in this directory were imported from the W3C repository.
 Do NOT modify these tests directly in WebKit.
 Instead, create a pull request on the WPT github:
-       https://github.com/w3c/web-platform-tests
+       https://github.com/web-platform-tests/wpt
 
 Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport
 
@@ -14,11 +14,13 @@ Property values requiring vendor prefixes:
 None
 ------------------------------------------------------------------------
 List of files:
-/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/OWNERS
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/META.yml
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/README.md
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/abort-in-initial-upgradeneeded.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bigint_value.htm
-/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-key.html
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-keys-bypass-setters.html
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-chain.html
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/bindings-inject-values-bypass-setters.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/clone-before-keypath-eval.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/close-in-upgradeneeded.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/cursor-overloads.htm
@@ -28,10 +30,13 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/fire-success-event-exception.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/fire-upgradeneeded-event-exception.html
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/get-databases.any.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/globalscope-indexedDB-SameObject.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/historical.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-binary-key-detached.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-binary-key-roundtrip.htm
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit-throw.any.js
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb-explicit-commit.any.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb_binary_key_conversion.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idb_webworkers.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-advance-continue-async.htm
@@ -53,6 +58,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-key.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-primarykey.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request-source.html
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-request.any.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-reused.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-source.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbcursor-update-exception-order.htm
@@ -143,12 +149,14 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbdatabase_transaction3.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbdatabase_transaction4.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbdatabase_transaction5.htm
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-databases-opaque-origin.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-deleteDatabase-opaque-origin.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-deleteDatabase-request-success.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-open-error-properties.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-open-opaque-origin.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-open-request-error.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-open-request-success.html
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory-origin-isolation.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_cmp.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_cmp2.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbfactory_cmp3.htm
@@ -203,6 +211,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_getKey7.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_getKey8.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_indexNames.htm
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_keyPath.any.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_openCursor.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_openCursor2.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex_openCursor3.htm
@@ -285,6 +294,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getAllKeys.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_getKey.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_index.htm
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_keyPath.any.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_openCursor.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_openCursor_invalid.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_openKeyCursor.htm
@@ -316,8 +326,8 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbtransaction_objectStoreNames.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbversionchangeevent.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbworker.js
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idlharness.any.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/index_sort_order.htm
-/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interfaces.any.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interleaved-cursors-common.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interleaved-cursors-large.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/interleaved-cursors-small.html
@@ -349,6 +359,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/request-event-ordering.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/request_bubble-and-capture.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/string-list-ordering.htm
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/structured-clone.any.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/support-promises.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/support.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-abort-generator-revert.html
@@ -361,6 +372,7 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-lifetime-blocked.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-lifetime-empty.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-lifetime.htm
+/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-relaxed-durability.tentative.any.js
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction-requestqueue.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/transaction_bubble-and-capture.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/upgrade-transaction-deactivation-timing.html
@@ -369,5 +381,4 @@ List of files:
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/upgrade-transaction-lifecycle-user-aborted.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/value.htm
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/value_recursive.htm
-/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/wasm-module-value.html
 /LayoutTests/imported/w3c/web-platform-tests/IndexedDB/writer-starvation.htm
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/wasm-module-value-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/wasm-module-value-expected.txt
deleted file mode 100644 (file)
index 1638e01..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-FAIL WebAssembly module as an IndexedDB value The object can not be cloned.
-FAIL WebAssembly module in a JavaScript object IndexedDB value The object can not be cloned.
-FAIL WebAssembly module in an IndexedDB value with an inline key The object can not be cloned.
-
diff --git a/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/wasm-module-value.html b/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/wasm-module-value.html
deleted file mode 100644 (file)
index 9fcfd78..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-<!doctype html>
-<meta charset="utf8">
-<meta name="timeout" content="long">
-<title>IndexedDB: WebAssembly module values</title>
-<link rel="help" href="https://w3c.github.io/IndexedDB/">
-<link rel="help" href="https://webassembly.github.io/spec/">
-<link rel="author" href="pwnall@chromium.org" title="Victor Costan">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="support-promises.js"></script>
-<script>
-'use strict';
-
-// Binary representation for a WASM module that exports an "inc" function.
-//
-// This test covers storing WASM modules in IndexedDB. Its failure should only
-// be debugged if WASM specification tests pass. To this end, the test does not
-// use the WASM module builder helpers, trading off WASM debuggability in return
-// for having the WASM wire bytes listed explicitly in the test body. Having the
-// wire bytes spelled out can be helpful when debugging IndexedDB failures.
-let wasm_module_bytes = new Uint8Array([
-  0x00, 0x61, 0x73, 0x6d,  // Magic.
-  0x01, 0x00, 0x00, 0x00,  // Version.
-  0x01, 0x06, 0x01,              // Type section - 6 bytes, 1 entry
-  0x60, 0x01, 0x7f, 0x01, 0x7f,  // Type 0. Function: (i32) -> (i32)
-  0x03, 0x02, 0x01,   // Function section - 2 bytes, 1 entry
-  0x00,               // Function 0: Type 0
-  0x07, 0x07, 0x01,              // Export section - 7 bytes, 1 entry
-  0x03, 0x69, 0x6e, 0x63,        // Export 1. { name: "inc"
-  0x00, 0x00,                    //             desc: function 0 }
-  0x0a, 0x09, 0x01,  // Code section: 9 bytes, 1 entry
-  0x07, 0x00,        // Function 1: 7 code bytes, 0 locals
-  0x20, 0x00,        //   getlocal 0
-  0x41, 0x01,        //   i32.const 1
-  0x6a,              //   i32.add
-  0x0b,              //   end
-]);
-
-promise_test(async testCase => {
-  const wasm_module = await WebAssembly.compile(wasm_module_bytes.buffer);
-
-  const database = await createDatabase(testCase, (database, transaction) => {
-    const store = database.createObjectStore('store');
-    store.put(wasm_module, 'key1');
-  });
-
-  const result = await new Promise((resolve, reject) => {
-    const transaction = database.transaction(['store'], 'readonly');
-    const store = transaction.objectStore('store');
-    const request = store.get('key1');
-    request.onsuccess = (event) => resolve(event.target.result);
-    request.onerror = (event) => reject(event.target.error);
-  });
-
-  database.close();
-
-  const instance = await WebAssembly.instantiate(result);
-  assert_equals(
-      instance.exports['inc'](42), 43, 'inc should increment its argument');
-}, 'WebAssembly module as an IndexedDB value');
-
-promise_test(async testCase => {
-  const wasm_module = await WebAssembly.compile(wasm_module_bytes.buffer);
-
-  const database = await createDatabase(testCase, (database, transaction) => {
-    const store = database.createObjectStore('store');
-    store.put({ module: wasm_module }, 'key1');
-  });
-
-  const result = await new Promise((resolve, reject) => {
-    const transaction = database.transaction(['store'], 'readonly');
-    const store = transaction.objectStore('store');
-    const request = store.get('key1');
-    request.onsuccess = (event) => resolve(event.target.result);
-    request.onerror = (event) => reject(event.target.error);
-  });
-
-  database.close();
-
-  const instance = await WebAssembly.instantiate(result.module);
-  assert_equals(
-      instance.exports['inc'](42), 43, 'inc should increment its argument');
-}, 'WebAssembly module in a JavaScript object IndexedDB value');
-
-promise_test(async testCase => {
-  const wasm_module = await WebAssembly.compile(wasm_module_bytes.buffer);
-
-  const database = await createDatabase(testCase, (database, transaction) => {
-    const store = database.createObjectStore('store', { keyPath: 'key' });
-    store.put({ key: 'key1', module: wasm_module });
-  });
-
-  const result = await new Promise((resolve, reject) => {
-    const transaction = database.transaction(['store'], 'readonly');
-    const store = transaction.objectStore('store');
-    const request = store.get('key1');
-    request.onsuccess = (event) => resolve(event.target.result);
-    request.onerror = (event) => reject(event.target.error);
-  });
-
-  database.close();
-
-  assert_equals('key1', result.key);
-  const instance = await WebAssembly.instantiate(result.module);
-  assert_equals(
-      instance.exports['inc'](42), 43, 'inc should increment its argument');
-}, 'WebAssembly module in an IndexedDB value with an inline key');
-
-</script>
index 4123083..cdc7b1e 100644 (file)
@@ -12,7 +12,7 @@
     var write_request_count = 0, write_success_count = 0;
     var RQ_COUNT = 25;
 
-    var open_rq = createdb(async_test(undefined, {timeout: 20000}));
+    var open_rq = createdb(async_test(undefined));
     open_rq.onupgradeneeded = function(e) {
         db = e.target.result;
         db.createObjectStore("s")
index 31bfa98..b156d51 100644 (file)
@@ -3047,8 +3047,6 @@ webkit.org/b/183219 editing/pasteboard/data-transfer-get-data-on-pasting-html-us
 
 webkit.org/b/173928 storage/websql/database-lock-after-reload.html [ Pass Failure ]
 
-[ Debug ] imported/w3c/web-platform-tests/IndexedDB/interfaces.any.html [ Slow ]
-[ Debug ] imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker.html [ Slow ]
 [ Debug ] imported/w3c/web-platform-tests/hr-time/idlharness.html [ Slow ]
 
 webkit.org/b/183388 fast/scrolling/scroll-to-focused-element-asynchronously.html [ Pass Failure ]
index b1fe5f0..1374f0f 100644 (file)
@@ -275,6 +275,10 @@ imported/w3c/web-platform-tests/service-workers [ Skip ]
 imported/w3c/web-platform-tests/streams/readable-byte-streams/detached-buffers.serviceworker.https.html [ Skip ]
 imported/w3c/web-platform-tests/infrastructure/server/context.any.serviceworker.html [ Skip ]
 imported/w3c/web-platform-tests/infrastructure/server/secure-context.https.any.serviceworker.html [ Skip ]
+imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker.html [ Skip ]
+imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes.any.serviceworker.html [ Skip ]
+imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store-cursors.any.serviceworker.html [ Skip ]
+imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-store.any.serviceworker.html [ Skip ]
 
 # Quota check missing in WK1
 http/tests/IndexedDB/storage-limit.https.html [ Skip ]
@@ -543,8 +547,6 @@ webkit.org/b/170877 [ Debug ] webgl/1.0.2/conformance/glsl/misc/shader-with-rese
 
 webkit.org/b/180554 imported/w3c/web-platform-tests/xhr/event-upload-progress-crossorigin.htm [ Skip ]
 
-webkit.org/b/187372 imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker.html [ Pass Timeout ]
-
 # This was a WK2-only fix.
 http/tests/css/filters-on-iframes.html [ Skip ]
 
index 845c7ca..22951d9 100644 (file)
@@ -1321,8 +1321,6 @@ webkit.org/b/168087 media/video-zoom.html [ Pass Failure ]
 webkit.org/b/168094 imported/w3c/web-platform-tests/media-source/SourceBuffer-abort.html [ Pass Failure ]
 webkit.org/b/167975 imported/w3c/web-platform-tests/media-source/SourceBuffer-abort-removed.html [ Pass Failure ]
 
-[ Debug ] imported/w3c/web-platform-tests/IndexedDB/interfaces.any.html [ Slow ]
-[ Debug ] imported/w3c/web-platform-tests/IndexedDB/interfaces.any.worker.html [ Slow ]
 [ Debug ] imported/w3c/web-platform-tests/hr-time/idlharness.html [ Slow ]
 
 webkit.org/b/168503 editing/pasteboard/drag-drop-copy-content.html [ Failure ]
index c3193f6..52ebd65 100644 (file)
     "imported/w3c/web-platform-tests/IndexedDB/idbdatabase_createObjectStore8-parameters.htm": [
         "slow"
     ],
+    "imported/w3c/web-platform-tests/IndexedDB/idbindex-multientry-big.htm": [
+        "slow"
+    ],
     "imported/w3c/web-platform-tests/IndexedDB/idbindex-rename.html": [
         "slow"
     ],
     "imported/w3c/web-platform-tests/IndexedDB/idbobjectstore-rename-store.html": [
         "slow"
     ],
+    "imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex15-autoincrement.htm": [
+        "slow"
+    ],
     "imported/w3c/web-platform-tests/IndexedDB/idbobjectstore_createIndex3-usable-right-away.htm": [
         "slow"
     ],