IndexedDB result of deleting a record should be true or false
https://bugs.webkit.org/show_bug.cgi?id=60197
Patch by Joshua Bell <jsbell@chromium.org> on 2011-11-03
Reviewed by David Levin.
Source/WebCore:
IDBObjectStore.delete() was incorrectly firing an error if there
was no record to remove. Match the spec, and return true/false
as success values instead. Bring JSC binding implementation of
SerializedScriptValue more in line with V8 version for methods
called from IDB code.
Test: storage/indexeddb/mozilla/delete-result.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::createFromWire):
(WebCore::SerializedScriptValue::undefinedValue):
(WebCore::SerializedScriptValue::booleanValue):
* bindings/js/SerializedScriptValue.h:
* bindings/v8/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::nullValue):
(WebCore::SerializedScriptValue::undefinedValue):
(WebCore::SerializedScriptValue::booleanValue):
* bindings/v8/SerializedScriptValue.h:
* storage/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::deleteInternal):
LayoutTests:
Add tests for IDBObjectStore.delete() - should succeed if
record exists or not, and return true/false as success value.
* storage/indexeddb/mozilla/delete-result-expected.txt: Added.
* storage/indexeddb/mozilla/delete-result.html: Added.
* storage/indexeddb/objectstore-basics-expected.txt:
* storage/indexeddb/objectstore-basics.html:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@99229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
11 files changed