Title: [89451] trunk
Revision
89451
Author
[email protected]
Date
2011-06-22 11:03:33 -0700 (Wed, 22 Jun 2011)

Log Message

2011-06-22  Mark Pilgrim  <[email protected]>

        Reviewed by Adam Barth.

        IndexedDB: fix multiple issues in IDBDatabase.idl
        https://bugs.webkit.org/show_bug.cgi?id=63140

        * storage/indexeddb/createObjectStore-name-argument-required-expected.txt: Added.
        * storage/indexeddb/createObjectStore-name-argument-required.html: Added.
        * storage/indexeddb/createObjectStore-null-name-expected.txt: Added.
        * storage/indexeddb/createObjectStore-null-name.html: Added.
        * storage/indexeddb/deleteObjectStore-name-argument-required-expected.txt: Added.
        * storage/indexeddb/deleteObjectStore-name-argument-required.html: Added.
        * storage/indexeddb/deleteObjectStore-null-name-expected.txt: Added.
        * storage/indexeddb/deleteObjectStore-null-name.html: Added.
        * storage/indexeddb/mozilla/create-objectstore-null-name-expected.txt:
        * storage/indexeddb/mozilla/create-objectstore-null-name.html:
        * storage/indexeddb/setVersion-null-expected.txt: Added.
        * storage/indexeddb/setVersion-null.html: Added.
        * storage/indexeddb/setVersion-undefined-expected.txt:
        * storage/indexeddb/setVersion-undefined.html:
        * storage/indexeddb/transaction-and-objectstore-calls-expected.txt:
        * storage/indexeddb/transaction-and-objectstore-calls.html:
        * storage/indexeddb/transaction-crash-on-abort-expected.txt:
        * storage/indexeddb/transaction-crash-on-abort.html:
        * storage/indexeddb/transaction-read-only-expected.txt:
        * storage/indexeddb/transaction-read-only.html:
        * storage/indexeddb/transaction-storeNames-required-expected.txt: Added.
        * storage/indexeddb/transaction-storeNames-required.html: Added.
2011-06-22  Mark Pilgrim  <[email protected]>

        Reviewed by Adam Barth.

        IndexedDB: fix multiple issues in IDBDatabase.idl
        https://bugs.webkit.org/show_bug.cgi?id=63140

        Tests: storage/indexeddb/createObjectStore-name-argument-required.html
               storage/indexeddb/createObjectStore-null-name.html
               storage/indexeddb/deleteObjectStore-name-argument-required.html
               storage/indexeddb/deleteObjectStore-null-name.html
               storage/indexeddb/setVersion-null.html
               storage/indexeddb/transaction-storeNames-required.html

        * storage/IDBDatabase.idl: remove LegacyDefaultOptionalArguments so
        all functions will throw TypeError when called with too few arguments,
        as per WebIDL spec. Also remove ConvertNullToNullString flags so null
        values are stringified as "null" (also as per WebIDL spec).

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (89450 => 89451)


--- trunk/LayoutTests/ChangeLog	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/ChangeLog	2011-06-22 18:03:33 UTC (rev 89451)
@@ -1,3 +1,33 @@
+2011-06-22  Mark Pilgrim  <[email protected]>
+
+        Reviewed by Adam Barth.
+
+        IndexedDB: fix multiple issues in IDBDatabase.idl
+        https://bugs.webkit.org/show_bug.cgi?id=63140
+
+        * storage/indexeddb/createObjectStore-name-argument-required-expected.txt: Added.
+        * storage/indexeddb/createObjectStore-name-argument-required.html: Added.
+        * storage/indexeddb/createObjectStore-null-name-expected.txt: Added.
+        * storage/indexeddb/createObjectStore-null-name.html: Added.
+        * storage/indexeddb/deleteObjectStore-name-argument-required-expected.txt: Added.
+        * storage/indexeddb/deleteObjectStore-name-argument-required.html: Added.
+        * storage/indexeddb/deleteObjectStore-null-name-expected.txt: Added.
+        * storage/indexeddb/deleteObjectStore-null-name.html: Added.
+        * storage/indexeddb/mozilla/create-objectstore-null-name-expected.txt:
+        * storage/indexeddb/mozilla/create-objectstore-null-name.html:
+        * storage/indexeddb/setVersion-null-expected.txt: Added.
+        * storage/indexeddb/setVersion-null.html: Added.
+        * storage/indexeddb/setVersion-undefined-expected.txt:
+        * storage/indexeddb/setVersion-undefined.html:
+        * storage/indexeddb/transaction-and-objectstore-calls-expected.txt:
+        * storage/indexeddb/transaction-and-objectstore-calls.html:
+        * storage/indexeddb/transaction-crash-on-abort-expected.txt:
+        * storage/indexeddb/transaction-crash-on-abort.html:
+        * storage/indexeddb/transaction-read-only-expected.txt:
+        * storage/indexeddb/transaction-read-only.html:
+        * storage/indexeddb/transaction-storeNames-required-expected.txt: Added.
+        * storage/indexeddb/transaction-storeNames-required.html: Added.
+
 2011-06-22  Matthew Delaney  <[email protected]>
 
         Adding a mac platform expected result for webgl test to help fix burning bot.

Copied: trunk/LayoutTests/storage/indexeddb/createObjectStore-name-argument-required-expected.txt (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined-expected.txt) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/createObjectStore-name-argument-required-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/createObjectStore-name-argument-required-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,22 @@
+Test IndexedDB createObjectStore name argument is required
+
+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.
+PASS db.createObjectStore(); threw exception TypeError: Not enough arguments.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/storage/indexeddb/createObjectStore-name-argument-required.html (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined.html) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/createObjectStore-name-argument-required.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/createObjectStore-name-argument-required.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,59 @@
+<!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 createObjectStore name argument is required");
+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);
+
+    shouldThrow("db.createObjectStore();");
+    done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>

Copied: trunk/LayoutTests/storage/indexeddb/createObjectStore-null-name-expected.txt (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined-expected.txt) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/createObjectStore-null-name-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/createObjectStore-null-name-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,23 @@
+Test IndexedDB createObjectStore null handling
+
+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(null);
+PASS objectStore.name is 'null'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/storage/indexeddb/createObjectStore-null-name.html (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined.html) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/createObjectStore-null-name.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/createObjectStore-null-name.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,60 @@
+<!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 createObjectStore null handling");
+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("db.createObjectStore(null);");
+    shouldBe("objectStore.name", "'null'");
+    done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>

Copied: trunk/LayoutTests/storage/indexeddb/deleteObjectStore-name-argument-required-expected.txt (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined-expected.txt) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/deleteObjectStore-name-argument-required-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/deleteObjectStore-name-argument-required-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,22 @@
+Test IndexedDB deleteObjectStore 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.
+PASS db.deleteObjectStore(); threw exception TypeError: Not enough arguments.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/storage/indexeddb/deleteObjectStore-name-argument-required.html (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined.html) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/deleteObjectStore-name-argument-required.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/deleteObjectStore-name-argument-required.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,59 @@
+<!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 deleteObjectStore 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);
+
+    shouldThrow("db.deleteObjectStore();");
+    done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>

Copied: trunk/LayoutTests/storage/indexeddb/deleteObjectStore-null-name-expected.txt (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined-expected.txt) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/deleteObjectStore-null-name-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/deleteObjectStore-null-name-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,23 @@
+Test IndexedDB deleteObjectStore 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.
+db.createObjectStore('null');
+db.deleteObjectStore(null);
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/storage/indexeddb/deleteObjectStore-null-name.html (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined.html) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/deleteObjectStore-null-name.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/deleteObjectStore-null-name.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,60 @@
+<!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 deleteObjectStore 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);
+
+    evalAndLog("db.createObjectStore('null');");
+    evalAndLog("db.deleteObjectStore(null);");
+    done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/storage/indexeddb/mozilla/create-objectstore-null-name-expected.txt (89450 => 89451)


--- trunk/LayoutTests/storage/indexeddb/mozilla/create-objectstore-null-name-expected.txt	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/storage/indexeddb/mozilla/create-objectstore-null-name-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -11,9 +11,8 @@
 db = event.target.result
 request = db.setVersion('1')
 Deleted all object stores.
-Expecting exception from db.createObjectStore(null);
-PASS Exception was thrown.
-PASS code is IDBDatabaseException.NON_TRANSIENT_ERR
+objectStore = db.createObjectStore(null);
+PASS objectStore.name is 'null'
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/mozilla/create-objectstore-null-name.html (89450 => 89451)


--- trunk/LayoutTests/storage/indexeddb/mozilla/create-objectstore-null-name.html	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/storage/indexeddb/mozilla/create-objectstore-null-name.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -48,7 +48,8 @@
 {
     deleteAllObjectStores(db);
 
-    evalAndExpectException("db.createObjectStore(null);", "IDBDatabaseException.NON_TRANSIENT_ERR");
+    objectStore = evalAndLog("objectStore = db.createObjectStore(null);");
+    shouldBe("objectStore.name", "'null'");
 
     done();
 }

Copied: trunk/LayoutTests/storage/indexeddb/setVersion-null-expected.txt (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined-expected.txt) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/setVersion-null-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/setVersion-null-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,21 @@
+Test IndexedDB with null version string
+
+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
+db.setVersion(null);
+PASS db.version is 'null'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/storage/indexeddb/setVersion-null.html (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined.html) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/setVersion-null.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/setVersion-null.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,57 @@
+<!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 with null version string");
+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("db.setVersion(null);");
+    request._onsuccess_ = postSetVersion;
+    request._onerror_ = unexpectedErrorCallback;
+}
+
+function postSetVersion()
+{
+    shouldBe("db.version", "'null'");
+    done();
+}
+ 
+var successfullyParsed = true;
+ 
+test();
+ 
+</script> 
+</body> 
+</html>

Modified: trunk/LayoutTests/storage/indexeddb/setVersion-undefined-expected.txt (89450 => 89451)


--- trunk/LayoutTests/storage/indexeddb/setVersion-undefined-expected.txt	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/storage/indexeddb/setVersion-undefined-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -1,4 +1,4 @@
-Test IndexedDB version string is required and can not be null
+Test IndexedDB version string is required
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
@@ -13,12 +13,7 @@
 PASS IDBKeyRange == null is false
 indexedDB.open(name, description)
 db = event.target.result
-Expecting exception from db.setVersion();
-PASS Exception was thrown.
-PASS code is IDBDatabaseException.NON_TRANSIENT_ERR
-Expecting exception from db.setVersion(null);
-PASS Exception was thrown.
-PASS code is IDBDatabaseException.NON_TRANSIENT_ERR
+PASS db.setVersion(); threw exception TypeError: Not enough arguments.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/setVersion-undefined.html (89450 => 89451)


--- trunk/LayoutTests/storage/indexeddb/setVersion-undefined.html	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/storage/indexeddb/setVersion-undefined.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -11,7 +11,7 @@
 <div id="console"></div> 
 <script> 
  
-description("Test IndexedDB version string is required and can not be null");
+description("Test IndexedDB version string is required");
 if (window.layoutTestController)
     layoutTestController.waitUntilDone();
  
@@ -37,8 +37,7 @@
 {
     db = evalAndLog("db = event.target.result");
  
-    request = evalAndExpectException("db.setVersion();", "IDBDatabaseException.NON_TRANSIENT_ERR");
-    request = evalAndExpectException("db.setVersion(null);", "IDBDatabaseException.NON_TRANSIENT_ERR");
+    shouldThrow("db.setVersion();");
     done();
 }
  

Modified: trunk/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls-expected.txt (89450 => 89451)


--- trunk/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls-expected.txt	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -62,12 +62,7 @@
 PASS Exception was thrown.
 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
 
-trans = db.transaction()
-trans.objectStore('a')
-trans.objectStore('b')
-Expecting exception from trans.objectStore('x')
-PASS Exception was thrown.
-PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
+PASS trans = db.transaction() threw exception TypeError: Not enough arguments.
 
 Expecting exception from db.transaction(['x'])
 PASS Exception was thrown.

Modified: trunk/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls.html (89450 => 89451)


--- trunk/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls.html	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/storage/indexeddb/transaction-and-objectstore-calls.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -81,10 +81,7 @@
     evalAndExpectException("trans.objectStore('x')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
     debug("");
 
-    trans = evalAndLog("trans = db.transaction()");
-    evalAndLog("trans.objectStore('a')");
-    evalAndLog("trans.objectStore('b')");
-    evalAndExpectException("trans.objectStore('x')", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+    shouldThrow("trans = db.transaction()");
     debug("");
 
     evalAndExpectException("db.transaction(['x'])", "webkitIDBDatabaseException.NOT_FOUND_ERR");

Modified: trunk/LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt (89450 => 89451)


--- trunk/LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/storage/indexeddb/transaction-crash-on-abort-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -8,7 +8,7 @@
 webkitIndexedDB.open('transaction-crash-on-abort')
 openSuccess():
 db = event.target.result
-db.transaction()
+db.transaction('foo')
 window.gc()
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/storage/indexeddb/transaction-crash-on-abort.html (89450 => 89451)


--- trunk/LayoutTests/storage/indexeddb/transaction-crash-on-abort.html	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/storage/indexeddb/transaction-crash-on-abort.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -28,7 +28,7 @@
 {
     debug("openSuccess():");
     db = evalAndLog("db = event.target.result");
-    evalAndLog("db.transaction()");
+    evalAndLog("db.transaction('foo')");
     evalAndLog("window.gc()");
     done();
 }

Modified: trunk/LayoutTests/storage/indexeddb/transaction-read-only-expected.txt (89450 => 89451)


--- trunk/LayoutTests/storage/indexeddb/transaction-read-only-expected.txt	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/storage/indexeddb/transaction-read-only-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -12,15 +12,15 @@
 Deleted all object stores.
 store = db.createObjectStore('store')
 store.put('x', 'y')
-trans = db.transaction()
+trans = db.transaction('store')
 Expecting exception from trans.objectStore('store').put('a', 'b')
 PASS Exception was thrown.
 PASS code is webkitIDBDatabaseException.READ_ONLY_ERR
-trans = db.transaction()
+trans = db.transaction('store')
 Expecting exception from trans.objectStore('store').delete('x')
 PASS Exception was thrown.
 PASS code is webkitIDBDatabaseException.READ_ONLY_ERR
-trans = db.transaction()
+trans = db.transaction('store')
 cur = trans.objectStore('store').openCursor()
 PASS !event.target.result is false
 Expecting exception from event.target.result.delete()

Modified: trunk/LayoutTests/storage/indexeddb/transaction-read-only.html (89450 => 89451)


--- trunk/LayoutTests/storage/indexeddb/transaction-read-only.html	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/LayoutTests/storage/indexeddb/transaction-read-only.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -45,13 +45,13 @@
 
 function setVersionDone()
 {
-    trans = evalAndLog("trans = db.transaction()");
+    trans = evalAndLog("trans = db.transaction('store')");
     evalAndExpectException("trans.objectStore('store').put('a', 'b')", "webkitIDBDatabaseException.READ_ONLY_ERR");
 
-    trans = evalAndLog("trans = db.transaction()");
+    trans = evalAndLog("trans = db.transaction('store')");
     evalAndExpectException("trans.objectStore('store').delete('x')", "webkitIDBDatabaseException.READ_ONLY_ERR");
 
-    trans = evalAndLog("trans = db.transaction()");
+    trans = evalAndLog("trans = db.transaction('store')");
     cur = evalAndLog("cur = trans.objectStore('store').openCursor()");
     cur._onsuccess_ = gotCursor;
     cur._onerror_ = unexpectedErrorCallback;

Copied: trunk/LayoutTests/storage/indexeddb/transaction-storeNames-required-expected.txt (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined-expected.txt) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/transaction-storeNames-required-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/transaction-storeNames-required-expected.txt	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,22 @@
+Test IndexedDB: transaction storeNames 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.
+PASS db.transaction(); threw exception TypeError: Not enough arguments.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/storage/indexeddb/transaction-storeNames-required.html (from rev 89450, trunk/LayoutTests/storage/indexeddb/setVersion-undefined.html) (0 => 89451)


--- trunk/LayoutTests/storage/indexeddb/transaction-storeNames-required.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/transaction-storeNames-required.html	2011-06-22 18:03:33 UTC (rev 89451)
@@ -0,0 +1,59 @@
+<!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: transaction storeNames 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);
+
+    shouldThrow("db.transaction();");
+    done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (89450 => 89451)


--- trunk/Source/WebCore/ChangeLog	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/Source/WebCore/ChangeLog	2011-06-22 18:03:33 UTC (rev 89451)
@@ -1,3 +1,22 @@
+2011-06-22  Mark Pilgrim  <[email protected]>
+
+        Reviewed by Adam Barth.
+
+        IndexedDB: fix multiple issues in IDBDatabase.idl
+        https://bugs.webkit.org/show_bug.cgi?id=63140
+
+        Tests: storage/indexeddb/createObjectStore-name-argument-required.html
+               storage/indexeddb/createObjectStore-null-name.html
+               storage/indexeddb/deleteObjectStore-name-argument-required.html
+               storage/indexeddb/deleteObjectStore-null-name.html
+               storage/indexeddb/setVersion-null.html
+               storage/indexeddb/transaction-storeNames-required.html
+
+        * storage/IDBDatabase.idl: remove LegacyDefaultOptionalArguments so
+        all functions will throw TypeError when called with too few arguments,
+        as per WebIDL spec. Also remove ConvertNullToNullString flags so null
+        values are stringified as "null" (also as per WebIDL spec).
+
 2011-06-22  Vsevolod Vlasov  <[email protected]>
 
         Reviewed by Pavel Feldman.

Modified: trunk/Source/WebCore/storage/IDBDatabase.idl (89450 => 89451)


--- trunk/Source/WebCore/storage/IDBDatabase.idl	2011-06-22 17:53:18 UTC (rev 89450)
+++ trunk/Source/WebCore/storage/IDBDatabase.idl	2011-06-22 18:03:33 UTC (rev 89451)
@@ -28,7 +28,6 @@
 
     interface [
         Conditional=INDEXED_DATABASE,
-        LegacyDefaultOptionalArguments,
         ActiveDOMObject,
         EventTarget
     ] IDBDatabase {
@@ -40,23 +39,23 @@
         attribute EventListener onerror;
         attribute EventListener onversionchange;
 
-        IDBObjectStore createObjectStore(in [ConvertNullToNullString] DOMString name, in [Optional] OptionsObject options)
+        IDBObjectStore createObjectStore(in DOMString name, in [Optional] OptionsObject options)
             raises (IDBDatabaseException);
         void deleteObjectStore(in DOMString name)
             raises (IDBDatabaseException);
-        [CallWith=ScriptExecutionContext] IDBVersionChangeRequest setVersion(in [ConvertUndefinedOrNullToNullString] DOMString version)
+        [CallWith=ScriptExecutionContext] IDBVersionChangeRequest setVersion(in DOMString version)
             raises (IDBDatabaseException);
-        [CallWith=ScriptExecutionContext] IDBTransaction transaction(in [Optional] DOMStringList storeNames, in [Optional] unsigned short mode)
+        [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in [Optional] unsigned short mode)
             raises (IDBDatabaseException);
         void close();
 
         // EventTarget interface
         void addEventListener(in DOMString type,
                               in EventListener listener,
-                              in boolean useCapture);
+                              in [Optional] boolean useCapture);
         void removeEventListener(in DOMString type,
                                  in EventListener listener,
-                                 in boolean useCapture);
+                                 in [Optional] boolean useCapture);
         boolean dispatchEvent(in Event evt)
             raises(EventException);
     };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to