Title: [193892] trunk
Revision
193892
Author
beid...@apple.com
Date
2015-12-09 23:09:34 -0800 (Wed, 09 Dec 2015)

Log Message

Modern IDB: storage/indexeddb/objectstore-basics.html fails.
https://bugs.webkit.org/show_bug.cgi?id=152101

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Multiple tests updated to the new error messaging cover it).

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::putOrAdd): Add plenty of detailed error messaging.

LayoutTests:

* platform/mac-wk1/TestExpectations:
* platform/wk2/storage/indexeddb/mozilla/bad-keypath-expected.txt: Copied from LayoutTests/storage/indexeddb/mozilla/bad-keypath-expected.txt.
* platform/wk2/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt: Copied from LayoutTests/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt.
* platform/wk2/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt: Copied from LayoutTests/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt.
* platform/wk2/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt: Copied from LayoutTests/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt.
* storage/indexeddb/invalid-keys-expected.txt:
* storage/indexeddb/key-type-binary-expected.txt:
* storage/indexeddb/keypath-edges-expected.txt:
* storage/indexeddb/mozilla/bad-keypath-expected.txt:
* storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt:
* storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt:
* storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt:
* storage/indexeddb/objectstore-basics-expected.txt:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (193891 => 193892)


--- trunk/LayoutTests/ChangeLog	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/LayoutTests/ChangeLog	2015-12-10 07:09:34 UTC (rev 193892)
@@ -1,5 +1,26 @@
 2015-12-09  Brady Eidson  <beid...@apple.com>
 
+        Modern IDB: storage/indexeddb/objectstore-basics.html fails.
+        https://bugs.webkit.org/show_bug.cgi?id=152101
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac-wk1/TestExpectations:
+        * platform/wk2/storage/indexeddb/mozilla/bad-keypath-expected.txt: Copied from LayoutTests/storage/indexeddb/mozilla/bad-keypath-expected.txt.
+        * platform/wk2/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt: Copied from LayoutTests/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt.
+        * platform/wk2/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt: Copied from LayoutTests/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt.
+        * platform/wk2/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt: Copied from LayoutTests/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt.
+        * storage/indexeddb/invalid-keys-expected.txt:
+        * storage/indexeddb/key-type-binary-expected.txt:
+        * storage/indexeddb/keypath-edges-expected.txt:
+        * storage/indexeddb/mozilla/bad-keypath-expected.txt:
+        * storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt:
+        * storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt:
+        * storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt:
+        * storage/indexeddb/objectstore-basics-expected.txt:
+
+2015-12-09  Brady Eidson  <beid...@apple.com>
+
         Modern IDB: storage/indexeddb/metadata.html fails
         https://bugs.webkit.org/show_bug.cgi?id=152099
 

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (193891 => 193892)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2015-12-10 07:09:34 UTC (rev 193892)
@@ -111,7 +111,6 @@
 storage/indexeddb/key-type-array.html [ Failure ]
 storage/indexeddb/lazy-index-types.html [ Failure ]
 storage/indexeddb/objectstore-autoincrement.html [ Failure ]
-storage/indexeddb/objectstore-basics.html [ Failure ]
 storage/indexeddb/objectstore-count.html [ Failure ]
 storage/indexeddb/open-cursor.html [ Failure ]
 storage/indexeddb/open-db-private-browsing.html [ Failure ]

Copied: trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/bad-keypath-expected.txt (from rev 193891, trunk/LayoutTests/storage/indexeddb/mozilla/bad-keypath-expected.txt) (0 => 193892)


--- trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/bad-keypath-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/bad-keypath-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -0,0 +1,21 @@
+Test IndexedDB adding property with invalid keypath
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+dbname = "bad-keypath.html"
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+objectStore = db.createObjectStore('foo', { keyPath: 'keyPath' });
+request = objectStore.add({ keyPath: 'foo' });
+Expecting exception from request = objectStore.add({});
+PASS Exception was thrown.
+PASS code is 0
+PASS ename is 'DataError'
+Exception message: The data provided does not meet requirements.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt (from rev 193891, trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt) (0 => 193892)


--- trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -0,0 +1,20 @@
+Test IndexedDB's behavior adding inline and passed key simultaneously
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+dbname = "key-requirements-inline-and-passed.html"
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+objectStore = db.createObjectStore('baz', { keyPath: 'id' });
+Expecting exception from objectStore.add({id: 5}, 5);
+PASS Exception was thrown.
+PASS code is 0
+PASS ename is 'DataError'
+Exception message: The data provided does not meet requirements.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt (from rev 193891, trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt) (0 => 193892)


--- trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -0,0 +1,20 @@
+Test IndexedDB's behavior puting without key
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+dbname = "key-requirements-put-no-key.html"
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+objectStore = db.createObjectStore('bar');
+Expecting exception from objectStore.put({});
+PASS Exception was thrown.
+PASS code is 0
+PASS ename is 'DataError'
+Exception message: The data provided does not meet requirements.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt (from rev 193891, trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt) (0 => 193892)


--- trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/wk2/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -0,0 +1,20 @@
+Test IndexedDB's behavior put()ing with null key
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+dbname = "key-requirements-put-null-key.html"
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+objectStore = db.createObjectStore('bar');
+Expecting exception from objectStore.put({}, null);
+PASS Exception was thrown.
+PASS code is 0
+PASS ename is 'DataError'
+Exception message: The data provided does not meet requirements.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/LayoutTests/storage/indexeddb/invalid-keys-expected.txt (193891 => 193892)


--- trunk/LayoutTests/storage/indexeddb/invalid-keys-expected.txt	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/LayoutTests/storage/indexeddb/invalid-keys-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -13,82 +13,82 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', null)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', (function() { return arguments; }()))
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', true)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', false)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', new Error)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', function () {})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', JSON)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', Math)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', NaN)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', new Date(NaN))
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', {})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', /regex/)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', self)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', self.document)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Expecting exception from request = objectStore.put('value', self.document.body)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/key-type-binary-expected.txt (193891 => 193892)


--- trunk/LayoutTests/storage/indexeddb/key-type-binary-expected.txt	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/LayoutTests/storage/indexeddb/key-type-binary-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -19,49 +19,49 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put(1, new Uint8Array([0]));
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put(2, new Uint8Array([0, 0]));
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put(3, new Uint8Array([0, 1]));
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put(4, new Uint8Array([1]));
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put(5, new Uint8Array([1, 0]));
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put(6, new Uint8Array([1, 1]));
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put(7, new Uint8Array([255]));
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 testInvalidBinaryKeys2():
 trans = db.transaction('store', 'readwrite')
@@ -71,61 +71,61 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put('value', new Uint16Array([1,2,3]))
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put('value', new Uint32Array([1,2,3]))
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put('value', new Int8Array([1,2,3]))
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put('value', new Int16Array([1,2,3]))
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put('value', new Int32Array([1,2,3]))
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put('value', new Float32Array([1,2,3]))
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put('value', new Float64Array([1,2,3]))
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put('value', new Uint8Array([1,2,3]).buffer)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 Expecting exception from store.put('value', new DataView(new Uint8Array([1,2,3]).buffer))
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/keypath-edges-expected.txt (193891 => 193892)


--- trunk/LayoutTests/storage/indexeddb/keypath-edges-expected.txt	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/LayoutTests/storage/indexeddb/keypath-edges-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -20,21 +20,21 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: Evaluating the object store's key path did not yield a value.
 
 Key path doesn't resolve to a value; should yield null, should throw DATA_ERR
 Expecting exception from store.put({})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: Evaluating the object store's key path did not yield a value.
 
 Key path resolves to a value that is invalid key; should yield 'invalid' key, should throw DATA_ERR
 Expecting exception from store.put({foo: null})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: Evaluating the object store's key path yielded a value that is not a valid key.
 
 Key path resolves to a value that is valid key; should yield 'string' key, should succeed
 store.put({foo: 'zoo'})
@@ -67,7 +67,7 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: Evaluating the object store's key path yielded a value that is not a valid key.
 
 Key path resolves to a value that is valid key; should yield 'string' key, should succeed
 store.put({foo: 'zoo'})

Modified: trunk/LayoutTests/storage/indexeddb/mozilla/bad-keypath-expected.txt (193891 => 193892)


--- trunk/LayoutTests/storage/indexeddb/mozilla/bad-keypath-expected.txt	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/LayoutTests/storage/indexeddb/mozilla/bad-keypath-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -14,7 +14,7 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: Evaluating the object store's key path did not yield a value.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt (193891 => 193892)


--- trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-inline-and-passed-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -13,7 +13,7 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The object store uses in-line keys and the key parameter was provided.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt (193891 => 193892)


--- trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-put-no-key-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -13,7 +13,7 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The object store uses out-of-line keys and has no key generator and the key parameter was not provided.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt (193891 => 193892)


--- trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/LayoutTests/storage/indexeddb/mozilla/key-requirements-put-null-key-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -13,7 +13,7 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: The data provided does not meet requirements.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt (193891 => 193892)


--- trunk/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt	2015-12-10 07:09:34 UTC (rev 193892)
@@ -29,8 +29,6 @@
 PASS typeof store.clear is "function"
 PASS 'openCursor' in store is true
 PASS typeof store.openCursor is "function"
-PASS 'openKeyCursor' in store is true
-PASS typeof store.openKeyCursor is "function"
 PASS 'createIndex' in store is true
 PASS typeof store.createIndex is "function"
 PASS 'index' in store is true
@@ -97,7 +95,7 @@
 Expecting exception from store.add({x: 'bar', y: self}, 'bar')
 PASS Exception was thrown.
 PASS code is DOMException.DATA_CLONE_ERR
-Exception message: Failed to execute 'add' on 'IDBObjectStore': An object could not be cloned.
+Exception message: DataCloneError: DOM Exception 25
 Try to insert data where key path yields a Date key:
 store.add({x: testDateB, y: 'value'}, 'key')
 addSuccess():
@@ -113,7 +111,7 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'add' on 'IDBObjectStore': The parameter is not a valid key.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 db.transaction(['storeName'], 'readwrite')
 store = transaction.objectStore('storeName')
 Ensure invalid key pointed at by index keyPath is ignored
@@ -151,13 +149,13 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'add' on 'IDBObjectStore': The parameter is not a valid key.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 Passing an invalid key into store.put().
 Expecting exception from store.put(null, {})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 testPreConditions():
 indexedDB.open(dbname, 3)
@@ -174,31 +172,31 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'put' on 'IDBObjectStore': The object store uses in-line keys and the key parameter was provided.
+Exception message: Failed to store record in an IDBObjectStore: The object store uses in-line keys and the key parameter was provided.
 The object store uses out-of-line keys and has no key generator and the key parameter was not provided.
 Expecting exception from storeWithOutOfLineKeys.put({})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'put' on 'IDBObjectStore': The object store uses out-of-line keys and has no key generator and the key parameter was not provided.
+Exception message: Failed to store record in an IDBObjectStore: The object store uses out-of-line keys and has no key generator and the key parameter was not provided.
 The object store uses in-line keys and the result of evaluating the object store's key path yields a value and that value is not a valid key.
 Expecting exception from storeWithInLineKeys.put({key: null})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'put' on 'IDBObjectStore': Evaluating the object store's key path yielded a value that is not a valid key.
+Exception message: Failed to store record in an IDBObjectStore: Evaluating the object store's key path yielded a value that is not a valid key.
 The object store uses in-line keys but no key generator and the result of evaluating the object store's key path does not yield a value.
 Expecting exception from storeWithInLineKeys.put({})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'put' on 'IDBObjectStore': Evaluating the object store's key path did not yield a value.
+Exception message: Failed to store record in an IDBObjectStore: Evaluating the object store's key path did not yield a value.
 The key parameter was provided but does not contain a valid key.
 Expecting exception from storeWithOutOfLineKeys.put({}, null)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'put' on 'IDBObjectStore': The parameter is not a valid key.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 
 IDBObjectStore.add()
 The object store uses in-line keys and the key parameter was provided.
@@ -206,31 +204,31 @@
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'add' on 'IDBObjectStore': The object store uses in-line keys and the key parameter was provided.
+Exception message: Failed to store record in an IDBObjectStore: The object store uses in-line keys and the key parameter was provided.
 The object store uses out-of-line keys and has no key generator and the key parameter was not provided.
 Expecting exception from storeWithOutOfLineKeys.add({})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'add' on 'IDBObjectStore': The object store uses out-of-line keys and has no key generator and the key parameter was not provided.
+Exception message: Failed to store record in an IDBObjectStore: The object store uses out-of-line keys and has no key generator and the key parameter was not provided.
 The object store uses in-line keys and the result of evaluating the object store's key path yields a value and that value is not a valid key.
 Expecting exception from storeWithInLineKeys.add({key: null})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'add' on 'IDBObjectStore': Evaluating the object store's key path yielded a value that is not a valid key.
+Exception message: Failed to store record in an IDBObjectStore: Evaluating the object store's key path yielded a value that is not a valid key.
 The object store uses in-line keys but no key generator and the result of evaluating the object store's key path does not yield a value.
 Expecting exception from storeWithInLineKeys.add({})
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'add' on 'IDBObjectStore': Evaluating the object store's key path did not yield a value.
+Exception message: Failed to store record in an IDBObjectStore: Evaluating the object store's key path did not yield a value.
 The key parameter was provided but does not contain a valid key.
 Expecting exception from storeWithOutOfLineKeys.add({}, null)
 PASS Exception was thrown.
 PASS code is 0
 PASS ename is 'DataError'
-Exception message: Failed to execute 'add' on 'IDBObjectStore': The parameter is not a valid key.
+Exception message: Failed to store record in an IDBObjectStore: The parameter is not a valid key.
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/Source/WebCore/ChangeLog (193891 => 193892)


--- trunk/Source/WebCore/ChangeLog	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/Source/WebCore/ChangeLog	2015-12-10 07:09:34 UTC (rev 193892)
@@ -1,3 +1,15 @@
+2015-12-09  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: storage/indexeddb/objectstore-basics.html fails.
+        https://bugs.webkit.org/show_bug.cgi?id=152101
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Multiple tests updated to the new error messaging cover it).
+
+        * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
+        (WebCore::IDBClient::IDBObjectStore::putOrAdd): Add plenty of detailed error messaging.
+
 2015-12-09  Zalan Bujtas  <za...@apple.com>
 
         TextPainter: Make before and after selection painting more explicit.

Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp (193891 => 193892)


--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp	2015-12-10 04:59:56 UTC (rev 193891)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp	2015-12-10 07:09:34 UTC (rev 193892)
@@ -271,6 +271,7 @@
 
     if (key && key->type() == KeyType::Invalid) {
         ec.code = IDBDatabaseException::DataError;
+        ec.message = ASCIILiteral("Failed to store record in an IDBObjectStore: The parameter is not a valid key.");
         return nullptr;
     }
 
@@ -279,12 +280,14 @@
     if (usesInlineKeys && inlineKeyCheck == InlineKeyCheck::Perform) {
         if (key) {
             ec.code = IDBDatabaseException::DataError;
+            ec.message = ASCIILiteral("Failed to store record in an IDBObjectStore: The object store uses in-line keys and the key parameter was provided.");
             return nullptr;
         }
 
         RefPtr<IDBKey> keyPathKey = maybeCreateIDBKeyFromScriptValueAndKeyPath(state, value, m_info.keyPath());
         if (keyPathKey && !keyPathKey->isValid()) {
             ec.code = IDBDatabaseException::DataError;
+            ec.message = ASCIILiteral("Failed to store record in an IDBObjectStore: Evaluating the object store's key path yielded a value that is not a valid key.");
             return nullptr;
         }
 
@@ -296,6 +299,7 @@
                 }
             } else {
                 ec.code = IDBDatabaseException::DataError;
+                ec.message = ASCIILiteral("Failed to store record in an IDBObjectStore: Evaluating the object store's key path did not yield a value.");
                 return nullptr;
             }
         }
@@ -306,6 +310,7 @@
         }
     } else if (!usesKeyGenerator && !key) {
         ec.code = IDBDatabaseException::DataError;
+        ec.message = ASCIILiteral("Failed to store record in an IDBObjectStore: The object store uses out-of-line keys and has no key generator and the key parameter was not provided.");
         return nullptr;
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to