Diff
Modified: trunk/LayoutTests/ChangeLog (89374 => 89375)
--- trunk/LayoutTests/ChangeLog 2011-06-21 20:30:04 UTC (rev 89374)
+++ trunk/LayoutTests/ChangeLog 2011-06-21 20:42:27 UTC (rev 89375)
@@ -1,3 +1,13 @@
+2011-06-21 Mark Pilgrim <pilg...@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ IndexedDB: cursor update() value argument is required
+ https://bugs.webkit.org/show_bug.cgi?id=63032
+
+ * storage/indexeddb/cursor-update-value-argument-required-expected.txt: Added.
+ * storage/indexeddb/cursor-update-value-argument-required.html: Added.
+
2011-06-21 Martin Robinson <mrobin...@igalia.com>
Reviewed by Dirk Schulze.
Added: trunk/LayoutTests/storage/indexeddb/cursor-update-value-argument-required-expected.txt (0 => 89375)
--- trunk/LayoutTests/storage/indexeddb/cursor-update-value-argument-required-expected.txt (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/cursor-update-value-argument-required-expected.txt 2011-06-21 20:42:27 UTC (rev 89375)
@@ -0,0 +1,38 @@
+Test IndexedDB cursor.update required arguments
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;
+PASS indexedDB == null is false
+IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException;
+PASS IDBDatabaseException == null is false
+IDBCursor = window.IDBCursor || window.webkitIDBCursor;
+PASS IDBCursor == null is false
+IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;
+PASS IDBKeyRange == null is false
+indexedDB.open(name, description)
+db = event.target.result
+request = db.setVersion('1')
+Deleted all object stores.
+db.createObjectStore('autoIncrement', { autoIncrement: true });
+request = objectStore.openCursor();
+keys = [1, -1, 0, 10, 2000, 'q', 'z', 'two', 'b', 'a'];
+keyIndex = 0;
+request = objectStore.add('foo', keys[i]);
+request = objectStore.add('foo', keys[i]);
+request = objectStore.add('foo', keys[i]);
+request = objectStore.add('foo', keys[i]);
+request = objectStore.add('foo', keys[i]);
+request = objectStore.add('foo', keys[i]);
+request = objectStore.add('foo', keys[i]);
+request = objectStore.add('foo', keys[i]);
+request = objectStore.add('foo', keys[i]);
+request = objectStore.add('foo', keys[i]);
+request = objectStore.openCursor();
+cursor = event.target.result;
+PASS cursor.update(); threw exception TypeError: Not enough arguments.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/storage/indexeddb/cursor-update-value-argument-required.html (0 => 89375)
--- trunk/LayoutTests/storage/indexeddb/cursor-update-value-argument-required.html (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/cursor-update-value-argument-required.html 2011-06-21 20:42:27 UTC (rev 89375)
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+<script src=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB cursor.update required arguments");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function test()
+{
+ indexedDB = evalAndLog("indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB;");
+ shouldBeFalse("indexedDB == null");
+ IDBDatabaseException = evalAndLog("IDBDatabaseException = window.IDBDatabaseException || window.webkitIDBDatabaseException;");
+ shouldBeFalse("IDBDatabaseException == null");
+ IDBCursor = evalAndLog("IDBCursor = window.IDBCursor || window.webkitIDBCursor;");
+ shouldBeFalse("IDBCursor == null");
+ IDBKeyRange = evalAndLog("IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;");
+ shouldBeFalse("IDBKeyRange == null");
+
+ name = window.location.pathname;
+ description = "My Test Database";
+ request = evalAndLog("indexedDB.open(name, description)");
+ request._onsuccess_ = openSuccess;
+ request._onerror_ = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ db = evalAndLog("db = event.target.result");
+
+ request = evalAndLog("request = db.setVersion('1')");
+ request._onsuccess_ = testGroup1;
+ request._onerror_ = unexpectedErrorCallback;
+}
+
+function testGroup1()
+{
+ deleteAllObjectStores(db);
+
+ objectStore = evalAndLog("db.createObjectStore('autoIncrement', { autoIncrement: true });");
+
+ request = evalAndLog("request = objectStore.openCursor();");
+ request._onerror_ = unexpectedErrorCallback;
+ request._onsuccess_ = function (event) {
+ testGroup2();
+ }
+}
+
+function testGroup2()
+{
+ keys = evalAndLog("keys = [1, -1, 0, 10, 2000, 'q', 'z', 'two', 'b', 'a'];");
+
+ keyIndex = evalAndLog("keyIndex = 0;");
+
+ for (i in keys) {
+ request = evalAndLog("request = objectStore.add('foo', keys[i]);");
+ request._onerror_ = unexpectedErrorCallback;
+ request._onsuccess_ = function(event) {
+ if (++keyIndex == keys.length) {
+ testGroup3();
+ }
+ };
+ }
+}
+
+function testGroup3()
+{
+ request = evalAndLog("request = objectStore.openCursor();");
+ request._onerror_ = unexpectedErrorCallback;
+ request._onsuccess_ = function (event) {
+ cursor = evalAndLog("cursor = event.target.result;");
+ if (cursor) {
+ shouldThrow("cursor.update();");
+ } else {
+ testFailed("cursor was null");
+ }
+ done();
+ }
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>
+
Modified: trunk/Source/WebCore/ChangeLog (89374 => 89375)
--- trunk/Source/WebCore/ChangeLog 2011-06-21 20:30:04 UTC (rev 89374)
+++ trunk/Source/WebCore/ChangeLog 2011-06-21 20:42:27 UTC (rev 89375)
@@ -1,3 +1,15 @@
+2011-06-21 Mark Pilgrim <pilg...@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ IndexedDB: cursor update() value argument is required
+ https://bugs.webkit.org/show_bug.cgi?id=63032
+
+ Test: storage/indexeddb/cursor-update-value-argument-required.html
+
+ * storage/IDBCursor.idl: remove LegacyDefaultOptionalArguments flag so
+ calling functions with missing required arguments will raise a TypeError
+
2011-06-21 Martin Robinson <mrobin...@igalia.com>
Reviewed by Dirk Schulze.
Modified: trunk/Source/WebCore/storage/IDBCursor.idl (89374 => 89375)
--- trunk/Source/WebCore/storage/IDBCursor.idl 2011-06-21 20:30:04 UTC (rev 89374)
+++ trunk/Source/WebCore/storage/IDBCursor.idl 2011-06-21 20:42:27 UTC (rev 89375)
@@ -27,7 +27,6 @@
interface [
Conditional=INDEXED_DATABASE,
- LegacyDefaultOptionalArguments,
] IDBCursor {
const unsigned short NEXT = 0;
const unsigned short NEXT_NO_DUPLICATE = 1;