Skip to content
Permalink
Browse files
REGRESSION(r223253): Broke ResourceLoadStatistics layout tests for no…
…n-Cocoa ports

https://bugs.webkit.org/show_bug.cgi?id=181231

Reviewed by Alex Christensen.

Source/WebKit:

Add new C API for use by WebKitTestRunner.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:

Tools:

Implement TestController APIs needed by ResourceLoadStatistics tests.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::isStatisticsRegisteredAsSubFrameUnder):
(WTR::TestController::isStatisticsRegisteredAsRedirectingTo):

LayoutTests:

Unskip the tests.

* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:


Canonical link: https://commits.webkit.org/197070@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Michael Catanzaro committed Jan 3, 2018
1 parent 10cfbdb commit 7ac3b38bca365217a23694d82c7106c2c01eabab
@@ -1,3 +1,15 @@
2018-01-02 Michael Catanzaro <mcatanzaro@igalia.com>

REGRESSION(r223253): Broke ResourceLoadStatistics layout tests for non-Cocoa ports
https://bugs.webkit.org/show_bug.cgi?id=181231

Reviewed by Alex Christensen.

Unskip the tests.

* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

2018-01-02 Michael Catanzaro <mcatanzaro@igalia.com>

Unreviewed WPE test gardening.
@@ -2286,9 +2286,6 @@ fast/layers/prevent-hit-test-during-layout.html [ Skip ]
# This is a Mac specific feature
webkit.org/b/168466 http/tests/security/bypassing-cors-checks-for-extension-urls.html [ Skip ]

# Currently only has Objective-C API
http/tests/resourceLoadStatistics [ Skip ]

#////////////////////////////////////////////////////////////////////////////////////////
# End of tests with architecture-specific results
#////////////////////////////////////////////////////////////////////////////////////////
@@ -3337,6 +3334,8 @@ webkit.org/b/180803 imported/w3c/web-platform-tests/media-source/mediasource-dur

webkit.org/b/180805 inspector/canvas/requestContent-bitmaprenderer.html [ Failure ]

webkit.org/b/175189 http/tests/resourceLoadStatistics/grandfathering.html [ Failure ]

#////////////////////////////////////////////////////////////////////////////////////////
# End of non-crashing, non-flaky tests failing
#////////////////////////////////////////////////////////////////////////////////////////
@@ -1044,7 +1044,6 @@ http/tests/pointer-lock [ Skip ]
http/tests/preconnect [ Skip ]
http/tests/preload [ Skip ]
http/tests/quicklook [ Skip ]
http/tests/resourceLoadStatistics [ Skip ]
http/tests/security [ Skip ]
http/tests/ssl [ Skip ]
http/tests/svg [ Skip ]
@@ -1158,3 +1157,5 @@ webkit.org/b/180062 fast/text/user-installed-fonts/ [ ImageOnlyFailure ]
webkit.org/b/181224 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-setMediaKeys-after-update.html [ Crash ]
webkit.org/b/181224 imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-setmediakeys-multiple-times-with-the-same-mediakeys.html [ Crash ]
webkit.org/b/181225 media/encrypted-media/mock-MediaKeySystemAccess.html [ Crash ]

webkit.org/b/175189 http/tests/resourceLoadStatistics/grandfathering.html [ Failure ]
@@ -1,3 +1,17 @@
2018-01-02 Michael Catanzaro <mcatanzaro@igalia.com>

REGRESSION(r223253): Broke ResourceLoadStatistics layout tests for non-Cocoa ports
https://bugs.webkit.org/show_bug.cgi?id=181231

Reviewed by Alex Christensen.

Add new C API for use by WebKitTestRunner.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
(WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:

2018-01-02 Jiewen Tan <jiewen_tan@apple.com>

Add a WebAuthentication runtime feature flag
@@ -97,6 +97,32 @@ void WKWebsiteDataStoreIsStatisticsPrevalentResource(WKWebsiteDataStoreRef dataS
});
}

void WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder(WKWebsiteDataStoreRef dataStoreRef, WKStringRef subFrameHost, WKStringRef topFrameHost, void* context, WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnderFunction callback)
{
auto* store = WebKit::toImpl(dataStoreRef)->websiteDataStore().resourceLoadStatistics();
if (!store) {
callback(false, context);
return;
}

store->isRegisteredAsSubFrameUnder(WebCore::URL(WebCore::URL(), WebKit::toImpl(subFrameHost)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(topFrameHost)->string()), [context, callback](bool isRegisteredAsSubFrameUnder) {
callback(isRegisteredAsSubFrameUnder, context);
});
}

void WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo(WKWebsiteDataStoreRef dataStoreRef, WKStringRef hostRedirectedFrom, WKStringRef hostRedirectedTo, void* context, WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingToFunction callback)
{
auto* store = WebKit::toImpl(dataStoreRef)->websiteDataStore().resourceLoadStatistics();
if (!store) {
callback(false, context);
return;
}

store->isRegisteredAsRedirectingTo(WebCore::URL(WebCore::URL(), WebKit::toImpl(hostRedirectedFrom)->string()), WebCore::URL(WebCore::URL(), WebKit::toImpl(hostRedirectedTo)->string()), [context, callback](bool isRegisteredAsRedirectingTo) {
callback(isRegisteredAsRedirectingTo, context);
});
}

void WKWebsiteDataStoreSetStatisticsHasHadUserInteraction(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, bool value)
{
auto* store = WebKit::toImpl(dataStoreRef)->websiteDataStore().resourceLoadStatistics();
@@ -43,6 +43,10 @@ WK_EXPORT void WKWebsiteDataStoreSetStatisticsLastSeen(WKWebsiteDataStoreRef dat
WK_EXPORT void WKWebsiteDataStoreSetStatisticsPrevalentResource(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, bool value);
typedef void (*WKWebsiteDataStoreIsStatisticsPrevalentResourceFunction)(bool isPrevalentResource, void* functionContext);
WK_EXPORT void WKWebsiteDataStoreIsStatisticsPrevalentResource(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, void* context, WKWebsiteDataStoreIsStatisticsPrevalentResourceFunction callback);
typedef void (*WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnderFunction)(bool isRegisteredAsSubFrameUnder, void* functionContext);
WK_EXPORT void WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder(WKWebsiteDataStoreRef dataStoreRef, WKStringRef subFrameHost, WKStringRef topFrameHost, void* context, WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnderFunction callback);
typedef void (*WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingToFunction)(bool isRegisteredAsRedirectingTo, void* functionContext);
WK_EXPORT void WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo(WKWebsiteDataStoreRef dataStoreRef, WKStringRef hostRedirectedFrom, WKStringRef hostRedirectedTo, void* context, WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingToFunction callback);
WK_EXPORT void WKWebsiteDataStoreSetStatisticsHasHadUserInteraction(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host, bool value);
WK_EXPORT void WKWebsiteDataStoreSetStatisticsHasHadNonRecentUserInteraction(WKWebsiteDataStoreRef dataStoreRef, WKStringRef host);
typedef void (*WKWebsiteDataStoreIsStatisticsHasHadUserInteractionFunction)(bool hasHadUserInteraction, void* functionContext);
@@ -1,3 +1,16 @@
2018-01-02 Michael Catanzaro <mcatanzaro@igalia.com>

REGRESSION(r223253): Broke ResourceLoadStatistics layout tests for non-Cocoa ports
https://bugs.webkit.org/show_bug.cgi?id=181231

Reviewed by Alex Christensen.

Implement TestController APIs needed by ResourceLoadStatistics tests.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::isStatisticsRegisteredAsSubFrameUnder):
(WTR::TestController::isStatisticsRegisteredAsRedirectingTo):

2018-01-02 Tim Horton <timothy_horton@apple.com>

Disable WKAttachmentTests if UIPasteboard.itemProviders is not available
@@ -2484,14 +2484,24 @@ bool TestController::isStatisticsPrevalentResource(WKStringRef host)
return context.result;
}

bool TestController::isStatisticsRegisteredAsSubFrameUnder(WKStringRef, WKStringRef)
bool TestController::isStatisticsRegisteredAsSubFrameUnder(WKStringRef subFrameHost, WKStringRef topFrameHost)
{
return false;
auto* dataStore = WKContextGetWebsiteDataStore(platformContext());
ResourceStatisticsCallbackContext context(*this);
WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder(dataStore, subFrameHost, topFrameHost, &context, resourceStatisticsCallback);
if (!context.done)
runUntil(context.done, m_currentInvocation->shortTimeout());
return context.result;
}

bool TestController::isStatisticsRegisteredAsRedirectingTo(WKStringRef, WKStringRef)
bool TestController::isStatisticsRegisteredAsRedirectingTo(WKStringRef hostRedirectedFrom, WKStringRef hostRedirectedTo)
{
return false;
auto* dataStore = WKContextGetWebsiteDataStore(platformContext());
ResourceStatisticsCallbackContext context(*this);
WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo(dataStore, hostRedirectedFrom, hostRedirectedTo, &context, resourceStatisticsCallback);
if (!context.done)
runUntil(context.done, m_currentInvocation->shortTimeout());
return context.result;
}

void TestController::setStatisticsHasHadUserInteraction(WKStringRef host, bool value)

0 comments on commit 7ac3b38

Please sign in to comment.