Bug 1942639 - Propagate --filter argument from desktop_unittest.py to runreftest...
[gecko.git] / dom / xslt / tests / mochitest / test_bug1729517.html
blob3dc9eca3c091200a0148066e58435ab1d757ed07
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title><!-- TODO: insert title here --></title>
6 <script src="/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
8 <script>
9 SimpleTest.waitForExplicitFinish();
10 async function runTest() {
11 let frame = document.getElementById("frame");
12 let loaded = new Promise((resolve) => {
13 frame.addEventListener("load", () => {
14 let failed = JSON.parse(frame.contentDocument.title);
15 ok(failed instanceof Array, "Frame's title is expected to be a JSON representation of the array of failed conditions.");
16 is(failed.length, 0, "No scripts should run in sandboxed iframe document created by XSLT.");
17 for (let desc of failed) {
18 info(desc);
20 resolve();
21 }, { once: true });
22 });
23 frame.src = "file_bug1729517.xml";
24 await loaded;
26 let results = new Promise((resolve) => {
27 addEventListener("message", ({ data }) => {
28 resolve(data);
29 }, { once: true });
30 });
32 let win = window.open(`https://example.com/tests/dom/xslt/tests/mochitest/file_bug1729517_2.xml`);
33 for (const [header, result] of await results) {
34 is(result, "PASS", `${header} of the source document should apply to document created by XSLT.`);
36 win.close();
38 SimpleTest.finish();
40 </script>
41 </head>
42 <body onload="runTest();">
43 <p id="display"></p>
44 <iframe sandbox="allow-same-origin" id="frame"></iframe>
45 <div id="content" style="display: none"></div>
46 <pre id="test"></pre>
47 </body>
48 </html>