summaryrefslogtreecommitdiffstats
path: root/parser/htmlparser/tests
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-12-22 23:48:40 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-12-22 23:48:40 +0100
commitf71108680b30848e48e0a1f7a6cef7fa37ec46b1 (patch)
tree6837e8112b25b27c6f627629e11032bfcf73deef /parser/htmlparser/tests
parentdfa7af70ce4cd662add88f5e2a881e1054d91ef2 (diff)
downloadUXP-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.tar
UXP-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.tar.gz
UXP-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.tar.lz
UXP-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.tar.xz
UXP-f71108680b30848e48e0a1f7a6cef7fa37ec46b1.zip
Issue #1118 - Part 6: Fix various tests that are no longer correct.
The behavior change of document.open() requires these tests to be changed to account for the new spec behavior.
Diffstat (limited to 'parser/htmlparser/tests')
-rw-r--r--parser/htmlparser/tests/mochitest/test_bug715739.html34
1 files changed, 25 insertions, 9 deletions
diff --git a/parser/htmlparser/tests/mochitest/test_bug715739.html b/parser/htmlparser/tests/mochitest/test_bug715739.html
index 597160a19..e59fdf332 100644
--- a/parser/htmlparser/tests/mochitest/test_bug715739.html
+++ b/parser/htmlparser/tests/mochitest/test_bug715739.html
@@ -33,24 +33,30 @@ function textChildren(node) {
return s;
}
+var f, d;
+
function tick() {
runNumber++;
- var f = document.getElementsByTagName("iframe")[0];
- var d = f.contentDocument;
+ f = document.getElementsByTagName("iframe")[0];
+ d = f.contentDocument;
if (runNumber == 1) {
- d.open();
- f.addEventListener("load", tick);
- d.write("X");
- d.write("\u003cscript>document.write('Y');\u003c/script>");
- d.write("Z");
- d.close();
+ frames[1].setTimeout(`
+ var d = parent.d;
+ var f = parent.f;
+ d.open();
+ f.addEventListener("load", parent.tick);
+ d.write("X");
+ d.write("\u003cscript>document.write('Y');\u003c/script>");
+ d.write("Z");
+ d.close();
+ `);
return;
}
if (runNumber == 2) {
var text = textChildren(d.body);
- is(text, "XYZ", "Wrong text before reload.");
+ is(text, "ABC", "Wrong text before reload.");
f.contentWindow.location.reload();
return;
}
@@ -63,10 +69,20 @@ function tick() {
}
}
+// We want to trigger a document.open/write with a different window as the
+// entry global. Let's give that window a blob URL so we don't have to set up
+// extra helper files.
+var blob = new Blob(["ABC"], { type: "text/html" });
+var blobURL = URL.createObjectURL(blob);
+
</script>
</pre>
<div id="content" style="display: none">
<iframe></iframe>
+ <iframe></iframe>
</div>
+<script>
+ document.querySelectorAll("iframe")[1].src = blobURL;
+</script>
</body>
</html>