Diff
Modified: trunk/LayoutTests/ChangeLog (223252 => 223253)
--- trunk/LayoutTests/ChangeLog 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/LayoutTests/ChangeLog 2017-10-12 20:13:00 UTC (rev 223253)
@@ -1,3 +1,52 @@
+2017-10-12 John Wilander <[email protected]>
+
+ ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
+ https://bugs.webkit.org/show_bug.cgi?id=175257
+ <rdar://problem/33359866>
+
+ Reviewed by Brent Fulgham.
+
+ * TestExpectations:
+ Marked new directory as [ Skip ] since these are WK2-only.
+ * http/tests/resourceLoadStatistics: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html: Added.
+ * http/tests/resourceLoadStatistics/resources: Added.
+ * http/tests/resourceLoadStatistics/resources/iframe-report-back-loaded.html: Added.
+ * http/tests/resourceLoadStatistics/resources/page-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html: Added.
+ * http/tests/resourceLoadStatistics/resources/page-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html: Added.
+ * http/tests/resourceLoadStatistics/resources/page-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html: Added.
+ * http/tests/resourceLoadStatistics/resources/page-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html: Added.
+ * http/tests/resourceLoadStatistics/resources/redirect.php: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip.html: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html: Added.
+ * platform/gtk/TestExpectations:
+ Marked new directory as [ Skip ].
+ * platform/wk2/TestExpectations:
+ Marked new directory as [ Pass ].
+ * platform/wpe/TestExpectations:
+ Marked new directory as [ Skip ].
+
2017-10-12 Matt Lewis <[email protected]>
Marked imported/w3c/web-platform-tests/fetch/security/dangling-markup-mitigation-data-url.tentative.sub.html as flaky on iOS.
Modified: trunk/LayoutTests/TestExpectations (223252 => 223253)
--- trunk/LayoutTests/TestExpectations 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/LayoutTests/TestExpectations 2017-10-12 20:13:00 UTC (rev 223253)
@@ -87,6 +87,7 @@
http/tests/appcache/decide-navigation-policy-after-delay.html [ Skip ]
http/tests/misc/will-send-request-with-client-provided-http-body.html [ Skip ]
http/tests/loading/resourceLoadStatistics/ [ Skip ]
+http/tests/resourceLoadStatistics/ [ Skip ]
http/tests/storageAccess/ [ Skip ]
# Only Mac and iOS have an implementation of UIScriptController::doAsyncTask().
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for a non-sandboxed iframe get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for a non-sandboxed iframe get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "http://127.0.0.1:8000") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for a non-sandboxed iframe get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for a non-sandboxed iframe get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "http://localhost:8000") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for a non-sandboxed iframe nested in a non-sandboxed iframe get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for a non-sandboxed iframe nested in a non-sandboxed iframe get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "http://127.0.0.1:8000") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for a non-sandboxed iframe nested in a non-sandboxed iframe get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for a non-sandboxed iframe nested in a non-sandboxed iframe get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "http://localhost:8000") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for a sandboxed iframe nested in a non-sandboxed iframe get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for a sandboxed iframe nested in a non-sandboxed iframe get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "null") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for a sandboxed iframe nested in a non-sandboxed iframe get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/non-sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for a sandboxed iframe nested in a non-sandboxed iframe get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "null") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/iframe-report-back-loaded.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/iframe-report-back-loaded.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/iframe-report-back-loaded.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body _onload_="reportBackLoadedToTopFrame()">
+<script>
+ function reportBackLoadedToTopFrame() {
+ top.postMessage("PASS Frame loaded.", "http:127.0.0.1:8000");
+ }
+</script>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<iframe src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<iframe src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<iframe sandbox="allow-scripts" src=""
+</iframe>
+</body>
+</html>
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/page-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<iframe sandbox="allow-scripts" src=""
+</iframe>
+</body>
+</html>
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/redirect.php (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/redirect.php (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/resources/redirect.php 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,4 @@
+<?php
+header('Location: ' . $_GET["redirectTo"]);
+die();
+?>
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for sandboxed iframes get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-ip-to-localhost-to-ip.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for sandboxed iframes get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "null") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe sandbox="allow-scripts" src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for sandboxed iframes get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for sandboxed iframes get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "null") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe sandbox="allow-scripts" src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for a non-sandboxed iframe nested in a sandboxed iframe get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for a non-sandboxed iframe nested in a sandboxed iframe get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "null") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe sandbox="allow-scripts" src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for a non-sandboxed iframe nested in a sandboxed iframe get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-non-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for a non-sandboxed iframe nested in a sandboxed iframe get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "null") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe sandbox="allow-scripts" src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for a sandboxed iframe nested in a non-sandboxed iframe get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-ip-to-localhost-to-ip.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for a sandboxed iframe nested in a non-sandboxed iframe get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "null") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe sandbox="allow-scripts" src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost-expected.txt 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,12 @@
+Tests that redirects for a sandboxed iframe nested in a non-sandboxed iframe get counted properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1") is true
+PASS testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost") is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (0 => 223253)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/sandboxed-nesting-iframe-with-sandboxed-iframe-redirect-localhost-to-ip-to-localhost.html 2017-10-12 20:13:00 UTC (rev 223253)
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src=""
+ <script src=""
+ <script>
+ description("Tests that redirects for a sandboxed iframe nested in a non-sandboxed iframe get counted properly.");
+ jsTestIsAsync = true;
+ window.addEventListener("message", receiveMessage, false);
+ if (testRunner) {
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(checkStats);
+ }
+
+ var testPhasesDone = 0;
+
+ function receiveMessage(event) {
+ if (event.origin === "null") {
+ if (event.data.indexOf("PASS") === -1)
+ testFailed(event.data.replace("FAIL ", ""));
+ } else
+ testFailed("Received a message from an unexpected origin: " + event.origin);
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+
+ function checkStats() {
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://localhost", "http://127.0.0.1")');
+ shouldBeTrue('testRunner.isStatisticsRegisteredAsRedirectingTo("http://127.0.0.1", "http://localhost")');
+ ++testPhasesDone;
+ if (testPhasesDone === 2)
+ finishJSTest();
+ }
+ </script>
+</head>
+<body>
+<iframe sandbox="allow-scripts" src=""
+</iframe>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/LayoutTests/platform/gtk/TestExpectations (223252 => 223253)
--- trunk/LayoutTests/platform/gtk/TestExpectations 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/LayoutTests/platform/gtk/TestExpectations 2017-10-12 20:13:00 UTC (rev 223253)
@@ -2274,6 +2274,9 @@
# 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
#////////////////////////////////////////////////////////////////////////////////////////
Modified: trunk/LayoutTests/platform/wk2/TestExpectations (223252 => 223253)
--- trunk/LayoutTests/platform/wk2/TestExpectations 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/LayoutTests/platform/wk2/TestExpectations 2017-10-12 20:13:00 UTC (rev 223253)
@@ -690,6 +690,7 @@
webkit.org/b/173499 http/tests/loading/resourceLoadStatistics/telemetry-generation.html [ Pass Failure ]
http/tests/loading/resourceLoadStatistics/prune-statistics.html [ Pass ]
http/tests/storageAccess/request-storage-access-top-frame.html [ Pass ]
+http/tests/resourceLoadStatistics [ Pass ]
### END OF (5) Progressions, expected successes that are expected failures in WebKit1.
########################################
Modified: trunk/LayoutTests/platform/wpe/TestExpectations (223252 => 223253)
--- trunk/LayoutTests/platform/wpe/TestExpectations 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/LayoutTests/platform/wpe/TestExpectations 2017-10-12 20:13:00 UTC (rev 223253)
@@ -876,6 +876,7 @@
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 ]
Modified: trunk/Source/WebCore/ChangeLog (223252 => 223253)
--- trunk/Source/WebCore/ChangeLog 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Source/WebCore/ChangeLog 2017-10-12 20:13:00 UTC (rev 223253)
@@ -1,3 +1,36 @@
+2017-10-12 John Wilander <[email protected]>
+
+ ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
+ https://bugs.webkit.org/show_bug.cgi?id=175257
+ <rdar://problem/33359866>
+
+ Reviewed by Brent Fulgham.
+
+ This patch was joint work between Michael Specter and John Wilander.
+
+ Tests: 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/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
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::willSendRequest):
+ Now sends redirectResponse.url() to WebCore::ResourceLoadObserver::logFrameNavigation().
+ * loader/ResourceLoadObserver.cpp:
+ (WebCore::ResourceLoadObserver::logFrameNavigation):
+ Now receives the redirect response URL from WebCore::DocumentLoader().
+ (WebCore::ResourceLoadObserver::nonNullOwnerURL const):
+ New function to traverse the frame chain upward and find the first non-null URL.
+ * loader/ResourceLoadObserver.h:
+
2017-10-12 Frederic Wang <[email protected]>
Use less specific cast in ScrollingTree::scrollPositionChangedViaDelegatedScrolling
Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (223252 => 223253)
--- trunk/Source/WebCore/loader/DocumentLoader.cpp 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp 2017-10-12 20:13:00 UTC (rev 223253)
@@ -512,7 +512,7 @@
ASSERT(m_frame->document());
ASSERT(topFrame.document());
- ResourceLoadObserver::shared().logFrameNavigation(*m_frame, topFrame, newRequest);
+ ResourceLoadObserver::shared().logFrameNavigation(*m_frame, topFrame, newRequest, redirectResponse.url());
// Update cookie policy base URL as URL changes, except for subframes, which use the
// URL of the main frame which doesn't change when we redirect.
Modified: trunk/Source/WebCore/loader/ResourceLoadObserver.cpp (223252 => 223253)
--- trunk/Source/WebCore/loader/ResourceLoadObserver.cpp 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Source/WebCore/loader/ResourceLoadObserver.cpp 2017-10-12 20:13:00 UTC (rev 223253)
@@ -28,6 +28,8 @@
#include "Document.h"
#include "Frame.h"
+#include "FrameLoader.h"
+#include "HTMLFrameOwnerElement.h"
#include "Logging.h"
#include "MainFrame.h"
#include "Page.h"
@@ -129,7 +131,7 @@
return WallTime::fromRawSeconds(std::floor(time.secondsSinceEpoch() / timestampResolution) * timestampResolution.seconds());
}
-void ResourceLoadObserver::logFrameNavigation(const Frame& frame, const Frame& topFrame, const ResourceRequest& newRequest)
+void ResourceLoadObserver::logFrameNavigation(const Frame& frame, const Frame& topFrame, const ResourceRequest& newRequest, const URL& redirectUrl)
{
ASSERT(frame.document());
ASSERT(topFrame.document());
@@ -142,7 +144,11 @@
if (!shouldLog(page))
return;
- auto& sourceURL = frame.document()->url();
+ auto sourceURL = redirectUrl;
+ bool isRedirect = !redirectUrl.isNull();
+ if (!isRedirect)
+ sourceURL = nonNullOwnerURL(*frame.document());
+
auto& targetURL = newRequest.url();
auto& mainFrameURL = topFrame.document()->url();
@@ -152,20 +158,30 @@
auto targetHost = targetURL.host();
auto mainFrameHost = mainFrameURL.host();
- if (targetHost.isEmpty() || mainFrameHost.isEmpty() || targetHost == mainFrameHost || targetHost == sourceURL.host())
+ if (targetHost.isEmpty() || mainFrameHost.isEmpty() || targetHost == sourceURL.host())
return;
auto targetPrimaryDomain = primaryDomain(targetURL);
auto mainFramePrimaryDomain = primaryDomain(mainFrameURL);
auto sourcePrimaryDomain = primaryDomain(sourceURL);
-
- if (areDomainsAssociated(page, targetPrimaryDomain, mainFramePrimaryDomain) || areDomainsAssociated(page, targetPrimaryDomain, sourcePrimaryDomain))
- return;
+ bool shouldCallNotificationCallback = false;
- auto& targetStatistics = ensureResourceStatisticsForPrimaryDomain(targetPrimaryDomain);
- targetStatistics.lastSeen = reduceToHourlyTimeResolution(WallTime::now());
- auto subframeUnderTopFrameOriginsResult = targetStatistics.subframeUnderTopFrameOrigins.add(mainFramePrimaryDomain);
- if (subframeUnderTopFrameOriginsResult.isNewEntry)
+ if (targetHost != mainFrameHost
+ && !(areDomainsAssociated(page, targetPrimaryDomain, mainFramePrimaryDomain) || areDomainsAssociated(page, targetPrimaryDomain, sourcePrimaryDomain))) {
+ auto& targetStatistics = ensureResourceStatisticsForPrimaryDomain(targetPrimaryDomain);
+ targetStatistics.lastSeen = reduceToHourlyTimeResolution(WallTime::now());
+ if (targetStatistics.subframeUnderTopFrameOrigins.add(mainFramePrimaryDomain).isNewEntry)
+ shouldCallNotificationCallback = true;
+ }
+
+ if (isRedirect
+ && !areDomainsAssociated(page, sourcePrimaryDomain, targetPrimaryDomain)) {
+ auto& redirectingOriginStatistics = ensureResourceStatisticsForPrimaryDomain(sourcePrimaryDomain);
+ if (redirectingOriginStatistics.subresourceUniqueRedirectsTo.add(targetPrimaryDomain).isNewEntry)
+ shouldCallNotificationCallback = true;
+ }
+
+ if (shouldCallNotificationCallback)
scheduleNotificationIfNeeded();
}
@@ -339,4 +355,24 @@
m_lastReportedUserInteractionMap.clear();
}
+URL ResourceLoadObserver::nonNullOwnerURL(const Document& document) const
+{
+ auto url = ""
+ auto* frame = document.frame();
+ auto host = document.url().host();
+
+ while ((host.isNull() || host.isEmpty()) && !frame->isMainFrame()) {
+ auto* ownerElement = frame->ownerElement();
+
+ ASSERT(ownerElement != nullptr);
+
+ auto& doc = ownerElement->document();
+ frame = doc.frame();
+ url = ""
+ host = url.host();
+ }
+
+ return url;
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/loader/ResourceLoadObserver.h (223252 => 223253)
--- trunk/Source/WebCore/loader/ResourceLoadObserver.h 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Source/WebCore/loader/ResourceLoadObserver.h 2017-10-12 20:13:00 UTC (rev 223253)
@@ -55,7 +55,7 @@
WEBCORE_EXPORT void setShouldThrottleObserverNotifications(bool);
- void logFrameNavigation(const Frame&, const Frame& topFrame, const ResourceRequest& newRequest);
+ void logFrameNavigation(const Frame&, const Frame& topFrame, const ResourceRequest& newRequest, const URL& redirectUrl);
void logSubresourceLoading(const Frame*, const ResourceRequest& newRequest, const ResourceResponse& redirectResponse);
void logWebSocketLoading(const Frame*, const URL&);
void logUserInteractionWithReducedTimeResolution(const Document&);
@@ -79,6 +79,8 @@
HashMap<String, WTF::WallTime> m_lastReportedUserInteractionMap;
WTF::Function<void (Vector<ResourceLoadStatistics>&&)> m_notificationCallback;
Timer m_notificationTimer;
+
+ URL nonNullOwnerURL(const Document&) const;
};
} // namespace WebCore
Modified: trunk/Source/WebKit/ChangeLog (223252 => 223253)
--- trunk/Source/WebKit/ChangeLog 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Source/WebKit/ChangeLog 2017-10-12 20:13:00 UTC (rev 223253)
@@ -1,3 +1,22 @@
+2017-10-12 John Wilander <[email protected]>
+
+ ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
+ https://bugs.webkit.org/show_bug.cgi?id=175257
+ <rdar://problem/33359866>
+
+ Reviewed by Brent Fulgham.
+
+ * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
+ (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:topFrameHost:completionHandler:]):
+ (-[WKWebsiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:hostRedirectedTo:completionHandler:]):
+ Test infrastructure.
+ * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
+ * UIProcess/WebResourceLoadStatisticsStore.cpp:
+ (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder):
+ (WebKit::WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo):
+ Test infrastructure.
+ * UIProcess/WebResourceLoadStatisticsStore.h:
+
2017-10-12 Andy Estes <[email protected]>
[iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm (223252 => 223253)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm 2017-10-12 20:13:00 UTC (rev 223253)
@@ -286,6 +286,34 @@
});
}
+- (void)_resourceLoadStatisticsIsRegisteredAsSubFrameUnder:(NSString *)subFrameHost topFrameHost:(NSString *)topFrameHost completionHandler:(void (^)(BOOL))completionHandler
+{
+ auto* store = _websiteDataStore->websiteDataStore().resourceLoadStatistics();
+ if (!store) {
+ completionHandler(NO);
+ return;
+ }
+
+ auto completionHandlerCopy = makeBlockPtr(completionHandler);
+ store->isRegisteredAsSubFrameUnder(URL(URL(), subFrameHost), URL(URL(), topFrameHost), [completionHandlerCopy](bool isRegisteredAsSubFrameUnder) {
+ completionHandlerCopy(isRegisteredAsSubFrameUnder);
+ });
+}
+
+- (void)_resourceLoadStatisticsIsRegisteredAsRedirectingTo:(NSString *)hostRedirectedFrom hostRedirectedTo:(NSString *)hostRedirectedTo completionHandler:(void (^)(BOOL))completionHandler
+{
+ auto* store = _websiteDataStore->websiteDataStore().resourceLoadStatistics();
+ if (!store) {
+ completionHandler(NO);
+ return;
+ }
+
+ auto completionHandlerCopy = makeBlockPtr(completionHandler);
+ store->isRegisteredAsRedirectingTo(URL(URL(), hostRedirectedFrom), URL(URL(), hostRedirectedTo), [completionHandlerCopy](bool isRegisteredAsRedirectingTo) {
+ completionHandlerCopy(isRegisteredAsRedirectingTo);
+ });
+}
+
- (void)_resourceLoadStatisticsSetHadUserInteraction:(BOOL)value forHost:(NSString *)host
{
auto* store = _websiteDataStore->websiteDataStore().resourceLoadStatistics();
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h (223252 => 223253)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h 2017-10-12 20:13:00 UTC (rev 223253)
@@ -52,6 +52,8 @@
- (void)_resourceLoadStatisticsSetLastSeen:(double)seconds forHost:(NSString *)host WK_API_AVAILABLE(macosx(10.13), ios(11.0));
- (void)_resourceLoadStatisticsSetIsPrevalentResource:(BOOL)value forHost:(NSString *)host WK_API_AVAILABLE(macosx(10.13), ios(11.0));
- (void)_resourceLoadStatisticsIsPrevalentResource:(NSString *)host completionHandler:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macosx(10.13), ios(11.0));
+- (void)_resourceLoadStatisticsIsRegisteredAsSubFrameUnder:(NSString *)subFrameHost topFrameHost:(NSString *)topFrameHost completionHandler:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+- (void)_resourceLoadStatisticsIsRegisteredAsRedirectingTo:(NSString *)hostRedirectedFrom hostRedirectedTo:(NSString *)hostRedirectedTo completionHandler:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
- (void)_resourceLoadStatisticsSetHadUserInteraction:(BOOL)value forHost:(NSString *)host WK_API_AVAILABLE(macosx(10.13), ios(11.0));
- (void)_resourceLoadStatisticsHadUserInteraction:(NSString *)host completionHandler:(void (^)(BOOL))completionHandler WK_API_AVAILABLE(macosx(10.13), ios(11.0));
- (void)_resourceLoadStatisticsSetIsGrandfathered:(BOOL)value forHost:(NSString *)host WK_API_AVAILABLE(macosx(10.13), ios(11.0));
Modified: trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp (223252 => 223253)
--- trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp 2017-10-12 20:13:00 UTC (rev 223253)
@@ -391,6 +391,28 @@
});
}
+void WebResourceLoadStatisticsStore::isRegisteredAsSubFrameUnder(const URL& subFrame, const URL& topFrame, WTF::Function<void (bool)>&& completionHandler)
+{
+ m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), subFramePrimaryDomain = isolatedPrimaryDomain(subFrame), topFramePrimaryDomain = isolatedPrimaryDomain(topFrame), completionHandler = WTFMove(completionHandler)] () mutable {
+ auto mapEntry = m_resourceStatisticsMap.find(subFramePrimaryDomain);
+ bool isRegisteredAsSubFrameUnder = mapEntry == m_resourceStatisticsMap.end() ? false : mapEntry->value.subframeUnderTopFrameOrigins.contains(topFramePrimaryDomain);
+ RunLoop::main().dispatch([isRegisteredAsSubFrameUnder, completionHandler = WTFMove(completionHandler)] {
+ completionHandler(isRegisteredAsSubFrameUnder);
+ });
+ });
+}
+
+void WebResourceLoadStatisticsStore::isRegisteredAsRedirectingTo(const URL& hostRedirectedFrom, const URL& hostRedirectedTo, WTF::Function<void (bool)>&& completionHandler)
+{
+ m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), hostRedirectedFromPrimaryDomain = isolatedPrimaryDomain(hostRedirectedFrom), hostRedirectedToPrimaryDomain = isolatedPrimaryDomain(hostRedirectedTo), completionHandler = WTFMove(completionHandler)] () mutable {
+ auto mapEntry = m_resourceStatisticsMap.find(hostRedirectedFromPrimaryDomain);
+ bool isRegisteredAsRedirectingTo = mapEntry == m_resourceStatisticsMap.end() ? false : mapEntry->value.subresourceUniqueRedirectsTo.contains(hostRedirectedToPrimaryDomain);
+ RunLoop::main().dispatch([isRegisteredAsRedirectingTo, completionHandler = WTFMove(completionHandler)] {
+ completionHandler(isRegisteredAsRedirectingTo);
+ });
+ });
+}
+
void WebResourceLoadStatisticsStore::clearPrevalentResource(const URL& url)
{
if (url.isBlankURL() || url.isEmpty())
Modified: trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h (223252 => 223253)
--- trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h 2017-10-12 20:13:00 UTC (rev 223253)
@@ -90,6 +90,8 @@
void setLastSeen(const WebCore::URL&, Seconds);
void setPrevalentResource(const WebCore::URL&);
void isPrevalentResource(const WebCore::URL&, WTF::Function<void (bool)>&&);
+ void isRegisteredAsSubFrameUnder(const WebCore::URL& subFrame, const WebCore::URL& topFrame, WTF::Function<void (bool)>&&);
+ void isRegisteredAsRedirectingTo(const WebCore::URL& hostRedirectedFrom, const WebCore::URL& hostRedirectedTo, WTF::Function<void (bool)>&&);
void clearPrevalentResource(const WebCore::URL&);
void setGrandfathered(const WebCore::URL&, bool);
void isGrandfathered(const WebCore::URL&, WTF::Function<void (bool)>&&);
Modified: trunk/Tools/ChangeLog (223252 => 223253)
--- trunk/Tools/ChangeLog 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Tools/ChangeLog 2017-10-12 20:13:00 UTC (rev 223253)
@@ -1,3 +1,30 @@
+2017-10-12 John Wilander <[email protected]>
+
+ ResourceLoadObserver::logFrameNavigation() should use redirectResponse.url()
+ https://bugs.webkit.org/show_bug.cgi?id=175257
+ <rdar://problem/33359866>
+
+ Reviewed by Brent Fulgham.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+ (WTR::TestRunner::isStatisticsRegisteredAsSubFrameUnder):
+ (WTR::TestRunner::isStatisticsRegisteredAsRedirectingTo):
+ * WebKitTestRunner/InjectedBundle/TestRunner.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::isStatisticsRegisteredAsSubFrameUnder):
+ Not implemented.
+ (WTR::TestController::isStatisticsRegisteredAsRedirectingTo):
+ Not implemented.
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
+ * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+ (WTR::TestController::isStatisticsRegisteredAsSubFrameUnder):
+ Implemented platform-specific.
+ (WTR::TestController::isStatisticsRegisteredAsRedirectingTo):
+ Implemented platform-specific.
+
2017-10-12 Andy Estes <[email protected]>
[iOS] Conditionally rename DatabaseProcess to StorageProcess when building for iOS devices
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (223252 => 223253)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2017-10-12 20:13:00 UTC (rev 223253)
@@ -265,6 +265,8 @@
void setStatisticsLastSeen(DOMString hostName, double seconds);
void setStatisticsPrevalentResource(DOMString hostName, boolean value);
boolean isStatisticsPrevalentResource(DOMString hostName);
+ boolean isStatisticsRegisteredAsSubFrameUnder(DOMString subFrameHost, DOMString topFrameHost);
+ boolean isStatisticsRegisteredAsRedirectingTo(DOMString hostRedirectedFrom, DOMString hostRedirectedTo);
void setStatisticsHasHadUserInteraction(DOMString hostName, boolean value);
boolean isStatisticsHasHadUserInteraction(DOMString hostName);
void setStatisticsGrandfathered(DOMString hostName, boolean value);
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (223252 => 223253)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2017-10-12 20:13:00 UTC (rev 223253)
@@ -1272,6 +1272,58 @@
return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData));
}
+bool TestRunner::isStatisticsRegisteredAsSubFrameUnder(JSStringRef subFrameHost, JSStringRef topFrameHost)
+{
+ Vector<WKRetainPtr<WKStringRef>> keys;
+ Vector<WKRetainPtr<WKTypeRef>> values;
+
+ keys.append({ AdoptWK, WKStringCreateWithUTF8CString("SubFrameHost") });
+ values.append({ AdoptWK, WKStringCreateWithJSString(subFrameHost) });
+
+ keys.append({ AdoptWK, WKStringCreateWithUTF8CString("TopFrameHost") });
+ values.append({ AdoptWK, WKStringCreateWithJSString(topFrameHost) });
+
+ Vector<WKStringRef> rawKeys(keys.size());
+ Vector<WKTypeRef> rawValues(values.size());
+
+ for (size_t i = 0; i < keys.size(); ++i) {
+ rawKeys[i] = keys[i].get();
+ rawValues[i] = values[i].get();
+ }
+
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsSubFrameUnder"));
+ WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
+ WKTypeRef returnData = 0;
+ WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
+ return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData));
+}
+
+bool TestRunner::isStatisticsRegisteredAsRedirectingTo(JSStringRef hostRedirectedFrom, JSStringRef hostRedirectedTo)
+{
+ Vector<WKRetainPtr<WKStringRef>> keys;
+ Vector<WKRetainPtr<WKTypeRef>> values;
+
+ keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostRedirectedFrom") });
+ values.append({ AdoptWK, WKStringCreateWithJSString(hostRedirectedFrom) });
+
+ keys.append({ AdoptWK, WKStringCreateWithUTF8CString("HostRedirectedTo") });
+ values.append({ AdoptWK, WKStringCreateWithJSString(hostRedirectedTo) });
+
+ Vector<WKStringRef> rawKeys(keys.size());
+ Vector<WKTypeRef> rawValues(values.size());
+
+ for (size_t i = 0; i < keys.size(); ++i) {
+ rawKeys[i] = keys[i].get();
+ rawValues[i] = values[i].get();
+ }
+
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("IsStatisticsRegisteredAsRedirectingTo"));
+ WKRetainPtr<WKDictionaryRef> messageBody(AdoptWK, WKDictionaryCreate(rawKeys.data(), rawValues.data(), rawKeys.size()));
+ WKTypeRef returnData = 0;
+ WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), messageBody.get(), &returnData);
+ return WKBooleanGetValue(static_cast<WKBooleanRef>(returnData));
+}
+
void TestRunner::setStatisticsHasHadUserInteraction(JSStringRef hostName, bool value)
{
Vector<WKRetainPtr<WKStringRef>> keys;
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (223252 => 223253)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2017-10-12 20:13:00 UTC (rev 223253)
@@ -369,6 +369,8 @@
void setStatisticsLastSeen(JSStringRef hostName, double seconds);
void setStatisticsPrevalentResource(JSStringRef hostName, bool value);
bool isStatisticsPrevalentResource(JSStringRef hostName);
+ bool isStatisticsRegisteredAsSubFrameUnder(JSStringRef subFrameHost, JSStringRef topFrameHost);
+ bool isStatisticsRegisteredAsRedirectingTo(JSStringRef hostRedirectedFrom, JSStringRef hostRedirectedTo);
void setStatisticsHasHadUserInteraction(JSStringRef hostName, bool value);
bool isStatisticsHasHadUserInteraction(JSStringRef hostName);
void setStatisticsGrandfathered(JSStringRef hostName, bool value);
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (223252 => 223253)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2017-10-12 20:13:00 UTC (rev 223253)
@@ -2357,6 +2357,16 @@
return context.result;
}
+bool TestController::isStatisticsRegisteredAsSubFrameUnder(WKStringRef, WKStringRef)
+{
+ return false;
+}
+
+bool TestController::isStatisticsRegisteredAsRedirectingTo(WKStringRef, WKStringRef)
+{
+ return false;
+}
+
void TestController::setStatisticsHasHadUserInteraction(WKStringRef host, bool value)
{
auto* dataStore = WKContextGetWebsiteDataStore(platformContext());
Modified: trunk/Tools/WebKitTestRunner/TestController.h (223252 => 223253)
--- trunk/Tools/WebKitTestRunner/TestController.h 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Tools/WebKitTestRunner/TestController.h 2017-10-12 20:13:00 UTC (rev 223253)
@@ -156,6 +156,8 @@
void setStatisticsLastSeen(WKStringRef hostName, double seconds);
void setStatisticsPrevalentResource(WKStringRef hostName, bool value);
bool isStatisticsPrevalentResource(WKStringRef hostName);
+ bool isStatisticsRegisteredAsSubFrameUnder(WKStringRef subFrameHost, WKStringRef topFrameHost);
+ bool isStatisticsRegisteredAsRedirectingTo(WKStringRef hostRedirectedFrom, WKStringRef hostRedirectedTo);
void setStatisticsHasHadUserInteraction(WKStringRef hostName, bool value);
bool isStatisticsHasHadUserInteraction(WKStringRef hostName);
void setStatisticsGrandfathered(WKStringRef hostName, bool value);
Modified: trunk/Tools/WebKitTestRunner/TestInvocation.cpp (223252 => 223253)
--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2017-10-12 20:13:00 UTC (rev 223253)
@@ -973,6 +973,36 @@
return result;
}
+ if (WKStringIsEqualToUTF8CString(messageName, "IsStatisticsRegisteredAsSubFrameUnder")) {
+ ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
+
+ WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
+ WKRetainPtr<WKStringRef> subFrameHostKey(AdoptWK, WKStringCreateWithUTF8CString("SubFrameHost"));
+ WKRetainPtr<WKStringRef> topFrameHostKey(AdoptWK, WKStringCreateWithUTF8CString("TopFrameHost"));
+
+ WKStringRef subFrameHost = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, subFrameHostKey.get()));
+ WKStringRef topFrameHost = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, topFrameHostKey.get()));
+
+ bool isRegisteredAsSubFrameUnder = TestController::singleton().isStatisticsRegisteredAsSubFrameUnder(subFrameHost, topFrameHost);
+ WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(isRegisteredAsSubFrameUnder));
+ return result;
+ }
+
+ if (WKStringIsEqualToUTF8CString(messageName, "IsStatisticsRegisteredAsRedirectingTo")) {
+ ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
+
+ WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
+ WKRetainPtr<WKStringRef> hostRedirectedFromKey(AdoptWK, WKStringCreateWithUTF8CString("HostRedirectedFrom"));
+ WKRetainPtr<WKStringRef> hostRedirectedToKey(AdoptWK, WKStringCreateWithUTF8CString("HostRedirectedTo"));
+
+ WKStringRef hostRedirectedFrom = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostRedirectedFromKey.get()));
+ WKStringRef hostRedirectedTo = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, hostRedirectedToKey.get()));
+
+ bool isRegisteredAsRedirectingTo = TestController::singleton().isStatisticsRegisteredAsRedirectingTo(hostRedirectedFrom, hostRedirectedTo);
+ WKRetainPtr<WKTypeRef> result(AdoptWK, WKBooleanCreate(isRegisteredAsRedirectingTo));
+ return result;
+ }
+
if (WKStringIsEqualToUTF8CString(messageName, "SetStatisticsHasHadUserInteraction")) {
ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (223252 => 223253)
--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2017-10-12 20:07:29 UTC (rev 223252)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm 2017-10-12 20:13:00 UTC (rev 223253)
@@ -272,6 +272,32 @@
return isPrevalentResource;
}
+bool TestController::isStatisticsRegisteredAsSubFrameUnder(WKStringRef subFrameHost, WKStringRef topFrameHost)
+{
+ __block bool isDataReady = false;
+ __block bool isRegisteredAsSubFrameUnder = false;
+ [globalWebViewConfiguration.websiteDataStore _resourceLoadStatisticsIsRegisteredAsSubFrameUnder:toNSString(subFrameHost) topFrameHost:toNSString(topFrameHost) completionHandler:^(BOOL _isRegisteredAsSubFrameUnder) {
+ isRegisteredAsSubFrameUnder = _isRegisteredAsSubFrameUnder;
+ isDataReady = true;
+ }];
+ platformRunUntil(isDataReady, 0);
+
+ return isRegisteredAsSubFrameUnder;
+}
+
+bool TestController::isStatisticsRegisteredAsRedirectingTo(WKStringRef hostRedirectedFrom, WKStringRef hostRedirectedTo)
+{
+ __block bool isDataReady = false;
+ __block bool isRegisteredAsRedirectingTo = false;
+ [globalWebViewConfiguration.websiteDataStore _resourceLoadStatisticsIsRegisteredAsRedirectingTo:toNSString(hostRedirectedFrom) hostRedirectedTo:toNSString(hostRedirectedTo) completionHandler:^(BOOL _isRegisteredAsRedirectingTo) {
+ isRegisteredAsRedirectingTo = _isRegisteredAsRedirectingTo;
+ isDataReady = true;
+ }];
+ platformRunUntil(isDataReady, 0);
+
+ return isRegisteredAsRedirectingTo;
+}
+
void TestController::setStatisticsHasHadUserInteraction(WKStringRef hostName, bool value)
{
[globalWebViewConfiguration.websiteDataStore _resourceLoadStatisticsSetHadUserInteraction:value forHost:toNSString(hostName)];