CrashTracer: com.apple.WebKit.Networking.Development at com.apple.WebKit: WebKit...
authorkatherine_cheney@apple.com <katherine_cheney@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Nov 2019 23:26:18 +0000 (23:26 +0000)
committerkatherine_cheney@apple.com <katherine_cheney@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Nov 2019 23:26:18 +0000 (23:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=204081
<rdar://problem/56889809>

Reviewed by John Wilander.

This crash was happening in two places. First, in
has-storage-access-true-if-third-party-has-cookies-database.html,
the test was incorrectly marked as ephemeral then tried to use ITP by
calling setEnableFeature. ITP should not be used in ephemeral
sessions. There was also a small bug, ITP should be set to true (not
false) at the beginning of this test.

Second, both
has-storage-access-true-if-third-party-has-cookies-ephemeral.html and
has-storage-access-true-if-third-party-has-cookies-ephemeral-database.html
had document.hrefs which redirected back to the non-ephemeral test cases after
setting a cookie. This caused a crash when trying to set ITP to false
using an ephemeral sessionID.

* http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-database.html:
* http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral-database-expected.txt:
* http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral-database.html:
* http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral-expected.txt:
* http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@252340 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-database.html
LayoutTests/http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral-database-expected.txt
LayoutTests/http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral-database.html
LayoutTests/http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral-expected.txt
LayoutTests/http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral.html

index afa6f03..e7def93 100644 (file)
@@ -1,3 +1,31 @@
+2019-11-11  Kate Cheney  <katherine_cheney@apple.com>
+
+        CrashTracer: com.apple.WebKit.Networking.Development at com.apple.WebKit: WebKit::NetworkProcess::setIsRunningResourceLoadStatisticsTest
+        https://bugs.webkit.org/show_bug.cgi?id=204081
+        <rdar://problem/56889809>
+
+        Reviewed by John Wilander.
+
+        This crash was happening in two places. First, in 
+        has-storage-access-true-if-third-party-has-cookies-database.html, 
+        the test was incorrectly marked as ephemeral then tried to use ITP by
+        calling setEnableFeature. ITP should not be used in ephemeral
+        sessions. There was also a small bug, ITP should be set to true (not
+        false) at the beginning of this test.
+
+        Second, both
+        has-storage-access-true-if-third-party-has-cookies-ephemeral.html and
+        has-storage-access-true-if-third-party-has-cookies-ephemeral-database.html
+        had document.hrefs which redirected back to the non-ephemeral test cases after
+        setting a cookie. This caused a crash when trying to set ITP to false
+        using an ephemeral sessionID.
+
+        * http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-database.html:
+        * http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral-database-expected.txt:
+        * http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral-database.html:
+        * http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral-expected.txt:
+        * http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral.html:
+
 2019-11-11  Andy Estes  <aestes@apple.com>
 
         PaymentRequest / PaymentResponse should not prevent entering the back/forward cache
index b858fbd..bad2ecf 100644 (file)
@@ -1,4 +1,3 @@
-<!-- webkit-test-runner [ useEphemeralSession=true ] -->
 <!DOCTYPE html>
 <html>
 <head>
@@ -25,7 +24,7 @@
         const statisticsUrl = "http://" + hostUnderTest;
         function runTest() {
             if (document.location.hash !== "#firstPartyCookieSet") {
-                setEnableFeature(false, function() {
+                setEnableFeature(true, function() {
                     testRunner.setUseITPDatabase(true);
                     document.location.href = statisticsUrl + "/storageAccess/resources/set-cookie.php?name=firstPartyCookie&value=value#http://127.0.0.1:8000/storageAccess/has-storage-access-true-if-third-party-has-cookies-database.html#firstPartyCookieSet";
                 });
index ee54049..47732f8 100644 (file)
@@ -1,4 +1,4 @@
-Tests that document.hasStorageAccess() returns true for a 3rd-party iframe if the 3rd-party has cookies set.
+Tests that document.hasStorageAccess() returns true for a 3rd-party iframe if the 3rd-party has cookies set (ephemeral session).
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
index 10970a1..39f9709 100644 (file)
@@ -25,8 +25,9 @@
         const statisticsUrl = "http://" + hostUnderTest;
         function runTest() {
             testRunner.setUseITPDatabase(true);
+            // This test should not call setEnableFeature(true) because ephemeral sessions do not use ITP.
             if (document.location.hash !== "#firstPartyCookieSet") {
-                document.location.href = statisticsUrl + "/storageAccess/resources/set-cookie.php?name=firstPartyCookie&value=value#http://127.0.0.1:8000/storageAccess/has-storage-access-true-if-third-party-has-cookies-database.html#firstPartyCookieSet";
+                document.location.href = statisticsUrl + "/storageAccess/resources/set-cookie.php?name=firstPartyCookie&value=value#http://127.0.0.1:8000/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral-database.html#firstPartyCookieSet";
             } else {
                 let iframeElement = document.createElement("iframe");
                 iframeElement.id = "TheIframeThatRequestsStorageAccess";
index ee54049..47732f8 100644 (file)
@@ -1,4 +1,4 @@
-Tests that document.hasStorageAccess() returns true for a 3rd-party iframe if the 3rd-party has cookies set.
+Tests that document.hasStorageAccess() returns true for a 3rd-party iframe if the 3rd-party has cookies set (ephemeral session).
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
index df4ceac..2f31a57 100644 (file)
@@ -24,8 +24,9 @@
         const hostUnderTest = "localhost:8000";
         const statisticsUrl = "http://" + hostUnderTest;
         function runTest() {
+            // This test should not call setEnableFeature(true) because ephemeral sessions do not use ITP.
             if (document.location.hash !== "#firstPartyCookieSet") {
-                document.location.href = statisticsUrl + "/storageAccess/resources/set-cookie.php?name=firstPartyCookie&value=value#http://127.0.0.1:8000/storageAccess/has-storage-access-true-if-third-party-has-cookies.html#firstPartyCookieSet";
+                document.location.href = statisticsUrl + "/storageAccess/resources/set-cookie.php?name=firstPartyCookie&value=value#http://127.0.0.1:8000/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral.html#firstPartyCookieSet";
             } else {
                 let iframeElement = document.createElement("iframe");
                 iframeElement.id = "TheIframeThatRequestsStorageAccess";