Changeset 86804 in webkit
- Timestamp:
- May 18, 2011 4:43:23 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r86803 r86804 1 2011-05-18 Mark Pilgrim <pilgrim@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 IndexedDB put() should fail adding to object store that uses 6 out-of-line keys and has no key generator and the key parameter 7 was not provided 8 https://bugs.webkit.org/show_bug.cgi?id=58609 9 10 One new test and one fix to an existing test that relied on the old 11 broken behavior. 12 13 * storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt: Added. 14 * storage/indexeddb/mozilla/key-requirements-put-no-key.html: Added. 15 * storage/indexeddb/objectstore-autoincrement-expected.txt: 16 * storage/indexeddb/objectstore-autoincrement.html: 17 1 18 2011-05-18 Siddharth Mathur <siddharth.mathur@nokia.com> 2 19 -
trunk/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
r79458 r86804 57 57 store = trans.objectStore('PlainOldStore') 58 58 Try adding with no key to object store without auto increment. 59 store.add({name: 'Adam'}) 60 addAdamError(): 61 PASS event.target.errorCode is webkitIDBDatabaseException.DATA_ERR 62 event.preventDefault() 59 Expecting exception from store.add({name: 'Adam'}) 60 PASS Exception was thrown. 61 PASS code is webkitIDBDatabaseException.DATA_ERR 63 62 store.add({name: 'Adam'}, 1) 64 63 addAdamSuccess(): -
trunk/LayoutTests/storage/indexeddb/objectstore-autoincrement.html
r79458 r86804 148 148 window.store = evalAndLog("store = trans.objectStore('PlainOldStore')"); 149 149 debug("Try adding with no key to object store without auto increment."); 150 request = evalAndLog("store.add({name: 'Adam'})"); 151 request.onsuccess = unexpectedSuccessCallback; 152 request.onerror = addAdamError; 153 } 154 155 function addAdamError() 156 { 157 debug("addAdamError():"); 158 shouldBe("event.target.errorCode", "webkitIDBDatabaseException.DATA_ERR"); 159 160 evalAndLog("event.preventDefault()"); 161 150 evalAndExpectException("store.add({name: 'Adam'})", "webkitIDBDatabaseException.DATA_ERR"); 162 151 request = evalAndLog("store.add({name: 'Adam'}, 1)"); 163 152 request.onsuccess = addAdamSuccess; -
trunk/Source/WebCore/ChangeLog
r86801 r86804 1 2011-05-18 Mark Pilgrim <pilgrim@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 IndexedDB put() should fail adding to object store that uses 6 out-of-line keys and has no key generator and the key parameter 7 was not provided 8 https://bugs.webkit.org/show_bug.cgi?id=58609 9 10 Out-of-line keys means that objectStore->m_keyPath is null in ::put(), 11 no key generator means that objectStore->autoIncrement() is false, and 12 key parameter was not provided means that prpKey will be a null pointer. 13 The combination of these 3 should throw a DATA_ERR. 14 15 Test: storage/indexeddb/mozilla/key-requirements-put-no-key.html 16 17 * storage/IDBObjectStoreBackendImpl.cpp: 18 (WebCore::IDBObjectStoreBackendImpl::put): 19 1 20 2011-05-18 Chris Rogers <crogers@google.com> 2 21 -
trunk/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp
r86665 r86804 136 136 return; 137 137 } 138 139 const bool autoIncrement = objectStore->autoIncrement(); 140 const bool hasKeyPath = !objectStore->m_keyPath.isNull(); 141 if (!key && !autoIncrement && !hasKeyPath) { 142 ec = IDBDatabaseException::DATA_ERR; 143 return; 144 } 145 138 146 // FIXME: This should throw a SERIAL_ERR on structured clone problems. 139 147 // FIXME: This should throw a DATA_ERR when the wrong key/keyPath data is supplied.
Note: See TracChangeset
for help on using the changeset viewer.