summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/tests/test_bug487524.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /editor/libeditor/tests/test_bug487524.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'editor/libeditor/tests/test_bug487524.html')
-rw-r--r--editor/libeditor/tests/test_bug487524.html65
1 files changed, 65 insertions, 0 deletions
diff --git a/editor/libeditor/tests/test_bug487524.html b/editor/libeditor/tests/test_bug487524.html
new file mode 100644
index 000000000..d4972ba91
--- /dev/null
+++ b/editor/libeditor/tests/test_bug487524.html
@@ -0,0 +1,65 @@
+<!DOCTYPE HTML>
+<html><head>
+<title>Test for bug 487524</title>
+<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
+
+<script class="testbody" type="application/javascript">
+function runTest() {
+
+ function setupIframe(e,html,focus_id) {
+ var doc = e.contentDocument;
+ doc.body.innerHTML = html;
+ doc.designMode = "on";
+ e = doc.getElementById(focus_id);
+ doc.defaultView.focus();
+ if (e) e.focus();
+ return e;
+ }
+
+ var i1 = document.getElementById('i1')
+ var li1 = setupIframe(i1,'<ul><li id="li1">one</li><li>two</li><ul><li>a</li></ul></ul>','li1')
+ var doc = li1.ownerDocument;
+
+ var selection = doc.defaultView.getSelection();
+ selection.removeAllRanges();
+
+ var range = doc.createRange();
+ range.setStart(li1,0);
+ range.setEnd(li1.nextSibling,0);
+ selection.addRange(range);
+
+ sendKey('delete');
+ is(doc.body.innerHTML,'<ul><li>two</li><ul><li>a</li></ul></ul>','delete 1st LI');
+
+ var li2 = setupIframe(i1,'<ul><li id="li2">two</li><ul><li>a</li></ul></ul>','li2')
+ selection = doc.defaultView.getSelection();
+ selection.removeAllRanges();
+
+ range = doc.createRange();
+ range.setStart(li2,0);
+ range.setEnd(li2.nextSibling.firstChild,0);
+ selection.addRange(range);
+
+ sendKey('delete');
+ is(doc.body.innerHTML,'<ul><ul><li>a</li></ul></ul>','delete 2nd LI');
+
+ SimpleTest.finish();
+}
+
+SimpleTest.waitForExplicitFinish();
+addLoadEvent(runTest);
+</script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=487524">Mozilla Bug 487524</a>
+<p id="display"></p>
+
+<pre id="test">
+</pre>
+
+<iframe id="i1" width="200" height="100" src="about:blank"></iframe><br>
+
+</body>
+</html>