Title: [89383] trunk
- Revision
- 89383
- Author
- [email protected]
- Date
- 2011-06-21 14:20:15 -0700 (Tue, 21 Jun 2011)
Log Message
2011-06-21 Mark Pilgrim <[email protected]>
Reviewed by Adam Barth.
IndexedDB: IDBObjectStore methods should throw TypeError if required arguments are missing
https://bugs.webkit.org/show_bug.cgi?id=63087
* storage/indexeddb/objectStore-required-arguments-expected.txt: Added.
* storage/indexeddb/objectStore-required-arguments.html: Added.
2011-06-21 Mark Pilgrim <[email protected]>
Reviewed by Adam Barth.
IndexedDB: IDBObjectStore methods should throw TypeError if required arguments are missing
https://bugs.webkit.org/show_bug.cgi?id=63087
Test: storage/indexeddb/objectStore-required-arguments.html
* storage/IDBObjectStore.idl: Remove LegacyDefaultOptionalArguments flag
so missing required arguments will throw TypeError, as per WebIDL spec.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (89382 => 89383)
--- trunk/LayoutTests/ChangeLog 2011-06-21 21:18:25 UTC (rev 89382)
+++ trunk/LayoutTests/ChangeLog 2011-06-21 21:20:15 UTC (rev 89383)
@@ -1,3 +1,13 @@
+2011-06-21 Mark Pilgrim <[email protected]>
+
+ Reviewed by Adam Barth.
+
+ IndexedDB: IDBObjectStore methods should throw TypeError if required arguments are missing
+ https://bugs.webkit.org/show_bug.cgi?id=63087
+
+ * storage/indexeddb/objectStore-required-arguments-expected.txt: Added.
+ * storage/indexeddb/objectStore-required-arguments.html: Added.
+
2011-06-21 Wyatt Carss <[email protected]>
Reviewed by Ryosuke Niwa.
Added: trunk/LayoutTests/storage/indexeddb/objectStore-required-arguments-expected.txt (0 => 89383)
--- trunk/LayoutTests/storage/indexeddb/objectStore-required-arguments-expected.txt (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/objectStore-required-arguments-expected.txt 2011-06-21 21:20:15 UTC (rev 89383)
@@ -0,0 +1,30 @@
+Test IndexedDB object store 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.
+objectStore = db.createObjectStore('foo');
+PASS objectStore.put(); threw exception TypeError: Not enough arguments.
+PASS objectStore.add(); threw exception TypeError: Not enough arguments.
+PASS objectStore.delete(); threw exception TypeError: Not enough arguments.
+PASS objectStore.get(); threw exception TypeError: Not enough arguments.
+PASS objectStore.createIndex(); threw exception TypeError: Not enough arguments.
+PASS objectStore.createIndex('foo'); threw exception TypeError: Not enough arguments.
+PASS objectStore.index(); threw exception TypeError: Not enough arguments.
+PASS objectStore.deleteIndex(); threw exception TypeError: Not enough arguments.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/storage/indexeddb/objectStore-required-arguments.html (0 => 89383)
--- trunk/LayoutTests/storage/indexeddb/objectStore-required-arguments.html (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/objectStore-required-arguments.html 2011-06-21 21:20:15 UTC (rev 89383)
@@ -0,0 +1,67 @@
+<!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 object store 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_ = createAndPopulateObjectStore;
+ request._onerror_ = unexpectedErrorCallback;
+}
+
+function createAndPopulateObjectStore()
+{
+ deleteAllObjectStores(db);
+
+ objectStore = evalAndLog("objectStore = db.createObjectStore('foo');");
+ shouldThrow("objectStore.put();");
+ shouldThrow("objectStore.add();");
+ shouldThrow("objectStore.delete();");
+ shouldThrow("objectStore.get();");
+ shouldThrow("objectStore.createIndex();");
+ shouldThrow("objectStore.createIndex('foo');");
+ shouldThrow("objectStore.index();");
+ shouldThrow("objectStore.deleteIndex();");
+ done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (89382 => 89383)
--- trunk/Source/WebCore/ChangeLog 2011-06-21 21:18:25 UTC (rev 89382)
+++ trunk/Source/WebCore/ChangeLog 2011-06-21 21:20:15 UTC (rev 89383)
@@ -1,3 +1,15 @@
+2011-06-21 Mark Pilgrim <[email protected]>
+
+ Reviewed by Adam Barth.
+
+ IndexedDB: IDBObjectStore methods should throw TypeError if required arguments are missing
+ https://bugs.webkit.org/show_bug.cgi?id=63087
+
+ Test: storage/indexeddb/objectStore-required-arguments.html
+
+ * storage/IDBObjectStore.idl: Remove LegacyDefaultOptionalArguments flag
+ so missing required arguments will throw TypeError, as per WebIDL spec.
+
2011-06-21 Rob Buis <[email protected]>
Reviewed by Dirk Schulze.
Modified: trunk/Source/WebCore/storage/IDBObjectStore.idl (89382 => 89383)
--- trunk/Source/WebCore/storage/IDBObjectStore.idl 2011-06-21 21:18:25 UTC (rev 89382)
+++ trunk/Source/WebCore/storage/IDBObjectStore.idl 2011-06-21 21:20:15 UTC (rev 89383)
@@ -26,7 +26,6 @@
module storage {
interface [
- LegacyDefaultOptionalArguments,
Conditional=INDEXED_DATABASE
] IDBObjectStore {
readonly attribute [ConvertNullStringTo=Null] DOMString name;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes