summaryrefslogtreecommitdiffstats
path: root/parser/htmlparser
diff options
context:
space:
mode:
Diffstat (limited to 'parser/htmlparser')
-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>