Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/IndexedDB/idbcursor_update_objectstore9.htm

Issue 2015623004: Import wpt@ed94c51f3dfaa5ff4c9c311add1a560408059c51 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/imported/wpt/IndexedDB/idbcursor_update_objectstore9.htm
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/IndexedDB/idbcursor_delete_index5.htm b/third_party/WebKit/LayoutTests/imported/wpt/IndexedDB/idbcursor_update_objectstore9.htm
similarity index 52%
copy from third_party/WebKit/LayoutTests/imported/wpt/IndexedDB/idbcursor_delete_index5.htm
copy to third_party/WebKit/LayoutTests/imported/wpt/IndexedDB/idbcursor_update_objectstore9.htm
index 4fc0e2967d62c370dcb64dc075da91dad5afb13a..329b8e34fa1c337a46f09f406e8af1d824419587 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/IndexedDB/idbcursor_delete_index5.htm
+++ b/third_party/WebKit/LayoutTests/imported/wpt/IndexedDB/idbcursor_update_objectstore9.htm
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<meta charset="utf-8">
-<title>IDBCursor.delete() - index - throw InvalidStateError when the cursor is being iterated</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-delete-IDBRequest">
+<title>IDBCursor.update() - object store - throw InvalidStateError when the cursor is being iterated</title>
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://www.w3.org/TR/IndexedDB/#widl-IDBCursor-update-IDBRequest-any-value">
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="support.js"></script>
@@ -10,26 +10,32 @@
<script>
var db,
t = async_test(),
- records = [{ pKey: "primaryKey_0", iKey: "indexKey_0" },
- { pKey: "primaryKey_1", iKey: "indexKey_1" }];
+ records = [{ pKey: "primaryKey_0", value: "value_0" },
+ { pKey: "primaryKey_1", value: "value_1" }];
var open_rq = createdb(t);
open_rq.onupgradeneeded = function (event) {
db = event.target.result;
+
var objStore = db.createObjectStore("store", {keyPath : "pKey"});
- objStore.createIndex("index", "iKey");
+
for (var i = 0; i < records.length; i++) {
objStore.add(records[i]);
}
+ }
+
+ open_rq.onsuccess = function(e) {
+ var cursor_rq = db.transaction("store", "readwrite")
+ .objectStore("store")
+ .openCursor();
- var rq = objStore.index("index").openCursor();
- rq.onsuccess = t.step_func(function(event) {
+ cursor_rq.onsuccess = t.step_func(function(event) {
var cursor = event.target.result;
- assert_true(cursor instanceof IDBCursor, "cursor exist");
+ assert_true(cursor instanceof IDBCursor, "cursor exists");
cursor.continue();
assert_throws("InvalidStateError", function() {
- cursor.delete();
+ cursor.update({ pKey: "primaryKey_0", value: "value_0_updated" });
});
t.done();

Powered by Google App Engine
This is Rietveld 408576698