Skip to content

Commit 0007ac4

Browse files
lukebjerringannevk
authored andcommitted
Tentative CORS-RFC1918 test
1 parent 61df0b9 commit 0007ac4

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// META: script=/resources/WebIDLParser.js
2+
// META: script=/resources/idlharness.js
3+
4+
promise_test(async () => {
5+
const idl = await fetch('/interfaces/cors-rfc1918.idl').then(r => r.text());
6+
const html = await fetch('/interfaces/html.idl').then(r => r.text());
7+
const dom = await fetch('/interfaces/dom.idl').then(r => r.text());
8+
9+
const idlArray = new IdlArray();
10+
idlArray.add_idls(idl);
11+
idlArray.add_dependency_idls(html);
12+
idlArray.add_dependency_idls(dom);
13+
14+
const objects = {
15+
Document: ['document'],
16+
WorkerGlobalScope: ['self'],
17+
};
18+
idlArray.add_objects(objects);
19+
idlArray.test();
20+
}, 'Test CORS RFC1918 interfaces');

interfaces/cors-rfc1918.idl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// GENERATED CONTENT - DO NOT EDIT
2+
// Content of this file was automatically extracted from the
3+
// "CORS and RFC1918" spec.
4+
// See: https://wicg.github.io/cors-rfc1918/
5+
6+
enum AddressSpace { "local", "private", "public" };
7+
8+
partial interface Document {
9+
readonly attribute AddressSpace addressSpace;
10+
};
11+
12+
partial interface WorkerGlobalScope {
13+
readonly attribute AddressSpace addressSpace;
14+
};

0 commit comments

Comments
 (0)