Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/origin/api/file-scheme-origin.tentative.any.html - WPT Dashboard Interop Dashboard
- /html/browsers/origin/api/file-scheme-origin.tentative.any.worker.html - WPT Dashboard Interop Dashboard
// META: title=`Origin.from('file://')`
test(t => {
const opaqueA = Origin.from(fileURL);
const opaqueB = Origin.from(fileURL);
assert_true(opaqueA.opaque);
assert_true(opaqueB.opaque);
assert_true(opaqueA.isSameOrigin(opaqueA), "Opaque origin should be same-origin with itself.");
assert_true(opaqueA.isSameSite(opaqueA), "Opaque origin should be same-site with itself.");
assert_false(opaqueA.isSameOrigin(opaqueB), "Opaque origin should not be same-origin with another opaque origin.");
assert_false(opaqueA.isSameSite(opaqueB), "Opaque origin should not be same-site with another opaque origin, even if created from same URL.");
}, "`Origin.from('file://')` opaque origins.");