|
1 | 1 | <!DOCTYPE html>
|
2 | 2 | <head>
|
3 | 3 | <meta name="timeout" content="long">
|
| 4 | + <meta name="variant" content="?01-05"> |
| 5 | + <meta name="variant" content="?06-10"> |
| 6 | + <meta name="variant" content="?11-15"> |
| 7 | + <meta name="variant" content="?16-20"> |
| 8 | + <meta name="variant" content="?21-25"> |
| 9 | + <meta name="variant" content="?26-30"> |
| 10 | + <meta name="variant" content="?31-35"> |
| 11 | + <meta name="variant" content="?36-last"> |
4 | 12 | <script src="/resources/testharness.js"></script>
|
5 | 13 | <script src="/resources/testharnessreport.js"></script>
|
6 | 14 | <script src="support/navigation-support.js"></script>
|
| 15 | + <script src="/common/subset-tests.js"></script> |
7 | 16 | </head>
|
8 | 17 | <body>
|
9 | 18 | <script>
|
|
101 | 110 | const kNavigationSupportReportOnly = "navigation-report-only-support.html";
|
102 | 111 |
|
103 | 112 | for (const navigationElement of kNavigationElements) {
|
104 |
| - promise_test(t => { |
| 113 | + subsetTest(promise_test, t => { |
105 | 114 | const params = maybeAddNavigationElementToSearchParams(navigationElement, {});
|
106 | 115 | return openWindowAndWaitMessages(t, `support/${joinToHref(params, kNavigationSupport)}`, [
|
107 | 116 | loadedMessage(params, kNavigationSupport),
|
108 | 117 | violationMessage("Location href"),
|
109 | 118 | ]);
|
110 | 119 | }, `Navigate a window via ${navigationElement} with javascript:-urls in enforcing mode.`);
|
111 | 120 |
|
112 |
| - promise_test(t => { |
| 121 | + subsetTest(promise_test, t => { |
113 | 122 | const params = maybeAddNavigationElementToSearchParams(navigationElement, {defaultpolicy: 'replace'});
|
114 | 123 | return openWindowAndWaitMessages(t, `support/${joinToHref(params, kNavigationSupport)}`, [
|
115 | 124 | loadedMessage(params, kNavigationSupport),
|
116 | 125 | loadedMessage(Object.assign({navigationattempted: 1, defaultpolicywashere: 1}, params), kNavigationSupport),
|
117 | 126 | ]);
|
118 | 127 | }, `Navigate a window via ${navigationElement} with javascript:-urls w/ default policy in enforcing mode.`);
|
119 | 128 |
|
120 |
| - promise_test(t => { |
| 129 | + subsetTest(promise_test, t => { |
121 | 130 | const params = maybeAddNavigationElementToSearchParams(navigationElement, {});
|
122 | 131 | return openWindowAndWaitMessages(t, `support/${joinToHref(params, kNavigationSupportReportOnly)}`, [
|
123 | 132 | loadedMessage(params, kNavigationSupportReportOnly),
|
|
126 | 135 | ]);
|
127 | 136 | }, `Navigate a window via ${navigationElement} with javascript:-urls in report-only mode.`);
|
128 | 137 |
|
129 |
| - promise_test(t => { |
| 138 | + subsetTest(promise_test, t => { |
130 | 139 | const params = maybeAddNavigationElementToSearchParams(navigationElement, {defaultpolicy: 'replace'});
|
131 | 140 | return openWindowAndWaitMessages(t, `support/${joinToHref(params, kNavigationSupportReportOnly)}`, [
|
132 | 141 | loadedMessage(params, kNavigationSupportReportOnly),
|
133 | 142 | loadedMessage(Object.assign({navigationattempted: 1, defaultpolicywashere: 1}, params), kNavigationSupport),
|
134 | 143 | ]);
|
135 | 144 | }, `Navigate a window via ${navigationElement} with javascript:-urls w/ default policy in report-only mode.`);
|
136 | 145 |
|
137 |
| - promise_test(t => { |
| 146 | + subsetTest(promise_test, t => { |
138 | 147 | const params = maybeAddNavigationElementToSearchParams(navigationElement, {frame: 1});
|
139 | 148 | return openWindowAndWaitMessages(t, `support/${joinToHref(params, kNavigationSupport)}`, [
|
140 | 149 | loadedMessage(params, kNavigationSupport),
|
141 | 150 | violationMessage("Location href"),
|
142 | 151 | ]);
|
143 | 152 | }, `Navigate a frame via ${navigationElement} with javascript:-urls in enforcing mode.`);
|
144 | 153 |
|
145 |
| - promise_test(t => { |
| 154 | + subsetTest(promise_test, t => { |
146 | 155 | const params = maybeAddNavigationElementToSearchParams(navigationElement,
|
147 | 156 | {defaultpolicy: 'replace', frame: 1});
|
148 | 157 | return openWindowAndWaitMessages(t, `support/${joinToHref(params, kNavigationSupport)}`, [
|
|
151 | 160 | ]);
|
152 | 161 | }, `Navigate a frame via ${navigationElement} with javascript:-urls w/ default policy in enforcing mode.`);
|
153 | 162 |
|
154 |
| - promise_test(t => { |
| 163 | + subsetTest(promise_test, t => { |
155 | 164 | const params = maybeAddNavigationElementToSearchParams(navigationElement, {frame: 1})
|
156 | 165 | return openWindowAndWaitMessages(t, `support/${joinToHref(params, kNavigationSupportReportOnly)}`, [
|
157 | 166 | loadedMessage(params, kNavigationSupportReportOnly),
|
|
160 | 169 | ]);
|
161 | 170 | }, `Navigate a frame via ${navigationElement} with javascript:-urls in report-only mode.`);
|
162 | 171 |
|
163 |
| - promise_test(t => { |
| 172 | + subsetTest(promise_test, t => { |
164 | 173 | const params = maybeAddNavigationElementToSearchParams(navigationElement,
|
165 | 174 | {defaultpolicy: 'replace', frame: 1});
|
166 | 175 | return openWindowAndWaitMessages(t, `support/${joinToHref(params, kNavigationSupportReportOnly)}`, [
|
|
169 | 178 | ]);
|
170 | 179 | }, `Navigate a frame via ${navigationElement} with javascript:-urls w/ default policy in report-only mode.`);
|
171 | 180 |
|
172 |
| - promise_test(t => { |
| 181 | + subsetTest(promise_test, t => { |
173 | 182 | // This test navigates to a 'javascript:location.href=...' URL with a CSP
|
174 | 183 | // policy in enforcing mode and a default policy throwing an exception.
|
175 | 184 | // "require-trusted-types-for Pre-Navigation check" returns "Blocked"
|
|
182 | 191 | ]);
|
183 | 192 | }, `Navigate a window via ${navigationElement} with javascript:-urls w/ a default policy throwing an exception in enforcing mode.`);
|
184 | 193 |
|
185 |
| - promise_test(t => { |
| 194 | + subsetTest(promise_test, t => { |
186 | 195 | // This test navigates to a 'javascript:location.href=...' URL with a CSP
|
187 | 196 | // policy in report-only mode and a default policy throwing an exception.
|
188 | 197 | // "require-trusted-types-for Pre-Navigation check" returns "Blocked"
|
|
197 | 206 | ]);
|
198 | 207 | }, `Navigate a window via ${navigationElement} with javascript:-urls w/ a default policy throwing an exception in report-only mode.`);
|
199 | 208 |
|
200 |
| - promise_test(t => { |
| 209 | + subsetTest(promise_test, t => { |
201 | 210 | // This test navigates to a 'javascript:location.href=...' URL with a CSP
|
202 | 211 | // policy in enforcing mode and a default policy making the URL invalid.
|
203 | 212 | // "require-trusted-types-for Pre-Navigation check" returns "Blocked"
|
|
210 | 219 | ]);
|
211 | 220 | }, `Navigate a window via ${navigationElement} with javascript:-urls w/ a default policy making the URL invalid in enforcing mode.`);
|
212 | 221 |
|
213 |
| - promise_test(t => { |
| 222 | + subsetTest(promise_test, t => { |
214 | 223 | // This test navigates to a 'javascript:location.href=...' URL with a CSP
|
215 | 224 | // policy in report-only mode and a default policy making the URL invalid.
|
216 | 225 | // "require-trusted-types-for Pre-Navigation check" returns "Blocked"
|
|
0 commit comments