| Index: LayoutTests/imported/web-platform-tests/IndexedDB/idbcursor_delete_objectstore4.htm
|
| diff --git a/LayoutTests/imported/web-platform-tests/IndexedDB/idbcursor_advance_objectstore4.htm b/LayoutTests/imported/web-platform-tests/IndexedDB/idbcursor_delete_objectstore4.htm
|
| similarity index 60%
|
| copy from LayoutTests/imported/web-platform-tests/IndexedDB/idbcursor_advance_objectstore4.htm
|
| copy to LayoutTests/imported/web-platform-tests/IndexedDB/idbcursor_delete_objectstore4.htm
|
| index dabf8e86973761a8eda70aadb964f56a2b9bcda9..b9775c8f16632a3c36aab26a19ba97dd7623479a 100644
|
| --- a/LayoutTests/imported/web-platform-tests/IndexedDB/idbcursor_advance_objectstore4.htm
|
| +++ b/LayoutTests/imported/web-platform-tests/IndexedDB/idbcursor_delete_objectstore4.htm
|
| @@ -1,13 +1,13 @@
|
| <!DOCTYPE html>
|
| <meta charset="utf-8">
|
| -<title>IDBCursor.advance() - object store - throw InvalidStateError</title>
|
| +<title>IDBCursor.delete() - object store - throw InvalidStateError caused by object store been deleted</title>
|
| <link rel="author" title="Intel" href="http://www.intel.com">
|
| -<link rel="help" href="https://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#widl-IDBCursor-advance-void-unsigned-long-count">
|
| <script src="../../../resources/testharness.js"></script>
|
| <script src="../../../resources/testharnessreport.js"></script>
|
| <script src="support.js"></script>
|
| <div id="log"></div>
|
| <script>
|
| +
|
| var db,
|
| t = async_test(),
|
| records = [{ pKey: "primaryKey_0"},
|
| @@ -20,22 +20,18 @@
|
| for (var i = 0; i < records.length; i++) {
|
| objStore.add(records[i]);
|
| }
|
| - }
|
| -
|
| - open_rq.onsuccess = function (event) {
|
| - var txn = db.transaction("store", "readwrite");
|
| - var rq = txn.objectStore("store").openCursor();
|
| + var rq = objStore.openCursor();
|
| rq.onsuccess = t.step_func(function(event) {
|
| var cursor = event.target.result;
|
| - assert_true(cursor instanceof IDBCursor);
|
| + assert_true(cursor instanceof IDBCursor, "cursor exist");
|
|
|
| - cursor.advance(1);
|
| + db.deleteObjectStore("store");
|
| assert_throws("InvalidStateError", function() {
|
| - cursor.advance(1);
|
| - }, "Calling advance() should throw DOMException when the cursor is currently being iterated.");
|
| + cursor.delete();
|
| + }, "If the cursor's source or effective object store has been deleted, the implementation MUST throw a DOMException of type InvalidStateError");
|
|
|
| t.done();
|
| });
|
| }
|
| -</script>
|
|
|
| +</script>
|
|
|