Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easie...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Feb 2018 19:35:13 +0000 (19:35 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 5 Feb 2018 19:35:13 +0000 (19:35 +0000)
commit7d14b6d089de624601e33605ef88ecb5296f08a8
tree9d81c263448a9a94565c889f0b846c4549495c15
parent03b525f68b415474a497b59debf1968f69a46404
Storage Access API: Add testRunner.getAllStorageAccessEntries() to make testing easier and more explicit
https://bugs.webkit.org/show_bug.cgi?id=181601
<rdar://problem/36475837>

Reviewed by Alex Christensen.

Source/WebCore:

No new tests. Existing test updated.

http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
it's possible to check access even if a frame doesn't respond timely to
postMessage after detach and attach.

* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::getAllStorageAccessEntries const):

Source/WebKit:

http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
it's possible to check access even if a frame doesn't respond timely to
postMessage after detach and attach.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::getAllStorageAccessEntries):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _getAllStorageAccessEntries:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getAllStorageAccessEntries):
(WebKit::NetworkProcessProxy::allStorageAccessEntriesResult):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::getAllStorageAccessEntries):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
it's possible to check access even if a frame doesn't respond timely to
postMessage after detach and attach.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStorageAccessAPIEnabled):
    Just moved for source file grouping.
(WTR::TestRunner::getAllStorageAccessEntries):
(WTR::TestRunner::callDidReceiveAllStorageAccessEntriesCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::getAllStorageAccessEntries):
    Note that this is just stubbed out, i.e. not implemented.
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestInvocation::didReceiveAllStorageAccessEntries):
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::getAllStorageAccessEntries):
    This is the Cocoa-specific version of this test infrastructure.

LayoutTests:

http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
was found to be flaky. With the testRunner.hasStorageAccessEntry() getter
it's possible to check access even if a frame doesn't respond timely to
postMessage after detach and attach.

* http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access-expected.txt:
* http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html:
* platform/mac-wk2/TestExpectations:
    http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access.html
    no longer marked as flaky. Note that the wrong test was marked flaky. It should have been
    http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access-expected.txt
LayoutTests/http/tests/storageAccess/request-and-grant-access-then-detach-should-not-have-access.html
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/network/NetworkStorageSession.h
Source/WebCore/platform/network/cf/NetworkStorageSessionCFNet.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/NetworkProcess/NetworkProcess.h
Source/WebKit/NetworkProcess/NetworkProcess.messages.in
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestController.h
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/TestInvocation.h
Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm