Diff
Modified: trunk/LayoutTests/ChangeLog (276525 => 276526)
--- trunk/LayoutTests/ChangeLog 2021-04-23 22:46:21 UTC (rev 276525)
+++ trunk/LayoutTests/ChangeLog 2021-04-23 23:01:48 UTC (rev 276526)
@@ -1,3 +1,26 @@
+2021-04-23 Chris Dumez <[email protected]>
+
+ http/tests/security/referrer-policy-header.html is slow
+ https://bugs.webkit.org/show_bug.cgi?id=224998
+
+ Reviewed by Geoffrey Garen.
+
+ The test is a flaky timeout on the bots because it is slow. On my machine, it takes 17 seconds to run
+ it with a debug build. To speed things up, I am now running the subtests in parallel instead of
+ sequentially. I also split the test in 2 (regular response vs multipart response). Each tests now takes
+ about ~5 seconds to run on my machine.
+
+ * http/tests/security/referrer-policy-header-expected.txt:
+ * http/tests/security/referrer-policy-header-multipart-expected.txt: Added.
+ * http/tests/security/referrer-policy-header-multipart.html: Added.
+ * http/tests/security/referrer-policy-header-test.js: Copied from LayoutTests/http/tests/security/referrer-policy-header.html.
+ (printResults):
+ (onmessage):
+ (runTests):
+ * http/tests/security/referrer-policy-header.html:
+ * http/tests/security/resources/postReferrer.py:
+ * http/tests/security/resources/serve-referrer-policy-and-test.py:
+
2021-04-23 Ryan Haddad <[email protected]>
imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/css-module/css-module-worker-test.html is a flakey crash and failure
Modified: trunk/LayoutTests/http/tests/security/referrer-policy-header-expected.txt (276525 => 276526)
--- trunk/LayoutTests/http/tests/security/referrer-policy-header-expected.txt 2021-04-23 22:46:21 UTC (rev 276525)
+++ trunk/LayoutTests/http/tests/security/referrer-policy-header-expected.txt 2021-04-23 23:01:48 UTC (rev 276526)
@@ -1,15 +1,3 @@
-CONSOLE MESSAGE: Failed to set referrer policy: The value 'invalid' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value 'invalid' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value 'invalid' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value '' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value '' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value '' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value 'invalid' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value 'invalid' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value 'invalid' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value '' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value '' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
-CONSOLE MESSAGE: Failed to set referrer policy: The value '' is not one of 'no-referrer', 'no-referrer-when-downgrade', 'same-origin', 'origin', 'strict-origin', 'origin-when-cross-origin', 'strict-origin-when-cross-origin' or 'unsafe-url'.
Tests support for Referrer-Policy HTTP header.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -34,19 +22,19 @@
PASS actualReferrer is "https://127.0.0.1:8443/"
Testing 'Referrer-Policy: unsafe-url' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=https://localhost:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=https://localhost:8443/&isTestingMultipart=0&id=6"
Testing 'Referrer-Policy: unsafe-url' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=7"
Testing 'Referrer-Policy: unsafe-url' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=http://127.0.0.1:8000/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=http://127.0.0.1:8000/&isTestingMultipart=0&id=8"
Testing 'Referrer-Policy: no-referrer-when-downgrade' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=no-referrer-when-downgrade&destinationOrigin=https://localhost:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=no-referrer-when-downgrade&destinationOrigin=https://localhost:8443/&isTestingMultipart=0&id=9"
Testing 'Referrer-Policy: no-referrer-when-downgrade' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=no-referrer-when-downgrade&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=no-referrer-when-downgrade&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=10"
Testing 'Referrer-Policy: no-referrer-when-downgrade' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? false
PASS actualReferrer is ""
@@ -55,7 +43,7 @@
PASS actualReferrer is ""
Testing 'Referrer-Policy: same-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=same-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=same-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=13"
Testing 'Referrer-Policy: same-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? false
PASS actualReferrer is ""
@@ -73,7 +61,7 @@
PASS actualReferrer is "https://127.0.0.1:8443/"
Testing 'Referrer-Policy: strict-origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=strict-origin-when-cross-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=strict-origin-when-cross-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=19"
Testing 'Referrer-Policy: strict-origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? false
PASS actualReferrer is ""
@@ -82,119 +70,29 @@
PASS actualReferrer is "https://127.0.0.1:8443/"
Testing 'Referrer-Policy: origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=origin-when-cross-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=origin-when-cross-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=22"
Testing 'Referrer-Policy: origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? false
PASS actualReferrer is "https://127.0.0.1:8443/"
Testing 'Referrer-Policy: invalid' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=invalid&destinationOrigin=https://localhost:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=invalid&destinationOrigin=https://localhost:8443/&isTestingMultipart=0&id=24"
Testing 'Referrer-Policy: invalid' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=invalid&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=invalid&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=25"
Testing 'Referrer-Policy: invalid' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? false
PASS actualReferrer is ""
Testing 'Referrer-Policy: ' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=&destinationOrigin=https://localhost:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=&destinationOrigin=https://localhost:8443/&isTestingMultipart=0&id=27"
Testing 'Referrer-Policy: ' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? false
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0"
+PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=28"
Testing 'Referrer-Policy: ' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? false
PASS actualReferrer is ""
-Testing 'Referrer-Policy: no-referrer' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
-PASS actualReferrer is ""
-
-Testing 'Referrer-Policy: no-referrer' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
-PASS actualReferrer is ""
-
-Testing 'Referrer-Policy: no-referrer' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
-PASS actualReferrer is ""
-
-Testing 'Referrer-Policy: origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/"
-
-Testing 'Referrer-Policy: origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/"
-
-Testing 'Referrer-Policy: origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/"
-
-Testing 'Referrer-Policy: unsafe-url' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=https://localhost:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: unsafe-url' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: unsafe-url' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=http://127.0.0.1:8000/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: no-referrer-when-downgrade' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=no-referrer-when-downgrade&destinationOrigin=https://localhost:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: no-referrer-when-downgrade' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=no-referrer-when-downgrade&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: no-referrer-when-downgrade' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
-PASS actualReferrer is ""
-
-Testing 'Referrer-Policy: same-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
-PASS actualReferrer is ""
-
-Testing 'Referrer-Policy: same-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=same-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: same-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
-PASS actualReferrer is ""
-
-Testing 'Referrer-Policy: strict-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/"
-
-Testing 'Referrer-Policy: strict-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/"
-
-Testing 'Referrer-Policy: strict-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
-PASS actualReferrer is ""
-
-Testing 'Referrer-Policy: strict-origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/"
-
-Testing 'Referrer-Policy: strict-origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=strict-origin-when-cross-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: strict-origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
-PASS actualReferrer is ""
-
-Testing 'Referrer-Policy: origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/"
-
-Testing 'Referrer-Policy: origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=origin-when-cross-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/"
-
-Testing 'Referrer-Policy: invalid' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=invalid&destinationOrigin=https://localhost:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: invalid' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=invalid&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: invalid' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
-PASS actualReferrer is ""
-
-Testing 'Referrer-Policy: ' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=&destinationOrigin=https://localhost:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: ' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
-PASS actualReferrer is "https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1"
-
-Testing 'Referrer-Policy: ' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
-PASS actualReferrer is ""
-
PASS successfullyParsed is true
TEST COMPLETE
Added: trunk/LayoutTests/http/tests/security/referrer-policy-header-multipart-expected.txt (0 => 276526)
--- trunk/LayoutTests/http/tests/security/referrer-policy-header-multipart-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/security/referrer-policy-header-multipart-expected.txt 2021-04-23 23:01:48 UTC (rev 276526)
@@ -0,0 +1,100 @@
+Tests support for Referrer-Policy HTTP header (multipart).
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing 'Referrer-Policy: no-referrer' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
+PASS actualReferrer is ""
+
+Testing 'Referrer-Policy: no-referrer' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
+PASS actualReferrer is ""
+
+Testing 'Referrer-Policy: no-referrer' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
+PASS actualReferrer is ""
+
+Testing 'Referrer-Policy: origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
+PASS actualReferrer is "https://127.0.0.1:8443/"
+
+Testing 'Referrer-Policy: origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
+PASS actualReferrer is "https://127.0.0.1:8443/"
+
+Testing 'Referrer-Policy: origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
+PASS actualReferrer is "https://127.0.0.1:8443/"
+
+Testing 'Referrer-Policy: unsafe-url' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=https://localhost:8443/&isTestingMultipart=1&id=6. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=https://localhost:8443/&isTestingMultipart=0&id=6.
+
+Testing 'Referrer-Policy: unsafe-url' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1&id=7. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=7.
+
+Testing 'Referrer-Policy: unsafe-url' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=http://127.0.0.1:8000/&isTestingMultipart=1&id=8. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=unsafe-url&destinationOrigin=http://127.0.0.1:8000/&isTestingMultipart=0&id=8.
+
+Testing 'Referrer-Policy: no-referrer-when-downgrade' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=no-referrer-when-downgrade&destinationOrigin=https://localhost:8443/&isTestingMultipart=1&id=9. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=no-referrer-when-downgrade&destinationOrigin=https://localhost:8443/&isTestingMultipart=0&id=9.
+
+Testing 'Referrer-Policy: no-referrer-when-downgrade' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=no-referrer-when-downgrade&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1&id=10. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=no-referrer-when-downgrade&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=10.
+
+Testing 'Referrer-Policy: no-referrer-when-downgrade' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
+PASS actualReferrer is ""
+
+Testing 'Referrer-Policy: same-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
+PASS actualReferrer is ""
+
+Testing 'Referrer-Policy: same-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=same-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1&id=13. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=same-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=13.
+
+Testing 'Referrer-Policy: same-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
+PASS actualReferrer is ""
+
+Testing 'Referrer-Policy: strict-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
+PASS actualReferrer is "https://127.0.0.1:8443/"
+
+Testing 'Referrer-Policy: strict-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
+PASS actualReferrer is "https://127.0.0.1:8443/"
+
+Testing 'Referrer-Policy: strict-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
+PASS actualReferrer is ""
+
+Testing 'Referrer-Policy: strict-origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
+PASS actualReferrer is "https://127.0.0.1:8443/"
+
+Testing 'Referrer-Policy: strict-origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=strict-origin-when-cross-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1&id=19. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=strict-origin-when-cross-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=19.
+
+Testing 'Referrer-Policy: strict-origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
+PASS actualReferrer is ""
+
+Testing 'Referrer-Policy: origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
+PASS actualReferrer is "https://127.0.0.1:8443/"
+
+Testing 'Referrer-Policy: origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=origin-when-cross-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1&id=22. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=origin-when-cross-origin&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=22.
+
+Testing 'Referrer-Policy: origin-when-cross-origin' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
+PASS actualReferrer is "https://127.0.0.1:8443/"
+
+Testing 'Referrer-Policy: invalid' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=invalid&destinationOrigin=https://localhost:8443/&isTestingMultipart=1&id=24. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=invalid&destinationOrigin=https://localhost:8443/&isTestingMultipart=0&id=24.
+
+Testing 'Referrer-Policy: invalid' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=invalid&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1&id=25. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=invalid&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=25.
+
+Testing 'Referrer-Policy: invalid' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
+PASS actualReferrer is ""
+
+Testing 'Referrer-Policy: ' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://localhost:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=&destinationOrigin=https://localhost:8443/&isTestingMultipart=1&id=27. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=&destinationOrigin=https://localhost:8443/&isTestingMultipart=0&id=27.
+
+Testing 'Referrer-Policy: ' - referrer origin: https://127.0.0.1:8443/ - destination origin: https://127.0.0.1:8443/ - isMultipartResponse? true
+FAIL actualReferrer should be https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=1&id=28. Was https://127.0.0.1:8443/security/resources/serve-referrer-policy-and-test.py?value=&destinationOrigin=https://127.0.0.1:8443/&isTestingMultipart=0&id=28.
+
+Testing 'Referrer-Policy: ' - referrer origin: https://127.0.0.1:8443/ - destination origin: http://127.0.0.1:8000/ - isMultipartResponse? true
+PASS actualReferrer is ""
+
+PASS successfullyParsed is true
+Some tests failed.
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/security/referrer-policy-header-multipart.html (0 => 276526)
--- trunk/LayoutTests/http/tests/security/referrer-policy-header-multipart.html (rev 0)
+++ trunk/LayoutTests/http/tests/security/referrer-policy-header-multipart.html 2021-04-23 23:01:48 UTC (rev 276526)
@@ -0,0 +1,16 @@
+<!DOCTYPE html><!-- webkit-test-runner [ dumpJSConsoleLogInStdErr=true ] -->
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script>
+description("Tests support for Referrer-Policy HTTP header (multipart).");
+jsTestIsAsync = true;
+
+if (window.testRunner)
+ testRunner.setStatisticsShouldDowngradeReferrer(false, () => { runTests(true /* multipart */); });
+</script>
+</body>
+</html>
Copied: trunk/LayoutTests/http/tests/security/referrer-policy-header-test.js (from rev 276524, trunk/LayoutTests/http/tests/security/referrer-policy-header.html) (0 => 276526)
--- trunk/LayoutTests/http/tests/security/referrer-policy-header-test.js (rev 0)
+++ trunk/LayoutTests/http/tests/security/referrer-policy-header-test.js 2021-04-23 23:01:48 UTC (rev 276526)
@@ -0,0 +1,76 @@
+const sourceOrigin = "https://127.0.0.1:8443/";
+const crossOrigin = "https://localhost:8443/";
+const downgradedOrigin = "http://127.0.0.1:8000/";
+const fullSourceURL = "fullSourceURL";
+
+// [Referrer-Policy header, expected referrer, destination origin].
+let tests = [
+ ["no-referrer", "", crossOrigin],
+ ["no-referrer", "", sourceOrigin],
+ ["no-referrer", "", downgradedOrigin],
+ ["origin", sourceOrigin, crossOrigin],
+ ["origin", sourceOrigin, sourceOrigin],
+ ["origin", sourceOrigin, downgradedOrigin],
+ ["unsafe-url", fullSourceURL, crossOrigin],
+ ["unsafe-url", fullSourceURL, sourceOrigin],
+ ["unsafe-url", fullSourceURL, downgradedOrigin],
+ ["no-referrer-when-downgrade", fullSourceURL, crossOrigin],
+ ["no-referrer-when-downgrade", fullSourceURL, sourceOrigin],
+ ["no-referrer-when-downgrade", "", downgradedOrigin],
+ ["same-origin", "", crossOrigin],
+ ["same-origin", fullSourceURL, sourceOrigin],
+ ["same-origin", "", downgradedOrigin],
+ ["strict-origin", sourceOrigin, crossOrigin],
+ ["strict-origin", sourceOrigin, sourceOrigin],
+ ["strict-origin", "", downgradedOrigin],
+ ["strict-origin-when-cross-origin", sourceOrigin, crossOrigin],
+ ["strict-origin-when-cross-origin", fullSourceURL, sourceOrigin],
+ ["strict-origin-when-cross-origin", "", downgradedOrigin],
+ ["origin-when-cross-origin", sourceOrigin, crossOrigin],
+ ["origin-when-cross-origin", fullSourceURL, sourceOrigin],
+ ["origin-when-cross-origin", sourceOrigin, downgradedOrigin],
+ ["invalid", fullSourceURL, crossOrigin],
+ ["invalid", fullSourceURL, sourceOrigin],
+ ["invalid", "", downgradedOrigin],
+ ["", fullSourceURL, crossOrigin],
+ ["", fullSourceURL, sourceOrigin],
+ ["", "", downgradedOrigin],
+];
+
+let results = new Array(tests.length);
+let resultCount = 0;
+
+function printResults()
+{
+ for (let i = 0; i < results.length; i++) {
+ let currentTest = tests[i];
+ actualReferrer = results[i]
+ debug("Testing 'Referrer-Policy: " + currentTest[0] + "' - referrer origin: " + sourceOrigin + " - destination origin: " + currentTest[2] + " - isMultipartResponse? " + isTestingMultipart);
+ if (currentTest[1] === fullSourceURL)
+ shouldBeEqualToString("actualReferrer", sourceOrigin + "security/resources/serve-referrer-policy-and-test.py?value=" + currentTest[0] + "&destinationOrigin=" + currentTest[2] + "&isTestingMultipart=" + (isTestingMultipart ? "1" : "0") + "&id=" + i);
+ else
+ shouldBeEqualToString("actualReferrer", "" + currentTest[1]);
+ debug("");
+ }
+ finishJSTest();
+}
+
+_onmessage_ = (msg) => {
+ results[msg.data.id] = msg.data.referer;
+ if (++resultCount == results.length)
+ printResults();
+}
+
+function runTests(isTestingMultipart)
+{
+ window.isTestingMultipart = isTestingMultipart;
+ for (let i = 0; i < results.length; i++) {
+ let currentTest = tests[i % tests.length];
+ let isTestingMultipart = i >= tests.length;
+
+ let frame = document.createElement("iframe");
+ frame.style = "display:none";
+ frame.src = "" + "security/resources/serve-referrer-policy-and-test.py?value=" + currentTest[0] + "&destinationOrigin=" + currentTest[2] + "&isTestingMultipart=" + (isTestingMultipart ? "1" : "0") + "&id=" + i;
+ document.body.appendChild(frame);
+ }
+}
Modified: trunk/LayoutTests/http/tests/security/referrer-policy-header.html (276525 => 276526)
--- trunk/LayoutTests/http/tests/security/referrer-policy-header.html 2021-04-23 22:46:21 UTC (rev 276525)
+++ trunk/LayoutTests/http/tests/security/referrer-policy-header.html 2021-04-23 23:01:48 UTC (rev 276526)
@@ -1,92 +1,16 @@
-<!DOCTYPE html>
+<!DOCTYPE html><!-- webkit-test-runner [ dumpJSConsoleLogInStdErr=true ] -->
<html>
<head>
<script src=""
</head>
<body>
+<script src=""
<script>
description("Tests support for Referrer-Policy HTTP header.");
jsTestIsAsync = true;
-const sourceOrigin = "https://127.0.0.1:8443/";
-const crossOrigin = "https://localhost:8443/";
-const downgradedOrigin = "http://127.0.0.1:8000/";
-const fullSourceURL = "fullSourceURL";
-
-// [Referrer-Policy header, expected referrer, destination origin].
-let tests = [
- ["no-referrer", "", crossOrigin],
- ["no-referrer", "", sourceOrigin],
- ["no-referrer", "", downgradedOrigin],
- ["origin", sourceOrigin, crossOrigin],
- ["origin", sourceOrigin, sourceOrigin],
- ["origin", sourceOrigin, downgradedOrigin],
- ["unsafe-url", fullSourceURL, crossOrigin],
- ["unsafe-url", fullSourceURL, sourceOrigin],
- ["unsafe-url", fullSourceURL, downgradedOrigin],
- ["no-referrer-when-downgrade", fullSourceURL, crossOrigin],
- ["no-referrer-when-downgrade", fullSourceURL, sourceOrigin],
- ["no-referrer-when-downgrade", "", downgradedOrigin],
- ["same-origin", "", crossOrigin],
- ["same-origin", fullSourceURL, sourceOrigin],
- ["same-origin", "", downgradedOrigin],
- ["strict-origin", sourceOrigin, crossOrigin],
- ["strict-origin", sourceOrigin, sourceOrigin],
- ["strict-origin", "", downgradedOrigin],
- ["strict-origin-when-cross-origin", sourceOrigin, crossOrigin],
- ["strict-origin-when-cross-origin", fullSourceURL, sourceOrigin],
- ["strict-origin-when-cross-origin", "", downgradedOrigin],
- ["origin-when-cross-origin", sourceOrigin, crossOrigin],
- ["origin-when-cross-origin", fullSourceURL, sourceOrigin],
- ["origin-when-cross-origin", sourceOrigin, downgradedOrigin],
- ["invalid", fullSourceURL, crossOrigin],
- ["invalid", fullSourceURL, sourceOrigin],
- ["invalid", "", downgradedOrigin],
- ["", fullSourceURL, crossOrigin],
- ["", fullSourceURL, sourceOrigin],
- ["", "", downgradedOrigin],
-];
-
-let currentTestIndex = 0;
-let isTestingMultipart = false;
-
-_onmessage_ = (msg) => {
- actualReferrer = msg.data;
- if (currentTest[1] === fullSourceURL)
- shouldBeEqualToString("actualReferrer", sourceOrigin + "security/resources/serve-referrer-policy-and-test.py?value=" + currentTest[0] + "&destinationOrigin=" + currentTest[2] + "&isTestingMultipart=" + (isTestingMultipart ? "1" : "0"));
- else
- shouldBeEqualToString("actualReferrer", "" + currentTest[1]);
- debug("");
-
- frame.remove();
- currentTestIndex++;
- runNextTest();
-}
-
-function runNextTest()
-{
- if (currentTestIndex >= tests.length) {
- if (!isTestingMultipart) {
- isTestingMultipart = true;
- currentTestIndex = 0;
- } else {
- finishJSTest();
- return;
- }
- }
-
- currentTest = tests[currentTestIndex];
- debug("Testing 'Referrer-Policy: " + currentTest[0] + "' - referrer origin: " + sourceOrigin + " - destination origin: " + currentTest[2] + " - isMultipartResponse? " + isTestingMultipart);
- frame = document.createElement("iframe");
- frame.src = "" + "security/resources/serve-referrer-policy-and-test.py?value=" + currentTest[0] + "&destinationOrigin=" + currentTest[2] + "&isTestingMultipart=" + (isTestingMultipart ? "1" : "0");
- document.body.appendChild(frame);
-}
-
-if (window.testRunner) {
- testRunner.setStatisticsShouldDowngradeReferrer(false, function () {
- runNextTest();
- });
-}
+if (window.testRunner)
+ testRunner.setStatisticsShouldDowngradeReferrer(false, () => { runTests(false /* multipart */); });
</script>
</body>
</html>
Modified: trunk/LayoutTests/http/tests/security/resources/postReferrer.py (276525 => 276526)
--- trunk/LayoutTests/http/tests/security/resources/postReferrer.py 2021-04-23 22:46:21 UTC (rev 276525)
+++ trunk/LayoutTests/http/tests/security/resources/postReferrer.py 2021-04-23 23:01:48 UTC (rev 276526)
@@ -2,9 +2,18 @@
import os
import sys
+from urllib.parse import parse_qs
+query = parse_qs(os.environ.get('QUERY_STRING', ''), keep_blank_values=True)
+
referer = os.environ.get('HTTP_REFERER', '')
+id = query.get('id', [''])[0]
+if len(id) > 0:
+ payload = "{{ id:{}, referer:'{}' }}".format(id, referer)
+else:
+ payload = "'{}'".format(referer)
+
sys.stdout.write(
'Content-Type: text/html\r\n\r\n'
'<!DOCTYPE html>\n'
@@ -11,7 +20,7 @@
'<html>\n'
'<body>\n'
'<script>\n'
- 'top.postMessage(\'{}\', \'*\');\n'
+ 'top.postMessage({}, \'*\');\n'
'</script>\n'
- '</body>\n'.format(referer)
-)
\ No newline at end of file
+ '</body>\n'.format(payload)
+)
Modified: trunk/LayoutTests/http/tests/security/resources/serve-referrer-policy-and-test.py (276525 => 276526)
--- trunk/LayoutTests/http/tests/security/resources/serve-referrer-policy-and-test.py 2021-04-23 22:46:21 UTC (rev 276525)
+++ trunk/LayoutTests/http/tests/security/resources/serve-referrer-policy-and-test.py 2021-04-23 23:01:48 UTC (rev 276526)
@@ -8,6 +8,7 @@
destination_origin = query.get('destinationOrigin', [''])[0]
is_testing_multipart = query.get('isTestingMultipart', [None])[0]
value = query.get('value', [''])[0]
+id = query.get('id', [''])[0]
sys.stdout.write('Referrer-Policy: {}\r\n'.format(value))
if is_testing_multipart is not None and is_testing_multipart == '1':
@@ -17,12 +18,12 @@
'Referrer-Policy: {}\r\n'
'Content-type: text/html\r\n'
'\r\n'
- '<iframe src=""
- '--boundary\r\n'.format(value, destination_origin)
+ '<iframe src=""
+ '--boundary\r\n'.format(value, destination_origin, id)
)
else:
sys.stdout.write(
'Content-Type: text/html\r\n\r\n'
'\r\n'
- '<iframe src=""
+ '<iframe src="" id)
)