Bug 1382568: Test. r?heycam draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 05 Aug 2017 08:53:03 +0200
changeset 641064 0e18b0b07a1cf945ddf5ad766337b066886501c9
parent 641061 70b74e3883a3c07fbd815138e9c1d2dfa5fe2fb8
child 724710 98aa28e79ec2286ca1acde3b6452559c30ac462c
push id72422
push userbmo:emilio+bugs@crisal.io
push dateSat, 05 Aug 2017 07:07:06 +0000
reviewersheycam
bugs1382568
milestone56.0a1
Bug 1382568: Test. r?heycam MozReview-Commit-ID: DLvVBoXubGT
layout/style/test/bug1382568-iframe.html
layout/style/test/mochitest.ini
layout/style/test/test_bug1382568.html
new file mode 100644
--- /dev/null
+++ b/layout/style/test/bug1382568-iframe.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<iframe src="http://example.com/doesnt-matter-because-it-gets-blocked-due-to-mixed-content"></iframe>
+<script>
+window.addEventListener('load', function(){
+  window[0].document.body.innerText;
+  window.parent.postMessage({ result: "ok" }, "*");
+}, false);
+</script>
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -156,16 +156,18 @@ support-files = file_bug1055933_circle-x
 support-files = file_bug1089417_iframe.html
 [test_bug1112014.html]
 [test_bug1203766.html]
 [test_bug1232829.html]
 [test_bug1292447.html]
 [test_bug1371488.html]
 [test_bug1375944.html]
 support-files = file_bug1375944.html Ahem.ttf
+[test_bug1382568.html]
+support-files = bug1382568-iframe.html
 [test_cascade.html]
 [test_ch_ex_no_infloops.html]
 [test_change_hint_optimizations.html]
 [test_clip-path_polygon.html]
 [test_color_rounding.html]
 [test_compute_data_with_start_struct.html]
 skip-if = toolkit == 'android'
 [test_computed_style.html]
new file mode 100644
--- /dev/null
+++ b/layout/style/test/test_bug1382568.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Test for bug 1382568: calling innerText on an uninitialized presshell doesn't crash</title>
+<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+<script>
+  window.onmessage = function(e) {
+    is(e.data.result, "ok", "Child frame should load properly");
+    SimpleTest.finish();
+  };
+</script>
+<iframe src="https://example.com/tests/layout/style/test/bug1382568-iframe.html"></iframe>
+<script>
+  SimpleTest.waitForExplicitFinish();
+</script>