Diff
Modified: trunk/LayoutTests/ChangeLog (208382 => 208383)
--- trunk/LayoutTests/ChangeLog 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/LayoutTests/ChangeLog 2016-11-04 15:49:33 UTC (rev 208383)
@@ -1,3 +1,15 @@
+2016-11-04 Brady Eidson <[email protected]>
+
+ IndexedDB 2.0: Throw the correct exceptions during IDBObjectStore/IDBIndex renaming.
+ https://bugs.webkit.org/show_bug.cgi?id=164405
+
+ Reviewed by Alex Christensen.
+
+ * storage/indexeddb/modern/index-rename-1-expected.txt:
+ * storage/indexeddb/modern/index-rename-1-private-expected.txt:
+ * storage/indexeddb/modern/objectstore-rename-1-expected.txt:
+ * storage/indexeddb/modern/objectstore-rename-1-private-expected.txt:
+
2016-11-04 Romain Bellessort <[email protected]>
[Readable Streams API] Implement ByteStreamController error()
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (208382 => 208383)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2016-11-04 15:49:33 UTC (rev 208383)
@@ -1,3 +1,13 @@
+2016-11-04 Brady Eidson <[email protected]>
+
+ IndexedDB 2.0: Throw the correct exceptions during IDBObjectStore/IDBIndex renaming.
+ https://bugs.webkit.org/show_bug.cgi?id=164405
+
+ Reviewed by Alex Christensen.
+
+ * web-platform-tests/IndexedDB/idbindex-rename-errors-expected.txt:
+ * web-platform-tests/IndexedDB/idbobjectstore-rename-errors-expected.txt:
+
2016-11-03 Brady Eidson <[email protected]>
IndexedDB 2.0: Handle IDBIndex rename behavior properly when version change transaction aborts.
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-errors-expected.txt (208382 => 208383)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-errors-expected.txt 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbindex-rename-errors-expected.txt 2016-11-04 15:49:33 UTC (rev 208383)
@@ -2,7 +2,7 @@
PASS IndexedDB deleted index rename throws
PASS IndexedDB index rename throws in a readonly transaction
PASS IndexedDB index rename throws in a readwrite transaction
-FAIL IndexedDB index rename throws in an inactive transaction assert_throws: function "() => authorIndex.name = 'renamed_by_author'" threw object "InvalidStateError (DOM Exception 11): Failed set property..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
-FAIL IndexedDB index rename to the name of another index throws assert_throws: function "() => index.name = 'by_title'" threw object "InvalidStateError (DOM Exception 11): Failed set property..." that is not a DOMException ConstraintError: property "code" is equal to 11, expected 0
+FAIL IndexedDB index rename throws in an inactive transaction assert_throws: function "() => authorIndex.name = 'renamed_by_author'" threw object "TransactionInactiveError (DOM Exception 31): Failed set p..." that is not a DOMException TransactionInactiveError: property "code" is equal to 31, expected 0
+FAIL IndexedDB index rename to the name of another index throws assert_throws: function "() => index.name = 'by_title'" threw object "ConstraintError (DOM Exception 29): Failed set property '..." that is not a DOMException ConstraintError: property "code" is equal to 29, expected 0
PASS IndexedDB index rename handles exceptions when stringifying names
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore-rename-errors-expected.txt (208382 => 208383)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore-rename-errors-expected.txt 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/IndexedDB/idbobjectstore-rename-errors-expected.txt 2016-11-04 15:49:33 UTC (rev 208383)
@@ -2,7 +2,7 @@
PASS IndexedDB deleted object store rename throws
PASS IndexedDB object store rename throws in a readonly transaction
PASS IndexedDB object store rename throws in a readwrite transaction
-FAIL IndexedDB object store rename throws in an inactive transaction assert_throws: function "() => { bookStore.name = 'renamed_books'; }" threw object "InvalidStateError (DOM Exception 11): Failed set property..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
-FAIL IndexedDB object store rename to the name of another store throws assert_throws: function "() => store.name = 'not_books'" threw object "InvalidStateError (DOM Exception 11): Failed set property..." that is not a DOMException ConstraintError: property "code" is equal to 11, expected 0
+FAIL IndexedDB object store rename throws in an inactive transaction assert_throws: function "() => { bookStore.name = 'renamed_books'; }" threw object "TransactionInactiveError (DOM Exception 31): Failed set p..." that is not a DOMException TransactionInactiveError: property "code" is equal to 31, expected 0
+FAIL IndexedDB object store rename to the name of another store throws assert_throws: function "() => store.name = 'not_books'" threw object "ConstraintError (DOM Exception 29): Failed set property '..." that is not a DOMException ConstraintError: property "code" is equal to 29, expected 0
PASS IndexedDB object store rename handles exceptions when stringifying names
Modified: trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-expected.txt (208382 => 208383)
--- trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-expected.txt 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-expected.txt 2016-11-04 15:49:33 UTC (rev 208383)
@@ -10,7 +10,7 @@
Initial upgrade needed: Old version - 0 New version - 1
Failed to rename deleted index: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBIndex': The index has been deleted.
Initial index name: NewIndex
-Caught exception renaming index to the name of another existing index: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBIndex': The owning object store already has an index named 'ExistingIndex'.
+Caught exception renaming index to the name of another existing index: ConstraintError (DOM Exception 29): Failed set property 'name' on 'IDBIndex': The owning object store already has an index named 'ExistingIndex'.
Renamed this index to the same name it already has, it's name is now: NewIndex
Renamed index name: RenamedIndex
Current index name in a new transaction: RenamedIndex
Modified: trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private-expected.txt (208382 => 208383)
--- trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private-expected.txt 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/LayoutTests/storage/indexeddb/modern/index-rename-1-private-expected.txt 2016-11-04 15:49:33 UTC (rev 208383)
@@ -10,7 +10,7 @@
Initial upgrade needed: Old version - 0 New version - 1
Failed to rename deleted index: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBIndex': The index has been deleted.
Initial index name: NewIndex
-Caught exception renaming index to the name of another existing index: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBIndex': The owning object store already has an index named 'ExistingIndex'.
+Caught exception renaming index to the name of another existing index: ConstraintError (DOM Exception 29): Failed set property 'name' on 'IDBIndex': The owning object store already has an index named 'ExistingIndex'.
Renamed this index to the same name it already has, it's name is now: NewIndex
Renamed index name: RenamedIndex
Current index name in a new transaction: RenamedIndex
Modified: trunk/LayoutTests/storage/indexeddb/modern/objectstore-rename-1-expected.txt (208382 => 208383)
--- trunk/LayoutTests/storage/indexeddb/modern/objectstore-rename-1-expected.txt 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/LayoutTests/storage/indexeddb/modern/objectstore-rename-1-expected.txt 2016-11-04 15:49:33 UTC (rev 208383)
@@ -9,7 +9,7 @@
indexedDB.open(dbname)
Initial upgrade needed: Old version - 0 New version - 1
Initial objectStore name: TestObjectStore
-Caught exception renaming object store to the name of another existing object store: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBObjectStore': The database already has an object store named 'ExistingObjectStore'.
+Caught exception renaming object store to the name of another existing object store: ConstraintError (DOM Exception 29): Failed set property 'name' on 'IDBObjectStore': The database already has an object store named 'ExistingObjectStore'.
Renamed objectStore name: RenamedObjectStore
Current objectStore name in a new transaction: RenamedObjectStore
Caught exception renaming object store outside of a version change transaction: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBObjectStore': The object store's transaction is not a version change transaction.
Modified: trunk/LayoutTests/storage/indexeddb/modern/objectstore-rename-1-private-expected.txt (208382 => 208383)
--- trunk/LayoutTests/storage/indexeddb/modern/objectstore-rename-1-private-expected.txt 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/LayoutTests/storage/indexeddb/modern/objectstore-rename-1-private-expected.txt 2016-11-04 15:49:33 UTC (rev 208383)
@@ -9,7 +9,7 @@
indexedDB.open(dbname)
Initial upgrade needed: Old version - 0 New version - 1
Initial objectStore name: TestObjectStore
-Caught exception renaming object store to the name of another existing object store: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBObjectStore': The database already has an object store named 'ExistingObjectStore'.
+Caught exception renaming object store to the name of another existing object store: ConstraintError (DOM Exception 29): Failed set property 'name' on 'IDBObjectStore': The database already has an object store named 'ExistingObjectStore'.
Renamed objectStore name: RenamedObjectStore
Current objectStore name in a new transaction: RenamedObjectStore
Caught exception renaming object store outside of a version change transaction: InvalidStateError (DOM Exception 11): Failed set property 'name' on 'IDBObjectStore': The object store's transaction is not a version change transaction.
Modified: trunk/Source/WebCore/ChangeLog (208382 => 208383)
--- trunk/Source/WebCore/ChangeLog 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/Source/WebCore/ChangeLog 2016-11-04 15:49:33 UTC (rev 208383)
@@ -1,3 +1,18 @@
+2016-11-04 Brady Eidson <[email protected]>
+
+ IndexedDB 2.0: Throw the correct exceptions during IDBObjectStore/IDBIndex renaming.
+ https://bugs.webkit.org/show_bug.cgi?id=164405
+
+ Reviewed by Alex Christensen.
+
+ No new tests (Covered by existing tests).
+
+ * Modules/indexeddb/IDBIndex.cpp:
+ (WebCore::IDBIndex::setName):
+
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::setName):
+
2016-11-04 Romain Bellessort <[email protected]>
[Readable Streams API] Implement ByteStreamController error()
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp (208382 => 208383)
--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp 2016-11-04 15:49:33 UTC (rev 208383)
@@ -93,13 +93,13 @@
return Exception { INVALID_STATE_ERR, ASCIILiteral("Failed set property 'name' on 'IDBIndex': The index's transaction is not a version change transaction.") };
if (!m_objectStore.transaction().isActive())
- return Exception { INVALID_STATE_ERR, ASCIILiteral("Failed set property 'name' on 'IDBIndex': The index's transaction is not active.") };
+ return Exception { TransactionInactiveError, ASCIILiteral("Failed set property 'name' on 'IDBIndex': The index's transaction is not active.") };
if (m_info.name() == name)
return { };
if (m_objectStore.info().hasIndex(name))
- return Exception { INVALID_STATE_ERR, makeString("Failed set property 'name' on 'IDBIndex': The owning object store already has an index named '", name, "'.") };
+ return Exception { ConstraintError, makeString("Failed set property 'name' on 'IDBIndex': The owning object store already has an index named '", name, "'.") };
m_objectStore.transaction().database().renameIndex(*this, name);
m_info.rename(name);
Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (208382 => 208383)
--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp 2016-11-04 10:39:09 UTC (rev 208382)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp 2016-11-04 15:49:33 UTC (rev 208383)
@@ -106,13 +106,13 @@
return Exception { INVALID_STATE_ERR, ASCIILiteral("Failed set property 'name' on 'IDBObjectStore': The object store's transaction is not a version change transaction.") };
if (!m_transaction->isActive())
- return Exception { INVALID_STATE_ERR, ASCIILiteral("Failed set property 'name' on 'IDBObjectStore': The object store's transaction is not active.") };
+ return Exception { TransactionInactiveError, ASCIILiteral("Failed set property 'name' on 'IDBObjectStore': The object store's transaction is not active.") };
if (m_info.name() == name)
return { };
if (m_transaction->database().info().hasObjectStore(name))
- return Exception { INVALID_STATE_ERR, makeString("Failed set property 'name' on 'IDBObjectStore': The database already has an object store named '", name, "'.") };
+ return Exception { ConstraintError, makeString("Failed set property 'name' on 'IDBObjectStore': The database already has an object store named '", name, "'.") };
m_transaction->database().renameObjectStore(*this, name);
m_info.rename(name);