https://bugs.webkit.org/show_bug.cgi?id=164566
LayoutTests/imported/w3c:
Reviewed by NOBODY (OOPS!).
* IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt:
* IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt:
* web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt:
* web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt:
* web-platform-tests/IndexedDB/idbobjectstore_createIndex14-exception_order-expected.txt:
Source/WebCore:
Reviewed by Alex Christensen.
No new tests (Covered by existing tests).
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continueFunction):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208518
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2016-11-09 Brady Eidson <beidson@apple.com>
+
+ IndexedDB 2.0: Clean up some exception ordering.
+ https://bugs.webkit.org/show_bug.cgi?id=164566
+
+ Reviewed by Alex Christensen.
+
+ * IndexedDB-private-browsing/idbcursor_advance_index7-expected.txt:
+ * IndexedDB-private-browsing/idbcursor_continue_index7-expected.txt:
+ * web-platform-tests/IndexedDB/idbcursor_advance_index7-expected.txt:
+ * web-platform-tests/IndexedDB/idbcursor_continue_index7-expected.txt:
+ * web-platform-tests/IndexedDB/idbobjectstore_createIndex14-exception_order-expected.txt:
+
2016-11-09 Alex Christensen <achristensen@webkit.org>
URLParser should not consider path of URLs with no host to start at the first slash after the colon
-FAIL IDBCursor.advance() - index - throw TransactionInactiveError assert_throws: Calling advance() should throws an exception TransactionInactiveError when the transaction is not active. function "function () {
- cursor.advance(1);
- ..." threw object "InvalidStateError (DOM IDBDatabase Exception 11): Failed ..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
+PASS IDBCursor.advance() - index - throw TransactionInactiveError
-FAIL IDBCursor.continue() - index - throw TransactionInactiveError assert_throws: Calling continue() should throws an exception TransactionInactiveError when the transaction is not active. function "function () {
- cursor.continue();
- ..." threw object "InvalidStateError (DOM IDBDatabase Exception 11): Failed ..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
+PASS IDBCursor.continue() - index - throw TransactionInactiveError
-FAIL IDBCursor.advance() - index - throw TransactionInactiveError assert_throws: Calling advance() should throws an exception TransactionInactiveError when the transaction is not active. function "function () {
- cursor.advance(1);
- ..." threw object "InvalidStateError (DOM IDBDatabase Exception 11): Failed ..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
+PASS IDBCursor.advance() - index - throw TransactionInactiveError
-FAIL IDBCursor.continue() - index - throw TransactionInactiveError assert_throws: Calling continue() should throws an exception TransactionInactiveError when the transaction is not active. function "function () {
- cursor.continue();
- ..." threw object "InvalidStateError (DOM IDBDatabase Exception 11): Failed ..." that is not a DOMException TransactionInactiveError: property "code" is equal to 11, expected 0
+PASS IDBCursor.continue() - index - throw TransactionInactiveError
PASS InvalidStateError(Incorrect mode) vs. TransactionInactiveError
PASS InvalidStateError(Deleted ObjectStore) vs. TransactionInactiveError
PASS TransactionInactiveError vs. ConstraintError
-FAIL ConstraintError vs. SyntaxError assert_throws: Index name check should precede syntax check of the key path function "function () {
- store.createIndex("index", "inv..." threw object "SyntaxError (DOM IDBDatabase Exception 12): Failed to exe..." that is not a DOMException ConstraintError: property "code" is equal to 12, expected 0
+PASS ConstraintError vs. SyntaxError
PASS SyntaxError vs. InvalidAccessError
+2016-11-09 Brady Eidson <beidson@apple.com>
+
+ IndexedDB 2.0: Clean up some exception ordering.
+ https://bugs.webkit.org/show_bug.cgi?id=164566
+
+ Reviewed by Alex Christensen.
+
+ No new tests (Covered by existing tests).
+
+ * Modules/indexeddb/IDBCursor.cpp:
+ (WebCore::IDBCursor::advance):
+ (WebCore::IDBCursor::continueFunction):
+
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::createIndex):
+
2016-11-09 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r208438.
if (!count)
return Exception { TypeError, ASCIILiteral("Failed to execute 'advance' on 'IDBCursor': A count argument with value 0 (zero) was supplied, must be greater than 0.") };
- if (sourcesDeleted())
- return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'advance' on 'IDBCursor': The cursor's source or effective object store has been deleted.") };
-
if (!transaction().isActive())
return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'advance' on 'IDBCursor': The transaction is inactive or finished.") };
+ if (sourcesDeleted())
+ return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'advance' on 'IDBCursor': The cursor's source or effective object store has been deleted.") };
+
if (!m_gotValue)
return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'advance' on 'IDBCursor': The cursor is being iterated or has iterated past its end.") };
if (!m_request)
return Exception { IDBDatabaseException::InvalidStateError };
- if (sourcesDeleted())
- return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'continue' on 'IDBCursor': The cursor's source or effective object store has been deleted.") };
-
if (!transaction().isActive())
return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'continue' on 'IDBCursor': The transaction is inactive or finished.") };
+ if (sourcesDeleted())
+ return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'continue' on 'IDBCursor': The cursor's source or effective object store has been deleted.") };
+
if (!m_gotValue)
return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'continue' on 'IDBCursor': The cursor is being iterated or has iterated past its end.") };
LOG(IndexedDB, "IDBObjectStore::createIndex %s", name.utf8().data());
ASSERT(currentThread() == m_transaction.database().originThreadID());
- if (m_deleted)
- return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The object store has been deleted.") };
-
if (!m_transaction.isVersionChange())
return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The database is not running a version change transaction.") };
+ if (m_deleted)
+ return Exception { IDBDatabaseException::InvalidStateError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The object store has been deleted.") };
+
if (!m_transaction.isActive())
- return Exception { IDBDatabaseException::TransactionInactiveError };
+ return Exception { IDBDatabaseException::TransactionInactiveError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The transaction is inactive.")};
+
+ if (m_info.hasIndex(name))
+ return Exception { IDBDatabaseException::ConstraintError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': An index with the specified name already exists.") };
if (!isIDBKeyPathValid(keyPath))
return Exception { IDBDatabaseException::SyntaxError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument contains an invalid key path.") };
if (name.isNull())
return Exception { TypeError };
- if (m_info.hasIndex(name))
- return Exception { IDBDatabaseException::ConstraintError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': An index with the specified name already exists.") };
-
if (parameters.multiEntry && WTF::holds_alternative<Vector<String>>(keyPath))
return Exception { IDBDatabaseException::InvalidAccessError, ASCIILiteral("Failed to execute 'createIndex' on 'IDBObjectStore': The keyPath argument was an array and the multiEntry option is true.") };