Modern IDB: storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange.html...
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Dec 2015 01:35:17 +0000 (01:35 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Dec 2015 01:35:17 +0000 (01:35 +0000)
commitbd8a8c0e97c9cc079b85656a83ae7d871323e130
treec866b1487119a1975430deee842968c0c512423f
parentb17974a25ab7c1d57fa2b21696984ad7a960ea0f
Modern IDB: storage/indexeddb/delete-in-upgradeneeded-close-in-versionchange.html fails
https://bugs.webkit.org/show_bug.cgi?id=152144

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (At least two failing tests now pass, and other incorrect tests updated to be more correct).

- An IDBOpenDBRequest resulting in a versionchange transaction should not have the onsuccess event fire if
  the database connection was closed during the versionchange transaction. onerror should fire instead.
- When firing an event at an IDBRequest, it should not have the transaction as an additional target if the
  transaction has finished.
- When firing an event at an IDBRequest, it should not have the database as an additional target if the
  database is closed or is closing.

* Modules/indexeddb/client/IDBDatabaseImpl.h:
(WebCore::IDBClient::IDBDatabase::isClosingOrClosed):

* Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
(WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
(WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort): Deleted.
* Modules/indexeddb/client/IDBOpenDBRequestImpl.h:

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::dispatchEvent): Don't add finished transactions or closed databases as event targets.

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::notifyDidAbort):
(WebCore::IDBClient::IDBTransaction::dispatchEvent): If this was a versionchange transaction completing, possibly fire
  the error event on the OpenDBRequest instead of the success event.
* Modules/indexeddb/client/IDBTransactionImpl.h:
(WebCore::IDBClient::IDBTransaction::isFinished):

LayoutTests:

* platform/mac-wk1/TestExpectations:
* storage/indexeddb/modern/abort-requests-cancelled-expected.txt:
* storage/indexeddb/modern/aborted-put-expected.txt:
* storage/indexeddb/modern/createobjectstore-basic-expected.txt:
* storage/indexeddb/modern/deletedatabase-2-expected.txt:
* storage/indexeddb/modern/deletedatabase-2.html:
* storage/indexeddb/modern/deleteindex-2-expected.txt:
* storage/indexeddb/modern/deleteobjectstore-1-expected.txt:
* storage/indexeddb/modern/opendatabase-versions-expected.txt:
* storage/indexeddb/modern/opendatabase-versions.html:
* storage/indexeddb/modern/versionchange-abort-then-reopen-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/storage/indexeddb/modern/abort-requests-cancelled-expected.txt
LayoutTests/storage/indexeddb/modern/aborted-put-expected.txt
LayoutTests/storage/indexeddb/modern/createobjectstore-basic-expected.txt
LayoutTests/storage/indexeddb/modern/deletedatabase-2-expected.txt
LayoutTests/storage/indexeddb/modern/deletedatabase-2.html
LayoutTests/storage/indexeddb/modern/deleteindex-2-expected.txt
LayoutTests/storage/indexeddb/modern/deleteobjectstore-1-expected.txt
LayoutTests/storage/indexeddb/modern/opendatabase-versions-expected.txt
LayoutTests/storage/indexeddb/modern/opendatabase-versions.html
LayoutTests/storage/indexeddb/modern/versionchange-abort-then-reopen-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/client/IDBDatabaseImpl.h
Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h
Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp
Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h