Bug 1332876 - test. a=test-only
authorMats Palmgren <mats@mozilla.com>
Mon, 30 Jan 2017 04:54:38 +0100
changeset 375764 cf1c3ab4b7aaa33f0b46dd2061351afe69ebc523
parent 375763 927ab26019d8fb81fe497548fc7f7d0c33383412
child 375765 8e911bf5de822c82d33e78bc5da07a0c811e635e
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs1332876
milestone53.0a2
Bug 1332876 - test. a=test-only
editor/libeditor/tests/mochitest.ini
editor/libeditor/tests/test_bug1332876.html
--- a/editor/libeditor/tests/mochitest.ini
+++ b/editor/libeditor/tests/mochitest.ini
@@ -212,16 +212,17 @@ skip-if = toolkit == 'android'
 [test_bug1258085.html]
 [test_bug1268736.html]
 [test_bug1310912.html]
 skip-if = toolkit == 'android' # bug 1315898
 [test_bug1314790.html]
 [test_bug1315065.html]
 [test_bug1316302.html]
 [test_bug1330796.html]
+[test_bug1332876.html]
 
 [test_CF_HTML_clipboard.html]
 subsuite = clipboard
 [test_composition_event_created_in_chrome.html]
 [test_contenteditable_focus.html]
 [test_dom_input_event_on_htmleditor.html]
 skip-if = toolkit == 'android' # bug 1054087
 [test_dom_input_event_on_texteditor.html]
new file mode 100644
--- /dev/null
+++ b/editor/libeditor/tests/test_bug1332876.html
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=795418
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 1332876</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1332876">Mozilla Bug 1332876</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+
+<iframe src="data:text/html,<html><body><span>Edit me!</span>"></iframe>
+
+<pre id="test">
+
+<script type="application/javascript">
+
+/** Test for Bug 1332876 **/
+SimpleTest.waitForExplicitFinish();
+SimpleTest.waitForFocus(function() {
+  var iframe = document.querySelector("iframe");
+  iframe.contentDocument.designMode='on';
+
+  iframe.contentWindow.addEventListener('keypress', function() {
+    iframe.style.display='none';
+    document.body.offsetHeight;
+    ok(true, "did not crash");
+    SimpleTest.finish();
+  });
+
+  iframe.contentWindow.addEventListener('click', function() {
+    synthesizeKey('a', {}, iframe.contentWindow);
+  });
+
+  synthesizeMouse(iframe,20,20,{})
+});
+
+</script>
+
+</pre>
+</body>
+</html>