Skip to content

Commit ddfb3a1

Browse files
Camille Lamymoz-wptsync-bot
Camille Lamy
authored andcommitted
Bug 1659787 [wpt PR 25072] - COOP: add reporting to redirects, a=testonly
Automatic update from web-platform-tests COOP: add reporting to redirects This CL allows reporting browsing context group switches triggered by redirects and updates the reports sent in this case to the latest version of the spec PR (whatwg/html#5518). Since the status of COOP was becoming hard to track, I moved it to its own class for better encapsulation. Bug: 1059303 Change-Id: Ifafb23073301bd05cd9ce83fdb0b748c28e8a51f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2352880 Commit-Queue: Camille Lamy <[email protected]> Reviewed-by: Arthur Sonzogni <[email protected]> Reviewed-by: Mike West <[email protected]> Reviewed-by: Kinuko Yasuda <[email protected]> Cr-Commit-Position: refs/heads/master@{#799863} -- wpt-commits: 677c57c0e8816b0892cc3ae1c2772189b1bdcf65 wpt-pr: 25072
1 parent 2d09f5a commit ddfb3a1

12 files changed

+120
-136
lines changed

testing/web-platform/tests/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-four-reports.https.html

+10-12
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
"report": {
2929
"body": {
3030
"disposition": "enforce",
31-
"documentURI": `${location.href}`,
3231
"effectivePolicy": "same-origin-allow-popups",
33-
"navigationURI": /uuid=EXECUTOR_UUID$/, // next document URL
34-
"type": "navigation-from-document"
32+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // next document URL
33+
"type": "navigation-from-response"
3534
},
3635
"url": `${location.href}`,
3736
"type": "coop"
@@ -42,10 +41,9 @@
4241
"report": {
4342
"body": {
4443
"disposition": "reporting",
45-
"documentURI": `${location.href}`,
4644
"effectivePolicy": "same-origin-plus-coep",
47-
"navigationURI": /uuid=EXECUTOR_UUID$/, // next document URL
48-
"type": "navigation-from-document"
45+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // next document URL
46+
"type": "navigation-from-response"
4947
},
5048
"url": `${location.href}`,
5149
"type": "coop"
@@ -56,10 +54,10 @@
5654
"report": {
5755
"body": {
5856
"disposition": "enforce",
59-
"documentURI": /uuid=EXECUTOR_UUID$/,
6057
"effectivePolicy": "same-origin-allow-popups",
61-
"navigationURI": `${location.origin}/`, // referrer
62-
"type": "navigation-to-document"
58+
"previousResponseURL": "",
59+
"referrer": `${location.origin}/`, // referrer
60+
"type": "navigation-to-response"
6361
},
6462
"url": /uuid=EXECUTOR_UUID$/,
6563
"type": "coop"
@@ -70,10 +68,10 @@
7068
"report": {
7169
"body": {
7270
"disposition": "reporting",
73-
"documentURI": /uuid=EXECUTOR_UUID$/,
7471
"effectivePolicy": "same-origin-plus-coep",
75-
"navigationURI": `${location.origin}/`, // referrer
76-
"type": "navigation-to-document"
72+
"previousResponseURL": "",
73+
"referrer": `${location.origin}/`, // referrer
74+
"type": "navigation-to-response"
7775
},
7876
"url": /uuid=EXECUTOR_UUID$/,
7977
"type": "coop"

testing/web-platform/tests/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-from-unsafe-none.https.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
"report": {
2929
"body": {
3030
"disposition": "reporting",
31-
"documentURI": /uuid=EXECUTOR_UUID$/,
3231
"effectivePolicy": "same-origin",
33-
"navigationURI": `${location.href}`, // previous documnent url
34-
"type": "navigation-to-document"
32+
"previousResponseURL": `${location.href}`, // previous documnent url
33+
"referrer": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
34+
"type": "navigation-to-response"
3535
},
3636
"url": /uuid=EXECUTOR_UUID$/,
3737
"type": "coop"
@@ -53,10 +53,10 @@
5353
"report": {
5454
"body": {
5555
"disposition": "reporting",
56-
"documentURI": /uuid=EXECUTOR_UUID$/,
5756
"effectivePolicy": "same-origin",
58-
"navigationURI": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
59-
"type": "navigation-to-document"
57+
"previousResponseURL": "",
58+
"referrer": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
59+
"type": "navigation-to-response"
6060
},
6161
"url": /uuid=EXECUTOR_UUID$/,
6262
"type": "coop"

testing/web-platform/tests/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-same-origin-report-to.https.html

+7-9
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@
2929
"report": {
3030
"body": {
3131
"disposition": "reporting",
32-
"documentURI": `${location.href}`,
3332
"effectivePolicy": "same-origin",
34-
"navigationURI": /uuid=EXECUTOR_UUID$/, // next document URL
35-
"type": "navigation-from-document"
33+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // next document URL
34+
"type": "navigation-from-response"
3635
},
3736
"url": `${location.href}`,
3837
"type": "coop"
@@ -55,10 +54,9 @@
5554
"report": {
5655
"body": {
5756
"disposition": "reporting",
58-
"documentURI": `${location.href}`,
5957
"effectivePolicy": "same-origin",
60-
"navigationURI": /uuid=EXECUTOR_UUID$/, // next document URL
61-
"type": "navigation-from-document"
58+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // next document URL
59+
"type": "navigation-from-response"
6260
},
6361
"url": `${location.href}`,
6462
"type": "coop"
@@ -69,10 +67,10 @@
6967
"report": {
7068
"body": {
7169
"disposition": "reporting",
72-
"documentURI": /uuid=EXECUTOR_UUID$/,
7370
"effectivePolicy": "same-origin",
74-
"navigationURI": `${location.origin}/`, // referrer
75-
"type": "navigation-to-document"
71+
"previousResponseURL": "",
72+
"referrer": `${location.origin}/`, // referrer
73+
"type": "navigation-to-response"
7674
},
7775
"url": /uuid=EXECUTOR_UUID$/,
7876
"type": "coop"

testing/web-platform/tests/html/cross-origin-opener-policy/reporting/navigation-reporting/report-only-same-origin.https.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
"report": {
3030
"body": {
3131
"disposition": "reporting",
32-
"documentURI": /uuid=EXECUTOR_UUID$/,
3332
"effectivePolicy": "same-origin-plus-coep",
34-
"navigationURI": `${location.href}`,
35-
"type": "navigation-to-document"
33+
"previousResponseURL": `${location.href}`,
34+
"referrer": `${location.origin}/`,
35+
"type": "navigation-to-response"
3636
},
3737
"url": /uuid=EXECUTOR_UUID$/,
3838
"type": "coop"
@@ -55,10 +55,10 @@
5555
"report": {
5656
"body": {
5757
"disposition": "reporting",
58-
"documentURI": /uuid=EXECUTOR_UUID$/,
5958
"effectivePolicy": "same-origin-plus-coep",
60-
"navigationURI": `${location.href}`,
61-
"type": "navigation-to-document"
59+
"previousResponseURL": `${location.href}`,
60+
"referrer": `${location.origin}/`,
61+
"type": "navigation-to-response"
6262
},
6363
"url": /uuid=EXECUTOR_UUID$/,
6464
"type": "coop"

testing/web-platform/tests/html/cross-origin-opener-policy/reporting/navigation-reporting/reporting-coop-navigated-popup.https.html

+5-6
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@
5454
"report": {
5555
"body": {
5656
"disposition": "enforce",
57-
"documentURI": RegExp(`uuid=${noCoopToken}$`),
5857
"effectivePolicy": "unsafe-none",
59-
"navigationURI": RegExp(`uuid=${coopToken}$`),
60-
"type": "navigation-from-document"
58+
"nextResponseURL": RegExp(`uuid=${coopToken}$`),
59+
"type": "navigation-from-response"
6160
},
6261
"url": RegExp(`uuid=${noCoopToken}$`),
6362
"type": "coop"
@@ -68,10 +67,10 @@
6867
"report": {
6968
"body": {
7069
"disposition": "enforce",
71-
"documentURI": RegExp(`uuid=${coopToken}$`),
7270
"effectivePolicy": "same-origin",
73-
"navigationURI": RegExp(`uuid=${noCoopToken}$`),
74-
"type": "navigation-to-document"
71+
"previousResponseURL": RegExp(`uuid=${noCoopToken}$`),
72+
"referrer": RegExp(`uuid=${noCoopToken}$`),
73+
"type": "navigation-to-response"
7574
},
7675
"url": RegExp(`uuid=${coopToken}$`),
7776
"type": "coop"

testing/web-platform/tests/html/cross-origin-opener-policy/reporting/navigation-reporting/reporting-popup-same-origin-allow-popups-report-to.https.html

+12-15
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@
2828
"report": {
2929
"body": {
3030
"disposition": "enforce",
31-
"documentURI": `${location.href}`,
3231
"effectivePolicy": "same-origin-allow-popups",
33-
"navigationURI": /uuid=EXECUTOR_UUID$/, // next document URL
34-
"type": "navigation-from-document"
32+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // next document URL
33+
"type": "navigation-from-response"
3534
},
3635
"url": `${location.href}`,
3736
"type": "coop"
@@ -42,10 +41,10 @@
4241
"report": {
4342
"body": {
4443
"disposition": "enforce",
45-
"documentURI": /uuid=EXECUTOR_UUID$/,
4644
"effectivePolicy": "same-origin",
47-
"navigationURI": `${location.href}`, // previous documnent url
48-
"type": "navigation-to-document"
45+
"previousResponseURL": `${location.href}`, // previous documnent url
46+
"referrer": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
47+
"type": "navigation-to-response"
4948
},
5049
"url": /uuid=EXECUTOR_UUID$/,
5150
"type": "coop"
@@ -69,10 +68,9 @@
6968
"report": {
7069
"body": {
7170
"disposition": "enforce",
72-
"documentURI": `${location.href}`,
7371
"effectivePolicy": "same-origin-allow-popups",
74-
"navigationURI": /uuid=EXECUTOR_UUID$/, // initial navigation URL
75-
"type": "navigation-from-document"
72+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // next document URL
73+
"type": "navigation-from-response"
7674
},
7775
"url": `${location.href}`,
7876
"type": "coop"
@@ -83,10 +81,10 @@
8381
"report": {
8482
"body": {
8583
"disposition": "enforce",
86-
"documentURI": /uuid=EXECUTOR_UUID$/,
8784
"effectivePolicy": "same-origin-allow-popups",
88-
"navigationURI": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
89-
"type": "navigation-to-document"
85+
"previousResponseURL": ``,
86+
"referrer": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
87+
"type": "navigation-to-response"
9088
},
9189
"url": /uuid=EXECUTOR_UUID$/,
9290
"type": "coop"
@@ -110,10 +108,9 @@
110108
"report": {
111109
"body": {
112110
"disposition": "enforce",
113-
"documentURI": `${location.href}`,
114111
"effectivePolicy": "same-origin-allow-popups",
115-
"navigationURI": /uuid=EXECUTOR_UUID$/, // initial navigation URL
116-
"type": "navigation-from-document"
112+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // initial navigation URL
113+
"type": "navigation-from-response"
117114
},
118115
"url": `${location.href}`,
119116
"type": "coop"

testing/web-platform/tests/html/cross-origin-opener-policy/reporting/navigation-reporting/reporting-popup-same-origin-coep-report-to.https.html

+17-21
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@
3838
"report": {
3939
"body": {
4040
"disposition": "enforce",
41-
"documentURI": `${location.href}`,
4241
"effectivePolicy": "same-origin-plus-coep",
43-
"navigationURI": /uuid=EXECUTOR_UUID$/, // next destination url
44-
"type": "navigation-from-document"
42+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // next destination url
43+
"type": "navigation-from-response"
4544
},
4645
"url": `${location.href}`,
4746
"type": "coop"
@@ -52,10 +51,10 @@
5251
"report": {
5352
"body": {
5453
"disposition": "enforce",
55-
"documentURI": /uuid=EXECUTOR_UUID$/,
5654
"effectivePolicy": "same-origin",
57-
"navigationURI": `${location.href}`, // previous document url
58-
"type": "navigation-to-document"
55+
"previousResponseURL": `${location.href}`, // previous document url
56+
"referrer": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
57+
"type": "navigation-to-response"
5958
},
6059
"url": /uuid=EXECUTOR_UUID$/,
6160
"type": "coop"
@@ -80,10 +79,9 @@
8079
"report": {
8180
"body": {
8281
"disposition": "enforce",
83-
"documentURI": `${location.href}`,
8482
"effectivePolicy": "same-origin-plus-coep",
85-
"navigationURI": /uuid=EXECUTOR_UUID$/, // initial navigation url
86-
"type": "navigation-from-document"
83+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // initial navigation url
84+
"type": "navigation-from-response"
8785
},
8886
"url": `${location.href}`,
8987
"type": "coop"
@@ -94,10 +92,10 @@
9492
"report": {
9593
"body": {
9694
"disposition": "enforce",
97-
"documentURI": /uuid=EXECUTOR_UUID$/,
9895
"effectivePolicy": "same-origin-plus-coep",
99-
"navigationURI": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
100-
"type": "navigation-to-document"
96+
"previousResponseURL": ``,
97+
"referrer": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
98+
"type": "navigation-to-response"
10199
},
102100
"url": /uuid=EXECUTOR_UUID$/,
103101
"type": "coop"
@@ -119,10 +117,9 @@
119117
"report": {
120118
"body": {
121119
"disposition": "enforce",
122-
"documentURI": `${location.href}`,
123120
"effectivePolicy": "same-origin-plus-coep",
124-
"navigationURI": /uuid=EXECUTOR_UUID$/, // next destination url
125-
"type": "navigation-from-document"
121+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // initial navigation url
122+
"type": "navigation-from-response"
126123
},
127124
"url": `${location.href}`,
128125
"type": "coop"
@@ -144,10 +141,9 @@
144141
"report": {
145142
"body": {
146143
"disposition": "enforce",
147-
"documentURI": `${location.href}`,
148144
"effectivePolicy": "same-origin-plus-coep",
149-
"navigationURI": /uuid=EXECUTOR_UUID$/, // next destination url
150-
"type": "navigation-from-document"
145+
"nextResponseURL": /uuid=EXECUTOR_UUID$/, // initial navigation url
146+
"type": "navigation-from-response"
151147
},
152148
"url": `${location.href}`,
153149
"type": "coop"
@@ -158,10 +154,10 @@
158154
"report": {
159155
"body": {
160156
"disposition": "reporting",
161-
"documentURI": /uuid=EXECUTOR_UUID$/,
162157
"effectivePolicy": "same-origin-plus-coep",
163-
"navigationURI": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
164-
"type": "navigation-to-document"
158+
"previousResponseURL": ``,
159+
"referrer": `${location.origin}/`, // referrer (origin, as dictated by the referrer policy)
160+
"type": "navigation-to-response"
165161
},
166162
"url": /uuid=EXECUTOR_UUID$/,
167163
"type": "coop"

0 commit comments

Comments
 (0)