Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatistic...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2018 17:45:41 +0000 (17:45 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2018 17:45:41 +0000 (17:45 +0000)
commit4f6c8f99800ca7db3c54ae3fdc5972f1bc0c9a23
tree9205326bff7e0ddc25836666cdd6822fced13245
parentb3c319680250ec854f8abcdfd225aa069ddb8e32
Add completion handlers to TestRunner functions setStatisticsLastSeen(), setStatisticsPrevalentResource(), setStatisticsVeryPrevalentResource(), setStatisticsHasHadUserInteraction(), and setStatisticsHasHadNonRecentUserInteraction()
https://bugs.webkit.org/show_bug.cgi?id=187710
<rdar://problem/42252757>

Reviewed by Chris Dumez.

Source/WebKit:

These changes are to back the completion handler functionality of
TestRunner functions:
- setStatisticsLastSeen(),
- setStatisticsPrevalentResource(),
- setStatisticsVeryPrevalentResource(),
- setStatisticsHasHadUserInteraction(), and
- setStatisticsHasHadNonRecentUserInteraction().

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsLastSeen):
(WKWebsiteDataStoreSetStatisticsPrevalentResource):
(WKWebsiteDataStoreSetStatisticsVeryPrevalentResource):
(WKWebsiteDataStoreSetStatisticsHasHadUserInteraction):
(WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::clearUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::setLastSeen):
(WebKit::WebResourceLoadStatisticsStore::setPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::setVeryPrevalentResource):
(WebKit::WebResourceLoadStatisticsStore::clearPrevalentResource):
* UIProcess/WebResourceLoadStatisticsStore.h:

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsLastSeen):
(WTR::TestRunner::statisticsCallDidSetLastSeenCallback):
(WTR::TestRunner::setStatisticsPrevalentResource):
(WTR::TestRunner::statisticsCallDidSetPrevalentResourceCallback):
(WTR::TestRunner::setStatisticsVeryPrevalentResource):
(WTR::TestRunner::statisticsCallDidSetVeryPrevalentResourceCallback):
(WTR::TestRunner::setStatisticsHasHadUserInteraction):
(WTR::TestRunner::setStatisticsHasHadNonRecentUserInteraction):
(WTR::TestRunner::statisticsCallDidSetHasHadUserInteractionCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsLastSeen):
(WTR::TestController::setStatisticsPrevalentResource):
(WTR::TestController::setStatisticsVeryPrevalentResource):
(WTR::TestController::setStatisticsHasHadUserInteraction):
(WTR::TestController::setStatisticsHasHadNonRecentUserInteraction):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didSetLastSeen):
(WTR::TestInvocation::didSetPrevalentResource):
(WTR::TestInvocation::didSetVeryPrevalentResource):
(WTR::TestInvocation::didSetHasHadUserInteraction):
(WTR::TestInvocation::didSetHasHadNonRecentUserInteraction):
* WebKitTestRunner/TestInvocation.h:

LayoutTests:

These changes are to update all test cases that make use of
TestRunner functions:
- setStatisticsLastSeen(),
- setStatisticsPrevalentResource(),
- setStatisticsVeryPrevalentResource(),
- setStatisticsHasHadUserInteraction(), and
- setStatisticsHasHadNonRecentUserInteraction().

* http/tests/resourceLoadStatistics/add-blocking-to-redirect.html:
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html:
* http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html:
* http/tests/resourceLoadStatistics/grandfathering.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html:
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout-expected.txt:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
* http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html:
* http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown.html:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction.html:
* http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction.html:
* http/tests/resourceLoadStatistics/prune-statistics.html:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html:
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html:
* http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests.html:
* http/tests/resourceLoadStatistics/telemetry-generation.html:
* http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html:
* http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
54 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
LayoutTests/http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-to-prevalent.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-to-prevalent.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to.html
LayoutTests/http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html
LayoutTests/http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html
LayoutTests/http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html
LayoutTests/http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html
LayoutTests/http/tests/resourceLoadStatistics/grandfathering.html
LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html
LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html
LayoutTests/http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
LayoutTests/http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html
LayoutTests/http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout-expected.txt
LayoutTests/http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html
LayoutTests/http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html
LayoutTests/http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html
LayoutTests/http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown.html
LayoutTests/http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html
LayoutTests/http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction.html
LayoutTests/http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction.html
LayoutTests/http/tests/resourceLoadStatistics/prune-statistics.html
LayoutTests/http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
LayoutTests/http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html
LayoutTests/http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-redirects.html
LayoutTests/http/tests/resourceLoadStatistics/strip-referrer-to-origin-for-prevalent-subresource-requests.html
LayoutTests/http/tests/resourceLoadStatistics/telemetry-generation.html
LayoutTests/http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html
LayoutTests/http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.cpp
Source/WebKit/UIProcess/API/C/WKWebsiteDataStoreRef.h
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.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/TestInvocation.cpp
Tools/WebKitTestRunner/TestInvocation.h