Modern IDB (Workers): Start running a lot of the workers tests.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 May 2016 21:04:25 +0000 (21:04 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 May 2016 21:04:25 +0000 (21:04 +0000)
commit8a59f618c35682e488bb9557928bba8da4d03bd2
tree41476f7810627b91069fcc83ef34cf6ab672b11c
parenteafef4cfbf356ed0cafb3b98142884f3a1c62f31
Modern IDB (Workers): Start running a lot of the workers tests.
https://bugs.webkit.org/show_bug.cgi?id=157424

Reviewed by Sam Weinig.

Source/WebCore:

No new tests (Covered by enabling a whole bunch of existing tests).

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::stop): Call removeAllEventListeners() to clean up the Worker VM
  before it shuts down.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::stop): Call removeAllEventListeners()

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction): Initialize with the correct VM.
(WebCore::IDBTransaction::stop): Call removeAllEventListeners()
(WebCore::IDBTransaction::operationDidComplete):

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::takeIDBOpenDBRequest):
(WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): Don't take the request from
  the map, but rather let the request take itself from its appropriate thread.
* Modules/indexeddb/client/IDBConnectionProxy.h:

* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::completed): Rework clearing out the completion
  handler, as the handler itself might hold the last reference to `this`.

* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::hasUniversalAccess):

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope): If the parent context's SecurityOrigin had
  universal access, grant it to this one.

LayoutTests:

Many tests that obviously pass need updated expectations for the details of error messages.

Others just work right out of the box.

* TestExpectations: Enable some tests, and categorize remaining failures.

* http/tests/security/cross-origin-worker-indexeddb-allowed-expected.txt:
* http/tests/security/cross-origin-worker-indexeddb-allowed.html:
* http/tests/security/cross-origin-worker-indexeddb-expected.txt:
* http/tests/security/cross-origin-worker-indexeddb.html:
* http/tests/security/resources/cross-origin-iframe-for-worker-indexeddb.html:
* http/tests/security/resources/document-for-cross-origin-worker-indexeddb.html:
* http/tests/security/resources/worker-for-indexeddb.js:
* storage/indexeddb/basics-workers.html:
* storage/indexeddb/cursor-advance-workers-expected.txt:
* storage/indexeddb/cursor-advance-workers.html:
* storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-workers.html:
* storage/indexeddb/dont-commit-on-blocked-private.html:
* storage/indexeddb/dont-commit-on-blocked.html:
* storage/indexeddb/factory-basics-workers.html:
* storage/indexeddb/index-basics-workers-expected.txt:
* storage/indexeddb/index-basics-workers.html:
* storage/indexeddb/modern/workers-disabled.html:
* storage/indexeddb/objectstore-basics-workers-expected.txt:
* storage/indexeddb/objectstore-basics-workers.html:
* storage/indexeddb/open-twice-workers.html:
* storage/indexeddb/pending-activity-workers.html:
* storage/indexeddb/pending-version-change-on-exit-private.html:
* storage/indexeddb/pending-version-change-on-exit.html:
* storage/indexeddb/pending-version-change-stuck-private.html:
* storage/indexeddb/pending-version-change-stuck-works-with-terminate-private.html:
* storage/indexeddb/pending-version-change-stuck-works-with-terminate.html:
* storage/indexeddb/pending-version-change-stuck.html:
* storage/indexeddb/transaction-complete-workers-expected.txt:
* storage/indexeddb/transaction-complete-workers-private-expected.txt:
* storage/indexeddb/transaction-complete-workers-private.html:
* storage/indexeddb/transaction-complete-workers.html:
* storage/indexeddb/unprefix-workers.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
43 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/http/tests/security/cross-origin-worker-indexeddb-allowed-expected.txt
LayoutTests/http/tests/security/cross-origin-worker-indexeddb-allowed.html
LayoutTests/http/tests/security/cross-origin-worker-indexeddb-expected.txt
LayoutTests/http/tests/security/cross-origin-worker-indexeddb.html
LayoutTests/http/tests/security/resources/cross-origin-iframe-for-worker-indexeddb.html
LayoutTests/http/tests/security/resources/document-for-cross-origin-worker-indexeddb.html
LayoutTests/http/tests/security/resources/worker-for-indexeddb.js
LayoutTests/storage/indexeddb/basics-workers.html
LayoutTests/storage/indexeddb/cursor-advance-workers-expected.txt
LayoutTests/storage/indexeddb/cursor-advance-workers.html
LayoutTests/storage/indexeddb/deletedatabase-delayed-by-open-and-versionchange-workers.html
LayoutTests/storage/indexeddb/dont-commit-on-blocked-private.html
LayoutTests/storage/indexeddb/dont-commit-on-blocked.html
LayoutTests/storage/indexeddb/factory-basics-workers.html
LayoutTests/storage/indexeddb/index-basics-workers-expected.txt
LayoutTests/storage/indexeddb/index-basics-workers.html
LayoutTests/storage/indexeddb/modern/workers-disabled.html
LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt
LayoutTests/storage/indexeddb/objectstore-basics-workers.html
LayoutTests/storage/indexeddb/open-twice-workers.html
LayoutTests/storage/indexeddb/pending-activity-workers.html
LayoutTests/storage/indexeddb/pending-version-change-on-exit-private.html
LayoutTests/storage/indexeddb/pending-version-change-on-exit.html
LayoutTests/storage/indexeddb/pending-version-change-stuck-private.html
LayoutTests/storage/indexeddb/pending-version-change-stuck-works-with-terminate-private.html
LayoutTests/storage/indexeddb/pending-version-change-stuck-works-with-terminate.html
LayoutTests/storage/indexeddb/pending-version-change-stuck.html
LayoutTests/storage/indexeddb/transaction-complete-workers-expected.txt
LayoutTests/storage/indexeddb/transaction-complete-workers-private-expected.txt
LayoutTests/storage/indexeddb/transaction-complete-workers-private.html
LayoutTests/storage/indexeddb/transaction-complete-workers.html
LayoutTests/storage/indexeddb/unprefix-workers.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBRequest.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp
Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h
Source/WebCore/Modules/indexeddb/client/TransactionOperation.h
Source/WebCore/page/SecurityOrigin.h
Source/WebCore/workers/WorkerGlobalScope.cpp