Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Resource Load Statistics: Make testRunner.statisticsResetToConsistent…
…State() take a completion handler

https://bugs.webkit.org/show_bug.cgi?id=187499
<rdar://problem/41999431>

Reviewed by Chris Dumez.

Source/WebKit:

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsResetToConsistentState):
    Now uses a WTF::CallbackAggregator to call its
    completion handler when both the call to
    WebResourceLoadStatisticsStore::scheduleClearInMemory()
    and to
    WebResourceLoadStatisticsStore::resetParametersToDefaultValues()
    are complete.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory):
    Now takes a WTF::CompletionHandler so that it can support the
    completion handler in
    WKWebsiteDataStoreStatisticsResetToConsistentState().
(WebKit::WebResourceLoadStatisticsStore::resetParametersToDefaultValues):
    Now takes a WTF::CompletionHandler so that it can support the
    completion handler in
    WKWebsiteDataStoreStatisticsResetToConsistentState().
* UIProcess/WebResourceLoadStatisticsStore.h:

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::statisticsResetToConsistentState):
(WTR::TestRunner::statisticsCallDidResetToConsistentStateCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::statisticsResetToConsistentState):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didResetStatisticsToConsistentState):
* WebKitTestRunner/TestInvocation.h:

LayoutTests:

These changes are to adopt and make use of the new completion handler in
testRunner.statisticsResetToConsistentState().

* 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/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/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.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/sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.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-in-cross-origin-sub-frame.html:
* http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html:
* http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal.html:


Canonical link: https://commits.webkit.org/202750@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
johnwilander committed Jul 10, 2018
1 parent 25591d0 commit 03d41a5
Show file tree
Hide file tree
Showing 67 changed files with 771 additions and 485 deletions.
65 changes: 65 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,68 @@
2018-07-10 John Wilander <wilander@apple.com>

Resource Load Statistics: Make testRunner.statisticsResetToConsistentState() take a completion handler
https://bugs.webkit.org/show_bug.cgi?id=187499
<rdar://problem/41999431>

Reviewed by Chris Dumez.

These changes are to adopt and make use of the new completion handler in
testRunner.statisticsResetToConsistentState().

* 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/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/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.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/sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html:
* http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.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-in-cross-origin-sub-frame.html:
* http/tests/resourceLoadStatistics/user-interaction-only-reported-once-within-short-period-of-time.html:
* http/tests/resourceLoadStatistics/user-interaction-reported-after-website-data-removal.html:

2018-07-10 Truitt Savell <tsavell@apple.com>

[ MacOS Debug ] Layout Test media/media-fragments/TC0015.html is flaky
Expand Down
Expand Up @@ -9,11 +9,13 @@
description("Tests that blocking is added mid-flight in redirects.");
jsTestIsAsync = true;

function setEnableFeature(enable) {
if (!enable)
testRunner.statisticsResetToConsistentState();
function setEnableFeature(enable, completionHandler) {
internals.setResourceLoadStatisticsEnabled(enable);
testRunner.setCookieStoragePartitioningEnabled(enable);
if (!enable)
testRunner.statisticsResetToConsistentState(completionHandler);
else
completionHandler();
}

const partitionHost = "127.0.0.1:8000";
Expand Down Expand Up @@ -89,20 +91,20 @@
openIframe(redirectChainUrl + "&message=Redirect case 3, after attempted cookie creation, should receive no cookie.", runTest);
break;
case "#step10":
setEnableFeature(false);
finishJSTest();
setEnableFeature(false, finishJSTest);
break;
}
}

if (document.location.hash === "") {
setEnableFeature(true);
if (testRunner.isStatisticsPrevalentResource("http://localhost"))
testFailed("Localhost was classified as prevalent resource before the test starts.");
testRunner.dumpChildFramesAsText();
document.location.hash = "step1";
// Make sure the network process is up-to-date.
testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false, runTest);
setEnableFeature(true, function () {
if (testRunner.isStatisticsPrevalentResource("http://localhost"))
testFailed("Localhost was classified as prevalent resource before the test starts.");
testRunner.dumpChildFramesAsText();
document.location.hash = "step1";
// Make sure the network process is up-to-date.
testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false, runTest);
});
} else {
runTest();
}
Expand Down
Expand Up @@ -9,11 +9,13 @@
description("Tests that partitioning is added mid-flight in redirects.");
jsTestIsAsync = true;

function setEnableFeature(enable) {
if (!enable)
testRunner.statisticsResetToConsistentState();
function setEnableFeature(enable, completionHandler) {
internals.setResourceLoadStatisticsEnabled(enable);
testRunner.setCookieStoragePartitioningEnabled(enable);
if (!enable)
testRunner.statisticsResetToConsistentState(completionHandler);
else
completionHandler();
}

const partitionHost = "127.0.0.1:8000";
Expand Down Expand Up @@ -97,13 +99,14 @@
}

if (document.location.hash === "") {
setEnableFeature(true);
if (testRunner.isStatisticsPrevalentResource("http://localhost"))
testFailed("Localhost was classified as prevalent resource before the test started.");
testRunner.dumpChildFramesAsText();
document.location.hash = "step1";
// Make sure the network process is up-to-date.
testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false, runTest);
setEnableFeature(true, function () {
if (testRunner.isStatisticsPrevalentResource("http://localhost"))
testFailed("Localhost was classified as prevalent resource before the test started.");
testRunner.dumpChildFramesAsText();
document.location.hash = "step1";
// Make sure the network process is up-to-date.
testRunner.statisticsSetShouldPartitionCookiesForHost("localhost", false, runTest);
});
} else {
runTest();
}
Expand Down
Expand Up @@ -19,8 +19,9 @@
else
testPassed("Host did not get classified as prevalent resource.");

testRunner.statisticsResetToConsistentState();
testRunner.notifyDone();
testRunner.statisticsResetToConsistentState(function() {
testRunner.notifyDone();
});
}

function runTestRunnerTest() {
Expand Down
Expand Up @@ -19,8 +19,9 @@
else
testPassed("Host did not get classified as prevalent resource.");

testRunner.statisticsResetToConsistentState();
testRunner.notifyDone();
testRunner.statisticsResetToConsistentState(function() {
testRunner.notifyDone();
});
}

function runTestRunnerTest() {
Expand Down
Expand Up @@ -18,8 +18,9 @@
else
testPassed("Host did not get classified as prevalent resource.");

testRunner.statisticsResetToConsistentState();
testRunner.notifyDone();
testRunner.statisticsResetToConsistentState(function() {
testRunner.notifyDone();
});
}

function runTestRunnerTest() {
Expand Down
Expand Up @@ -18,9 +18,10 @@
else
testPassed("Host did not get classified as prevalent resource.");

testRunner.statisticsResetToConsistentState();
internals.setResourceLoadStatisticsEnabled(false);
testRunner.notifyDone();
testRunner.statisticsResetToConsistentState(function() {
testRunner.notifyDone();
});
}

function runTestRunnerTest() {
Expand Down
Expand Up @@ -22,9 +22,10 @@
else
testPassed("Host classified as prevalent resource.");

testRunner.statisticsResetToConsistentState();
internals.setResourceLoadStatisticsEnabled(false);
testRunner.notifyDone();
testRunner.statisticsResetToConsistentState(function() {
testRunner.notifyDone();
});
}

function runTestRunnerTest() {
Expand Down
Expand Up @@ -22,9 +22,10 @@
else
testPassed("Host classified as prevalent resource.");

testRunner.statisticsResetToConsistentState();
internals.setResourceLoadStatisticsEnabled(false);
testRunner.notifyDone();
testRunner.statisticsResetToConsistentState(function() {
testRunner.notifyDone();
});
}

function runTestRunnerTest() {
Expand Down
Expand Up @@ -16,11 +16,13 @@
const subresourceOrigin3 = "http://127.0.0.4:8000/temp";
const subresourceOrigin4 = "http://127.0.0.5:8000/temp";

function setEnableFeature(enable) {
if (!enable)
testRunner.statisticsResetToConsistentState();
function setEnableFeature(enable, completionHandler) {
internals.setResourceLoadStatisticsEnabled(enable);
testRunner.setCookieStoragePartitioningEnabled(enable);
if (!enable)
testRunner.statisticsResetToConsistentState(completionHandler);
else
completionHandler();
}

function runTest() {
Expand Down Expand Up @@ -55,16 +57,16 @@
if (testRunner.isStatisticsVeryPrevalentResource("http://localhost:8000"))
testFailed("Colluding localhost got classified as very prevalent resource.");

setEnableFeature(false);
finishJSTest();
setEnableFeature(false, finishJSTest);
}

if (document.location.host === hostUnderTest && window.testRunner && window.internals) {
setEnableFeature(true);
setEnableFeature(true, function () {
testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
testFailed("Host did not get set as non-prevalent resource.");

testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
testFailed("Host did not get set as non-prevalent resource.");
});
}
</script>
<iframe onload="runTest()" src="http://localhost:8000/resourceLoadStatistics/resources/redirect.php?redirectTo=http://127.0.0.1:8000/resourceLoadStatistics/onclick.html"></iframe>
Expand Down
Expand Up @@ -13,11 +13,13 @@
const statisticsUrl = "http://" + hostUnderTest + "/temp";
const topFrameOrigin1 = "http://127.0.0.2:8000/temp";

function setEnableFeature(enable) {
if (!enable)
testRunner.statisticsResetToConsistentState();
function setEnableFeature(enable, completionHandler) {
internals.setResourceLoadStatisticsEnabled(enable);
testRunner.setCookieStoragePartitioningEnabled(enable);
if (!enable)
testRunner.statisticsResetToConsistentState(completionHandler);
else
completionHandler();
}

function completeTest() {
Expand All @@ -28,8 +30,7 @@
else
testPassed("Host classified as prevalent resource.");

setEnableFeature(false);
finishJSTest();
setEnableFeature(false, finishJSTest);
}

function runTest() {
Expand All @@ -41,13 +42,14 @@
}

if (document.location.host === hostUnderTest && window.testRunner && window.internals) {
setEnableFeature(true);
testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);

testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
testFailed("Host did not get set as non-prevalent resource.");
runTest();
setEnableFeature(true, function() {
testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);

testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
testFailed("Host did not get set as non-prevalent resource.");
runTest();
});
}
</script>
</body>
Expand Down
Expand Up @@ -22,9 +22,10 @@
else
testPassed("Host classified as prevalent resource.");

testRunner.statisticsResetToConsistentState();
internals.setResourceLoadStatisticsEnabled(false);
testRunner.notifyDone();
testRunner.statisticsResetToConsistentState(function() {
testRunner.notifyDone();
});
}

function runTestRunnerTest() {
Expand Down
Expand Up @@ -22,9 +22,10 @@
else
testPassed("Host classified as prevalent resource.");

testRunner.statisticsResetToConsistentState();
internals.setResourceLoadStatisticsEnabled(false);
testRunner.notifyDone();
testRunner.statisticsResetToConsistentState(function() {
testRunner.notifyDone();
});
}

function runTestRunnerTest() {
Expand Down
Expand Up @@ -17,11 +17,13 @@
const topFrameOrigin4 = "http://127.0.0.5:8000/temp";
const topFrameOrigin5 = "http://localhost:8000/";

function setEnableFeature(enable) {
if (!enable)
testRunner.statisticsResetToConsistentState();
function setEnableFeature(enable, completionHandler) {
internals.setResourceLoadStatisticsEnabled(enable);
testRunner.setCookieStoragePartitioningEnabled(enable);
if (!enable)
testRunner.statisticsResetToConsistentState(completionHandler);
else
completionHandler();
}

function runTest() {
Expand Down Expand Up @@ -54,18 +56,17 @@
if (testRunner.isStatisticsVeryPrevalentResource(topFrameOrigin5))
testFailed("Colluding localhost got classified as very prevalent resource.");

setEnableFeature(false);
finishJSTest();
setEnableFeature(false, finishJSTest);
}

if (document.location.hash === "" && window.testRunner && window.internals) {
setEnableFeature(true);

testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
testFailed("Host did not get set as non-prevalent resource.");
setEnableFeature(true, function() {
testRunner.setStatisticsPrevalentResource(statisticsUrl, false);
if (testRunner.isStatisticsPrevalentResource(statisticsUrl))
testFailed("Host did not get set as non-prevalent resource.");

document.location.href = topFrameOrigin5 + "resourceLoadStatistics/resources/redirect.php?redirectTo=http://127.0.0.1:8000/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html#continue";
document.location.href = topFrameOrigin5 + "resourceLoadStatistics/resources/redirect.php?redirectTo=http://127.0.0.1:8000/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html#continue";
});
} else {
testRunner.statisticsNotifyObserver();
runTest();
Expand Down

0 comments on commit 03d41a5

Please sign in to comment.