Title: [89377] trunk
- Revision
- 89377
- Author
- commit-qu...@webkit.org
- Date
- 2011-06-21 13:57:35 -0700 (Tue, 21 Jun 2011)
Log Message
2011-06-21 Mark Pilgrim <pilg...@chromium.org>
Reviewed by Tony Chang.
IndexedDB: should throw TypeError when index .get() key argument is missing
https://bugs.webkit.org/show_bug.cgi?id=63079
* storage/indexeddb/index-get-key-argument-required-expected.txt: Added.
* storage/indexeddb/index-get-key-argument-required.html: Added.
2011-06-21 Mark Pilgrim <pilg...@chromium.org>
Reviewed by Tony Chang.
IndexedDB: should throw TypeError when index .get() key argument is missing
https://bugs.webkit.org/show_bug.cgi?id=63079
Test: storage/indexeddb/index-get-key-argument-required.html
* storage/IDBIndex.idl: remove LegacyDefaultOptionalArguments flag
so missing required arguments throw a TypeError as per WebIDL spec.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (89376 => 89377)
--- trunk/LayoutTests/ChangeLog 2011-06-21 20:54:39 UTC (rev 89376)
+++ trunk/LayoutTests/ChangeLog 2011-06-21 20:57:35 UTC (rev 89377)
@@ -2,6 +2,16 @@
Reviewed by Tony Chang.
+ IndexedDB: should throw TypeError when index .get() key argument is missing
+ https://bugs.webkit.org/show_bug.cgi?id=63079
+
+ * storage/indexeddb/index-get-key-argument-required-expected.txt: Added.
+ * storage/indexeddb/index-get-key-argument-required.html: Added.
+
+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
Added: trunk/LayoutTests/storage/indexeddb/index-get-key-argument-required-expected.txt (0 => 89377)
--- trunk/LayoutTests/storage/indexeddb/index-get-key-argument-required-expected.txt (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/index-get-key-argument-required-expected.txt 2011-06-21 20:57:35 UTC (rev 89377)
@@ -0,0 +1,25 @@
+Test IndexedDB index .get() required argument
+
+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.
+objectStore = db.createObjectStore('foo', { keyPath: 'id', autoIncrement: true });
+index = objectStore.createIndex('first', 'first');
+PASS index.get(); threw exception TypeError: Not enough arguments.
+PASS index.getKey(); threw exception TypeError: Not enough arguments.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/storage/indexeddb/index-get-key-argument-required.html (0 => 89377)
--- trunk/LayoutTests/storage/indexeddb/index-get-key-argument-required.html (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/index-get-key-argument-required.html 2011-06-21 20:57:35 UTC (rev 89377)
@@ -0,0 +1,62 @@
+<!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 index .get() required argument");
+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_ = createAndPopulateObjectStore;
+ request._onerror_ = unexpectedErrorCallback;
+}
+
+function createAndPopulateObjectStore()
+{
+ deleteAllObjectStores(db);
+
+ objectStore = evalAndLog("objectStore = db.createObjectStore('foo', { keyPath: 'id', autoIncrement: true });");
+ index = evalAndLog("index = objectStore.createIndex('first', 'first');");
+ shouldThrow("index.get();");
+ shouldThrow("index.getKey();");
+ done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (89376 => 89377)
--- trunk/Source/WebCore/ChangeLog 2011-06-21 20:54:39 UTC (rev 89376)
+++ trunk/Source/WebCore/ChangeLog 2011-06-21 20:57:35 UTC (rev 89377)
@@ -2,6 +2,18 @@
Reviewed by Tony Chang.
+ IndexedDB: should throw TypeError when index .get() key argument is missing
+ https://bugs.webkit.org/show_bug.cgi?id=63079
+
+ Test: storage/indexeddb/index-get-key-argument-required.html
+
+ * storage/IDBIndex.idl: remove LegacyDefaultOptionalArguments flag
+ so missing required arguments throw a TypeError as per WebIDL spec.
+
+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
Modified: trunk/Source/WebCore/storage/IDBIndex.idl (89376 => 89377)
--- trunk/Source/WebCore/storage/IDBIndex.idl 2011-06-21 20:54:39 UTC (rev 89376)
+++ trunk/Source/WebCore/storage/IDBIndex.idl 2011-06-21 20:57:35 UTC (rev 89377)
@@ -26,7 +26,6 @@
module storage {
interface [
- LegacyDefaultOptionalArguments,
Conditional=INDEXED_DATABASE
] IDBIndex {
readonly attribute DOMString name;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes