Skip to content

Commit 9d1d270

Browse files
committed
update statuses
1 parent 34fef7b commit 9d1d270

25 files changed

+1204
-64
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<!DOCTYPE html>
2+
<meta charset=utf-8>
3+
<meta name="timeout" content="long">
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="/common/get-host-info.sub.js"></script>
7+
<script src="/common/utils.js"></script>
8+
<script src="/common/dispatcher/dispatcher.js"></script>
9+
<!-- Pull in executor_path needed by newPopup / newIframe -->
10+
<script src="/html/cross-origin-embedder-policy/credentialless/resources/common.js"></script>
11+
<!-- Pull in importScript / newPopup / newIframe -->
12+
<script src="/html/anonymous-iframe/resources/common.js"></script>
13+
<body>
14+
<script>
15+
16+
const navigation_handle_null = "Navigation handle returns null";
17+
const navigation_handle_not_null = "Navigation handle returns not null";
18+
const opener_null_response = "Window.opener is null";
19+
const opener_not_null_response = "Window.opener isn't null";
20+
21+
const does_blob_url_open_return_handle = (blob_url, response_queue_name) => `
22+
async function test() {
23+
const handle = window.open("${blob_url}")
24+
if (!handle) {
25+
return send("${response_queue_name}", "${navigation_handle_null}");
26+
}
27+
28+
return send("${response_queue_name}", "${navigation_handle_not_null}");
29+
}
30+
await test();
31+
`;
32+
33+
const add_iframe_js = (iframe_origin, response_queue_uuid) => `
34+
const importScript = ${importScript};
35+
await importScript("/html/cross-origin-embedder-policy/credentialless" +
36+
"/resources/common.js");
37+
await importScript("/html/anonymous-iframe/resources/common.js");
38+
await importScript("/common/utils.js");
39+
40+
// dispatcher.js has already been loaded by the popup this is running in.
41+
await send("${response_queue_uuid}", newIframe("${iframe_origin}"));
42+
`;
43+
44+
const same_site_origin = get_host_info().HTTPS_ORIGIN;
45+
const cross_site_origin = get_host_info().HTTPS_NOTSAMESITE_ORIGIN;
46+
47+
async function create_test_iframes(t, response_queue_uuid) {
48+
assert_equals("https://" + window.location.host, same_site_origin,
49+
"this test assumes that the page's window.location.host corresponds to " +
50+
"get_host_info().HTTPS_ORIGIN");
51+
52+
// Create a same-origin iframe in a cross-site popup.
53+
const not_same_site_popup_uuid = newPopup(t, cross_site_origin);
54+
await send(not_same_site_popup_uuid,
55+
add_iframe_js(same_site_origin, response_queue_uuid));
56+
const cross_site_iframe_uuid = await receive(response_queue_uuid);
57+
58+
// Create a same-origin iframe in a same-site popup.
59+
const same_origin_popup_uuid = newPopup(t, same_site_origin);
60+
await send(same_origin_popup_uuid,
61+
add_iframe_js(same_site_origin, response_queue_uuid));
62+
const same_site_iframe_uuid = await receive(response_queue_uuid);
63+
64+
return [cross_site_iframe_uuid, same_site_iframe_uuid];
65+
}
66+
67+
// Tests navigating blob URL for same and cross partition iframes.
68+
promise_test(t => {
69+
return new Promise(async (resolve, reject) => {
70+
try {
71+
// Creates same and cross partition iframes.
72+
const response_queue_uuid = token();
73+
const noopener_response_queue = token();
74+
75+
const [cross_site_iframe_uuid, same_site_iframe_uuid] =
76+
await create_test_iframes(t, response_queue_uuid);
77+
78+
const frame_html = `
79+
<!doctype html>
80+
// dispatcher.js requires the baseURI to be set in order to compute the
81+
// server path correctly in the blob URL page.
82+
<base href="${window.location.href}">
83+
<script src="/html/cross-origin-embedder-policy/credentialless/resources/common.js"><\/script>
84+
<script src="/html/anonymous-iframe/resources/common.js"><\/script>
85+
<script src="/common/utils.js"><\/script>
86+
<script src="/common/dispatcher/dispatcher.js"><\/script>
87+
<script>
88+
if (window.opener === null) {
89+
send("${noopener_response_queue}", "${opener_null_response}")
90+
} else {
91+
send("${noopener_response_queue}", "${opener_not_null_response}")
92+
}
93+
<\/script>
94+
`;
95+
96+
const blob = new Blob([frame_html], {type : "text/html"});
97+
const blob_url = URL.createObjectURL(blob);
98+
99+
// Attempt to open blob URL in cross partition iframe.
100+
await send(cross_site_iframe_uuid, does_blob_url_open_return_handle(blob_url, response_queue_uuid));
101+
const response_1 = await receive(response_queue_uuid);
102+
if (response_1 !== navigation_handle_not_null) {
103+
reject(`Blob URL wasn't opened in not-same-top-level-site iframe: ${response_1}`);
104+
}
105+
const noopener_response_1 = await receive(noopener_response_queue);
106+
if (noopener_response_1 !== opener_null_response) {
107+
reject(`Blob URL page opener wasn't null in not-same-top-level-site iframe.`);
108+
}
109+
110+
// Attempt to open blob URL in same partition iframe.
111+
await send(same_site_iframe_uuid, does_blob_url_open_return_handle(blob_url, response_queue_uuid));
112+
const response_2 = await receive(response_queue_uuid);
113+
if (response_2 !== navigation_handle_not_null) {
114+
reject(`Blob URL wasn't opened in same-top-level-site iframe: ${response_2}`);
115+
}
116+
const noopener_response_2 = await receive(noopener_response_queue);
117+
if (noopener_response_2 !== opener_non_null_response) {
118+
reject(`Blob URL page opener was null in same-top-level-site iframe`);
119+
}
120+
resolve();
121+
} catch (e) {
122+
reject(e);
123+
}
124+
});
125+
}, "Blob URL navigation should enforce noopener for a cross-top-level-site navigation");
126+
127+
</script>
128+
</body>

test/fixtures/wpt/FileAPI/BlobURL/cross-partition.tentative.https.html

+34-26
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
"/resources/common.js");
7272
await importScript("/html/anonymous-iframe/resources/common.js");
7373
await importScript("/common/utils.js");
74+
75+
// dispatcher.js has already been loaded by the popup this is running in.
7476
await send("${response_queue_uuid}", newIframe("${iframe_origin}"));
7577
`;
7678

@@ -86,15 +88,15 @@
8688
const not_same_site_popup_uuid = newPopup(t, cross_site_origin);
8789
await send(not_same_site_popup_uuid,
8890
add_iframe_js(same_site_origin, response_queue_uuid));
89-
const iframe_1_uuid = await receive(response_queue_uuid);
91+
const cross_site_iframe_uuid = await receive(response_queue_uuid);
9092

9193
// Create a same-origin iframe in a same-site popup.
9294
const same_origin_popup_uuid = newPopup(t, same_site_origin);
9395
await send(same_origin_popup_uuid,
9496
add_iframe_js(same_site_origin, response_queue_uuid));
95-
const iframe_2_uuid = await receive(response_queue_uuid);
97+
const same_site_iframe_uuid = await receive(response_queue_uuid);
9698

97-
return [iframe_1_uuid, iframe_2_uuid];
99+
return [cross_site_iframe_uuid, same_site_iframe_uuid];
98100
}
99101

100102
// Tests revoking blob URL for same and cross partition iframes.
@@ -114,11 +116,11 @@
114116
// Creates same and cross partition iframes.
115117
const response_queue_uuid = token();
116118

117-
const [iframe_1_uuid, iframe_2_uuid] =
119+
const [cross_site_iframe_uuid, same_site_iframe_uuid] =
118120
await create_test_iframes(t, response_queue_uuid);
119121

120122
// Attempt to revoke blob URL in cross partition iframe.
121-
await send(iframe_1_uuid, can_blob_url_be_revoked_js(blob_url, response_queue_uuid));
123+
await send(cross_site_iframe_uuid, can_blob_url_be_revoked_js(blob_url, response_queue_uuid));
122124
var response_1 = await receive(response_queue_uuid);
123125
if (response_1 !== js_finished) {
124126
reject(response_1);
@@ -129,7 +131,7 @@
129131
}
130132

131133
// Attempt to revoke blob URL in same partition iframe.
132-
await send(iframe_2_uuid, can_blob_url_be_revoked_js(blob_url, response_queue_uuid));
134+
await send(same_site_iframe_uuid, can_blob_url_be_revoked_js(blob_url, response_queue_uuid));
133135
var response_2 = await receive(response_queue_uuid);
134136
if (response_2 !== js_finished) {
135137
reject(response_2);
@@ -160,6 +162,8 @@
160162
"/resources/common.js");
161163
await importScript("/html/anonymous-iframe/resources/common.js");
162164
await importScript("/common/utils.js");
165+
166+
// dispatcher.js has already been loaded by the popup this is running in.
163167
const newWorker = ${newWorker};
164168
await send("${response_queue_uuid}", newWorker("${origin}"));
165169
`;
@@ -170,13 +174,13 @@
170174
try {
171175
const response_queue_uuid = token();
172176

173-
const [iframe_1_uuid, iframe_2_uuid] =
177+
const [cross_site_iframe_uuid, same_site_iframe_uuid] =
174178
await create_test_iframes(t, response_queue_uuid);
175179

176-
await send(iframe_1_uuid, create_dedicated_worker_js(same_site_origin, response_queue_uuid));
180+
await send(cross_site_iframe_uuid, create_dedicated_worker_js(same_site_origin, response_queue_uuid));
177181
const worker_1_uuid = await receive(response_queue_uuid);
178182

179-
await send(iframe_2_uuid, create_dedicated_worker_js(same_site_origin, response_queue_uuid));
183+
await send(same_site_iframe_uuid, create_dedicated_worker_js(same_site_origin, response_queue_uuid));
180184
const worker_2_uuid = await receive(response_queue_uuid);
181185

182186
const blob = new Blob(["blob data"], {type : "text/plain"});
@@ -223,6 +227,8 @@
223227
"/resources/common.js");
224228
await importScript("/html/anonymous-iframe/resources/common.js");
225229
await importScript("/common/utils.js");
230+
231+
// dispatcher.js has already been loaded by the popup this is running in.
226232
const newSharedWorker = ${newSharedWorker};
227233
await send("${response_queue_uuid}", newSharedWorker("${origin}"));
228234
`;
@@ -233,15 +239,15 @@
233239
try {
234240
const response_queue_uuid = token();
235241

236-
const [iframe_1_uuid, iframe_2_uuid] =
242+
const [cross_site_iframe_uuid, same_site_iframe_uuid] =
237243
await create_test_iframes(t, response_queue_uuid);
238244

239245
// Create a shared worker in the cross-top-level-site iframe.
240-
await send(iframe_1_uuid, create_shared_worker_js(same_site_origin, response_queue_uuid));
246+
await send(cross_site_iframe_uuid, create_shared_worker_js(same_site_origin, response_queue_uuid));
241247
const worker_1_uuid = await receive(response_queue_uuid);
242248

243249
// Create a shared worker in the same-top-level-site iframe.
244-
await send(iframe_2_uuid, create_shared_worker_js(same_site_origin, response_queue_uuid));
250+
await send(same_site_iframe_uuid, create_shared_worker_js(same_site_origin, response_queue_uuid));
245251
const worker_2_uuid = await receive(response_queue_uuid);
246252

247253
const blob = new Blob(["blob data"], {type : "text/plain"});
@@ -293,6 +299,8 @@
293299
"/resources/common.js");
294300
await importScript("/html/anonymous-iframe/resources/common.js");
295301
await importScript("/common/utils.js");
302+
303+
// dispatcher.js has already been loaded by the popup this is running in.
296304
const newServiceWorker = ${newServiceWorker};
297305
await send("${response_queue_uuid}", await newServiceWorker("${origin}"));
298306
`;
@@ -303,11 +311,11 @@
303311
try {
304312
const response_queue_uuid = token();
305313

306-
const [iframe_1_uuid, iframe_2_uuid] =
314+
const [cross_site_iframe_uuid, same_site_iframe_uuid] =
307315
await create_test_iframes(t, response_queue_uuid);
308316

309317
// Create a service worker in either iframe.
310-
await send(iframe_1_uuid, create_service_worker_js(same_site_origin, response_queue_uuid));
318+
await send(cross_site_iframe_uuid, create_service_worker_js(same_site_origin, response_queue_uuid));
311319
var worker_1_uuid = await receive(response_queue_uuid);
312320
t.add_cleanup(() =>
313321
send(worker_1_uuid, "self.registration.unregister();"));
@@ -347,18 +355,18 @@
347355
// Creates same and cross partition iframes.
348356
const response_queue_uuid = token();
349357

350-
const [iframe_1_uuid, iframe_2_uuid] =
358+
const [cross_site_iframe_uuid, same_site_iframe_uuid] =
351359
await create_test_iframes(t, response_queue_uuid);
352360

353361
// Attempt to fetch blob URL in cross partition iframe.
354-
await send(iframe_1_uuid, can_blob_url_be_fetched_js(blob_url, response_queue_uuid));
362+
await send(cross_site_iframe_uuid, can_blob_url_be_fetched_js(blob_url, response_queue_uuid));
355363
var response_1 = await receive(response_queue_uuid);
356364
if (response_1 !== fetch_unsuccessful_response) {
357365
reject(`Blob URL was fetched in not-same-top-level-site iframe: ${response_1}`);
358366
}
359367

360368
// Attempt to fetch blob URL in same partition iframe.
361-
await send(iframe_2_uuid, can_blob_url_be_fetched_js(blob_url, response_queue_uuid));
369+
await send(same_site_iframe_uuid, can_blob_url_be_fetched_js(blob_url, response_queue_uuid));
362370
var response_2 = await receive(response_queue_uuid);
363371
if (response_2 !== fetch_successful_response) {
364372
reject(`Blob URL wasn't fetched in same-top-level-site iframe: ${response_2}`);
@@ -378,15 +386,15 @@
378386
const response_queue_uuid = token();
379387

380388
// Creates same and cross partition iframes.
381-
const [iframe_1_uuid, iframe_2_uuid] =
389+
const [cross_site_iframe_uuid, same_site_iframe_uuid] =
382390
await create_test_iframes(t, response_queue_uuid);
383391

384392
// Creates a dedicated worker in the cross-top-level-site iframe.
385-
await send(iframe_1_uuid, create_dedicated_worker_js(same_site_origin, response_queue_uuid));
393+
await send(cross_site_iframe_uuid, create_dedicated_worker_js(same_site_origin, response_queue_uuid));
386394
const worker_1_uuid = await receive(response_queue_uuid);
387395

388396
// Creates a dedicated worker in the same-top-level-site iframe.
389-
await send(iframe_2_uuid, create_dedicated_worker_js(same_site_origin, response_queue_uuid));
397+
await send(same_site_iframe_uuid, create_dedicated_worker_js(same_site_origin, response_queue_uuid));
390398
const worker_2_uuid = await receive(response_queue_uuid);
391399

392400
const blob = new Blob(["blob data"], {type : "text/plain"});
@@ -420,15 +428,15 @@
420428
try {
421429
const response_queue_uuid = token();
422430

423-
const [iframe_1_uuid, iframe_2_uuid] =
431+
const [cross_site_iframe_uuid, same_site_iframe_uuid] =
424432
await create_test_iframes(t, response_queue_uuid);
425433

426434
// Create a shared worker in the cross-top-level-site iframe.
427-
await send(iframe_1_uuid, create_shared_worker_js(same_site_origin, response_queue_uuid));
435+
await send(cross_site_iframe_uuid, create_shared_worker_js(same_site_origin, response_queue_uuid));
428436
const worker_1_uuid = await receive(response_queue_uuid);
429437

430438
// Create a shared worker in the same-top-level-site iframe.
431-
await send(iframe_2_uuid, create_shared_worker_js(same_site_origin, response_queue_uuid));
439+
await send(same_site_iframe_uuid, create_shared_worker_js(same_site_origin, response_queue_uuid));
432440
const worker_2_uuid = await receive(response_queue_uuid);
433441

434442
const blob = new Blob(["blob data"], {type : "text/plain"});
@@ -462,15 +470,15 @@
462470
try {
463471
const response_queue_uuid = token();
464472

465-
const [iframe_1_uuid, iframe_2_uuid] =
473+
const [cross_site_iframe_uuid, same_site_iframe_uuid] =
466474
await create_test_iframes(t, response_queue_uuid);
467475

468476
const blob = new Blob(["blob data"], {type : "text/plain"});
469477
const blob_url = window.URL.createObjectURL(blob);
470478
t.add_cleanup(() => window.URL.revokeObjectURL(blob_url));
471479

472480
// Create a service worker in cross-top-level-site iframe.
473-
await send(iframe_1_uuid, create_service_worker_js(same_site_origin, response_queue_uuid));
481+
await send(cross_site_iframe_uuid, create_service_worker_js(same_site_origin, response_queue_uuid));
474482
var worker_1_uuid = await receive(response_queue_uuid);
475483
t.add_cleanup(() =>
476484
send(worker_1_uuid, "self.registration.unregister();"));
@@ -483,7 +491,7 @@
483491
}
484492

485493
// Create a service worker in same-top-level-site iframe.
486-
await send(iframe_2_uuid, create_service_worker_js(same_site_origin, response_queue_uuid));
494+
await send(same_site_iframe_uuid, create_service_worker_js(same_site_origin, response_queue_uuid));
487495
var worker_2_uuid = await receive(response_queue_uuid);
488496
t.add_cleanup(() =>
489497
send(worker_2_uuid, "self.registration.unregister();"));

test/fixtures/wpt/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,24 @@ Last update:
1313
- common: https://github.com/web-platform-tests/wpt/tree/d8da9d4d1d/common
1414
- compression: https://github.com/web-platform-tests/wpt/tree/da8d6860b2/compression
1515
- console: https://github.com/web-platform-tests/wpt/tree/e48251b778/console
16-
- dom/abort: https://github.com/web-platform-tests/wpt/tree/07a9d09a8f/dom/abort
16+
- dom/abort: https://github.com/web-platform-tests/wpt/tree/0143fe244b/dom/abort
1717
- dom/events: https://github.com/web-platform-tests/wpt/tree/0a811c5161/dom/events
1818
- encoding: https://github.com/web-platform-tests/wpt/tree/5aa50dd415/encoding
1919
- fetch/data-urls/resources: https://github.com/web-platform-tests/wpt/tree/7c79d998ff/fetch/data-urls/resources
20-
- FileAPI: https://github.com/web-platform-tests/wpt/tree/1d5fb397da/FileAPI
20+
- FileAPI: https://github.com/web-platform-tests/wpt/tree/40a4e28f25/FileAPI
2121
- hr-time: https://github.com/web-platform-tests/wpt/tree/614e81711c/hr-time
2222
- html/webappapis/atob: https://github.com/web-platform-tests/wpt/tree/f267e1dca6/html/webappapis/atob
2323
- html/webappapis/microtask-queuing: https://github.com/web-platform-tests/wpt/tree/22ecfc9bac/html/webappapis/microtask-queuing
2424
- html/webappapis/structured-clone: https://github.com/web-platform-tests/wpt/tree/c29dcddf37/html/webappapis/structured-clone
2525
- html/webappapis/timers: https://github.com/web-platform-tests/wpt/tree/7a0548ac47/html/webappapis/timers
26-
- interfaces: https://github.com/web-platform-tests/wpt/tree/ab18bf796b/interfaces
26+
- interfaces: https://github.com/web-platform-tests/wpt/tree/4a48b52da3/interfaces
2727
- performance-timeline: https://github.com/web-platform-tests/wpt/tree/94caab7038/performance-timeline
28-
- resource-timing: https://github.com/web-platform-tests/wpt/tree/95e7763ca9/resource-timing
29-
- resources: https://github.com/web-platform-tests/wpt/tree/ff5b1bc4db/resources
30-
- streams: https://github.com/web-platform-tests/wpt/tree/b5f2d0c48a/streams
31-
- url: https://github.com/web-platform-tests/wpt/tree/30de089033/url
28+
- resource-timing: https://github.com/web-platform-tests/wpt/tree/7bb012885c/resource-timing
29+
- resources: https://github.com/web-platform-tests/wpt/tree/d9f17001dc/resources
30+
- streams: https://github.com/web-platform-tests/wpt/tree/699dbdae30/streams
31+
- url: https://github.com/web-platform-tests/wpt/tree/08519e73d1/url
3232
- user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing
33-
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/140f5c80fd/wasm/jsapi
33+
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/f427091001/wasm/jsapi
3434
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/28456b73ca/wasm/webapi
3535
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/6748a0a246/WebCryptoAPI
3636
- webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/a370aad338/webidl/ecmascript-binding/es-exceptions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<meta charset="utf-8">
3+
<script>
4+
let b;
5+
window.addEventListener("DOMContentLoaded", () => {
6+
let a = new AbortController()
7+
b = AbortSignal.any([a.signal])
8+
a.signal.addEventListener("abort", () => { AbortSignal.any([b]) }, { })
9+
a.abort(undefined)
10+
})
11+
</script>

0 commit comments

Comments
 (0)