Resource Load Statistics: User interaction should always go to top document
https://bugs.webkit.org/show_bug.cgi?id=174120
<rdar://problem/
33117899>
Patch by John Wilander <wilander@apple.com> on 2017-07-08
Reviewed by Chris Dumez.
Source/WebCore:
Test: http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
Now logs user interaction for the top document.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setThrottledObserverNotifications):
Test infrastructure.
(WebCore::ResourceLoadObserver::setNotificationCallback):
Callback now takes a ResourceLoadObserver::NotificationType.
(WebCore::ResourceLoadObserver::logFrameNavigation):
Submits the configured ResourceLoadObserver::NotificationType.
(WebCore::ResourceLoadObserver::logSubresourceLoading):
Submits the configured ResourceLoadObserver::NotificationType.
(WebCore::ResourceLoadObserver::logWebSocketLoading):
Submits the configured ResourceLoadObserver::NotificationType.
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
Submits the configured ResourceLoadObserver::NotificationType.
* loader/ResourceLoadObserver.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Resets to throttled notifications.
(WebCore::Internals::setResourceLoadStatisticsThrottledObserverNotifications):
Test infrastructure.
* testing/Internals.h:
* testing/Internals.idl:
Added internals.setResourceLoadStatisticsThrottledObserverNotifications().
LayoutTests:
* http/tests/loading/resourceLoadStatistics/resources/dummy.html: Added.
* http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame-expected.txt: Added.
* http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html: Added.
* platform/mac-wk2/TestExpectations:
Added as [ Pass ].
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219284
268f45cc-cd09-0410-ab3c-
d52691b4dbfc