Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: !debug OR xorigin OR http3 OR http2
- Manifest: dom/origin-trials/tests/mochitest/mochitest.toml
<!doctype html>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<iframe></iframe>
<script>
async function testFrame(file, expectEnabled) {
let reply = new Promise(resolve => {
window.addEventListener("message", function(e) {
resolve(e.data);
}, { once: true });
});
let iframe = document.querySelector("iframe");
let load = new Promise(resolve => {
iframe.addEventListener("load", resolve, { once: true });
});
info("loading " + iframe.src);
await load;
let data = await reply;
is(data.testTrialInterfaceExposed, expectEnabled);
}
add_task(async function test_subdomain() {
await testFrame("file_subdomain_good_frame.html", true);
await testFrame("file_subdomain_bad_frame.html", false);
});
</script>