IndexedDB: Result of IDBFactory.deleteDatabase() should be undefined, not null
authorjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2012 20:00:11 +0000 (20:00 +0000)
committerjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Sep 2012 20:00:11 +0000 (20:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=96538

Reviewed by Tony Chang.

Source/WebCore:

Trivial implementation change to match the spec.

Tests: storage/indexeddb/factory-deletedatabase-expected.html
       storage/indexeddb/intversion-long-queue-expected.html

* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::deleteDatabase):

LayoutTests:

Check result of IDBFactory.deleteDatabase() - one updated assertion, one added assertion.

* storage/indexeddb/factory-deletedatabase-expected.txt:
* storage/indexeddb/intversion-long-queue-expected.txt:
* storage/indexeddb/resources/factory-deletedatabase.js: Add new assertion.
(reopenDatabase):
* storage/indexeddb/resources/intversion-long-queue.js: Update existing assertion.
(deleteDatabaseSuccessCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128795 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/factory-deletedatabase-expected.txt
LayoutTests/storage/indexeddb/intversion-long-queue-expected.txt
LayoutTests/storage/indexeddb/resources/factory-deletedatabase.js
LayoutTests/storage/indexeddb/resources/intversion-long-queue.js
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp

index 8f7925d..de5bcec 100644 (file)
@@ -1,3 +1,19 @@
+2012-09-17  Joshua Bell  <jsbell@chromium.org>
+
+        IndexedDB: Result of IDBFactory.deleteDatabase() should be undefined, not null
+        https://bugs.webkit.org/show_bug.cgi?id=96538
+
+        Reviewed by Tony Chang.
+
+        Check result of IDBFactory.deleteDatabase() - one updated assertion, one added assertion.
+
+        * storage/indexeddb/factory-deletedatabase-expected.txt:
+        * storage/indexeddb/intversion-long-queue-expected.txt:
+        * storage/indexeddb/resources/factory-deletedatabase.js: Add new assertion.
+        (reopenDatabase):
+        * storage/indexeddb/resources/intversion-long-queue.js: Update existing assertion.
+        (deleteDatabaseSuccessCallback):
+
 2012-09-17  Alexey Proskuryakov  <ap@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=96942
index 27e7c84..e3e5b20 100644 (file)
@@ -20,6 +20,7 @@ store.get('key')
 PASS event.target.result is "value"
 db.setVersion('new version')
 request = indexedDB.deleteDatabase('database-to-delete')
+PASS request.result is undefined.
 indexedDB.open('database-to-delete')
 db = event.target.result
 db.setVersion('new version')
index ceff095..f5b2de1 100644 (file)
@@ -63,7 +63,7 @@ FAIL event.version should be undefined. Was
 deleteDatabaseSuccessCallback():
 FAIL event.oldVersion should be non-null. Was undefined
 FAIL event.newVersion should be null (of type object). Was undefined (of type undefined).
-PASS event.target.result is null
+PASS event.target.result is undefined.
 
 upgradeNeededCallback():
 gotUpgradeNeededEvent = true
index 681d8a0..a33e070 100644 (file)
@@ -67,6 +67,7 @@ function deleteDatabase()
 
 function reopenDatabase()
 {
+    shouldBeUndefined("request.result");
     request = evalAndLog("indexedDB.open('database-to-delete')");
     request.onsuccess = startSetVersionAgain;
     request.onerror = unexpectedErrorCallback;
index 6f13ad9..46bf0c8 100644 (file)
@@ -109,7 +109,7 @@ function deleteDatabaseSuccessCallback(evt)
     preamble(evt);
     shouldBeNonNull("event.oldVersion");
     shouldBeNull("event.newVersion");
-    shouldBeNull("event.target.result");
+    shouldBeUndefined("event.target.result");
 }
 
 var gotUpgradeNeededEvent = false;
index e26537d..34b5efa 100644 (file)
@@ -1,3 +1,18 @@
+2012-09-17  Joshua Bell  <jsbell@chromium.org>
+
+        IndexedDB: Result of IDBFactory.deleteDatabase() should be undefined, not null
+        https://bugs.webkit.org/show_bug.cgi?id=96538
+
+        Reviewed by Tony Chang.
+
+        Trivial implementation change to match the spec.
+
+        Tests: storage/indexeddb/factory-deletedatabase-expected.html
+               storage/indexeddb/intversion-long-queue-expected.html
+
+        * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
+        (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
+
 2012-09-17  Rick Byers  <rbyers@chromium.org>
 
         Allow gesture events to set active/hover state.
index 4657362..73e9aaa 100644 (file)
@@ -550,7 +550,7 @@ void IDBDatabaseBackendImpl::deleteDatabase(PassRefPtr<IDBCallbacks> prpCallback
     m_id = InvalidId;
     m_intVersion = IDBDatabaseMetadata::NoIntVersion;
     m_objectStores.clear();
-    callbacks->onSuccess(SerializedScriptValue::nullValue());
+    callbacks->onSuccess(SerializedScriptValue::undefinedValue());
 }
 
 void IDBDatabaseBackendImpl::close(PassRefPtr<IDBDatabaseCallbacks> prpCallbacks)