[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
hans at chromium.org
hans at chromium.org
Wed Dec 22 16:32:57 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit a71192f16e8b13e9dc83412bd132e6322b4cbbf8
Author: hans at chromium.org <hans at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 25 18:18:11 2010 +0000
2010-11-25 Hans Wennborg <hans at chromium.org>
Reviewed by Jeremy Orlow.
IndexedDB: Better errors for not yet implemented features
https://bugs.webkit.org/show_bug.cgi?id=50075
Test that inserting a record where the key is a Date (either
explicitly, or via a key path) yields an error.
Test that calling createObjectStore with autoIncrement = true
raises an exception.
* storage/indexeddb/create-object-store-options-expected.txt:
* storage/indexeddb/create-object-store-options.html:
* storage/indexeddb/objectstore-basics-expected.txt:
* storage/indexeddb/objectstore-basics.html:
2010-11-25 Hans Wennborg <hans at chromium.org>
Reviewed by Jeremy Orlow.
IndexedDB: Better errors for not yet implemented features
https://bugs.webkit.org/show_bug.cgi?id=50075
Raise an exception if createObjectStore is called with autoIncrement
set to true.
Be a little bit more explicit in IDBBindingUtilities that we don't
allow using Date objects as keys yet.
* bindings/v8/IDBBindingUtilities.cpp:
(WebCore::createIDBKeyFromValue):
* storage/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
* storage/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::putInternal):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72738 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3ec2d08..39352dd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2010-11-25 Hans Wennborg <hans at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ IndexedDB: Better errors for not yet implemented features
+ https://bugs.webkit.org/show_bug.cgi?id=50075
+
+ Test that inserting a record where the key is a Date (either
+ explicitly, or via a key path) yields an error.
+
+ Test that calling createObjectStore with autoIncrement = true
+ raises an exception.
+
+ * storage/indexeddb/create-object-store-options-expected.txt:
+ * storage/indexeddb/create-object-store-options.html:
+ * storage/indexeddb/objectstore-basics-expected.txt:
+ * storage/indexeddb/objectstore-basics.html:
+
2010-11-25 Ilya Tikhonovsky <loislo at chromium.org>
Unreviewed. Enable tests in chromium.
diff --git a/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt b/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
index aec381f..f116280 100644
--- a/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
+++ b/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
@@ -16,6 +16,9 @@ result = db.setVersion('version 1')
Deleted all object stores.
db.createObjectStore('a', {keyPath: 'a'})
db.createObjectStore('b')
+db.createObjectStore('c', {autoIncrement: true});
+PASS Exception thrown
+PASS code is webkitIDBDatabaseException.UNKNOWN_ERR
trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
trans.objectStore('a').put({'a': 0})
trans.objectStore('b').put({'a': 0}, 0)
diff --git a/LayoutTests/storage/indexeddb/create-object-store-options.html b/LayoutTests/storage/indexeddb/create-object-store-options.html
index b28d2d2..3db2dd4 100644
--- a/LayoutTests/storage/indexeddb/create-object-store-options.html
+++ b/LayoutTests/storage/indexeddb/create-object-store-options.html
@@ -44,6 +44,17 @@ function cleaned()
evalAndLog("db.createObjectStore('a', {keyPath: 'a'})");
evalAndLog("db.createObjectStore('b')");
+ try {
+ // FIXME: This should work in the future.
+ debug("db.createObjectStore('c', {autoIncrement: true});");
+ db.createObjectStore('c', {autoIncrement: true});
+ testFailed('createObjectStore with autoIncrement = true should throw');
+ } catch (err) {
+ testPassed("Exception thrown");
+ code = err.code;
+ shouldBe("code", "webkitIDBDatabaseException.UNKNOWN_ERR");
+ }
+
trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
req = evalAndLog("trans.objectStore('a').put({'a': 0})");
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
index 3252bcc..decd36c 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
@@ -97,6 +97,13 @@ PASS store.indexNames.item(1) is null
PASS store.indexNames.item(100) is null
transaction = db.transaction()
store = transaction.objectStore('storeName')
+Try to insert data with a Date key:
+store.add({x: 'foo'}, new Date())
+PASS Exception thrown
+PASS code is DOMException.TYPE_MISMATCH_ERR
+Try to insert data where key path yields a Date key:
+store.add({x: new Date()}, 'foo')
+PASS Adding data where key path yielded Date key resulted in error.
store.add({x: 'value'}, 'key')
PASS 'onsuccess' in result is true
PASS 'onerror' in result is true
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics.html b/LayoutTests/storage/indexeddb/objectstore-basics.html
index 0501f30..5ff50c2 100644
--- a/LayoutTests/storage/indexeddb/objectstore-basics.html
+++ b/LayoutTests/storage/indexeddb/objectstore-basics.html
@@ -142,6 +142,30 @@ function addData()
var transaction = evalAndLog("transaction = db.transaction()");
transaction.onabort = unexpectedAbortCallback;
window.store = evalAndLog("store = transaction.objectStore('storeName')");
+
+ debug("Try to insert data with a Date key:");
+ // FIXME: This should work in the future.
+ try {
+ debug("store.add({x: 'foo'}, new Date())");
+ store.add({x: 'foo'}, new Date());
+ testFailed("Passing a Date as key argument should have thrown.");
+ } catch (err) {
+ testPassed("Exception thrown");
+ code = err.code;
+ shouldBe("code", "DOMException.TYPE_MISMATCH_ERR");
+ }
+
+ // FIXME: This should work in the future.
+ debug("Try to insert data where key path yields a Date key:");
+ result = evalAndLog("store.add({x: new Date()}, 'foo')");
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = addKeyPathYieldingDateFailure;
+}
+
+function addKeyPathYieldingDateFailure()
+{
+ testPassed("Adding data where key path yielded Date key resulted in error.");
+
result = evalAndLog("store.add({x: 'value'}, 'key')");
verifyResult(result);
result.onsuccess = addSuccess;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2f50ded..403ef8f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-11-25 Hans Wennborg <hans at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ IndexedDB: Better errors for not yet implemented features
+ https://bugs.webkit.org/show_bug.cgi?id=50075
+
+ Raise an exception if createObjectStore is called with autoIncrement
+ set to true.
+
+ Be a little bit more explicit in IDBBindingUtilities that we don't
+ allow using Date objects as keys yet.
+
+ * bindings/v8/IDBBindingUtilities.cpp:
+ (WebCore::createIDBKeyFromValue):
+ * storage/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::createObjectStore):
+ * storage/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBObjectStoreBackendImpl::putInternal):
+
2010-11-25 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Yury Semikhatsky.
diff --git a/WebCore/bindings/v8/IDBBindingUtilities.cpp b/WebCore/bindings/v8/IDBBindingUtilities.cpp
index 123b15c..644e2d2 100644
--- a/WebCore/bindings/v8/IDBBindingUtilities.cpp
+++ b/WebCore/bindings/v8/IDBBindingUtilities.cpp
@@ -45,7 +45,8 @@ PassRefPtr<IDBKey> createIDBKeyFromValue(v8::Handle<v8::Value> value)
return IDBKey::create(value->Int32Value());
if (value->IsString())
return IDBKey::create(v8ValueToWebCoreString(value));
- // FIXME: Implement dates.
+ if (value->IsDate())
+ return 0; // Signals type error. FIXME: Implement dates.
return 0; // Signals type error.
}
diff --git a/WebCore/storage/IDBDatabase.cpp b/WebCore/storage/IDBDatabase.cpp
index 72ff17d..9a8727f 100644
--- a/WebCore/storage/IDBDatabase.cpp
+++ b/WebCore/storage/IDBDatabase.cpp
@@ -69,9 +69,15 @@ PassRefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String& name, co
options.getKeyBool("autoIncrement", autoIncrement);
// FIXME: Look up evictable and pass that on as well.
+ if (autoIncrement) {
+ // FIXME: Implement support for auto increment.
+ ec = IDBDatabaseException::UNKNOWN_ERR;
+ return 0;
+ }
+
RefPtr<IDBObjectStoreBackendInterface> objectStore = m_backend->createObjectStore(name, keyPath, autoIncrement, m_setVersionTransaction.get(), ec);
if (!objectStore) {
- // FIXME: ASSERT(ec) once UNKNOWN_ERR is not 0.
+ ASSERT(ec);
return 0;
}
return IDBObjectStore::create(objectStore.release(), m_setVersionTransaction.get());
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list