1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/editor/libeditor/html/tests/test_bug966552.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=966552 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 966552</title> 1.11 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.14 +</head> 1.15 +<body> 1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=966552">Mozilla Bug 966552</a> 1.17 +<p id="display"></p> 1.18 +<div id="content" style="display: none"> 1.19 +</div> 1.20 +<pre id="test"> 1.21 +<script class="testbody" type="text/javascript"> 1.22 +SimpleTest.waitForExplicitFinish(); 1.23 + 1.24 +addLoadEvent(function() { 1.25 + var win = window.open("data:text/html,<body onload=\"document.designMode='on'\">test</body>", "", "test-966552"); 1.26 + win.addEventListener("load", function onLoad() { 1.27 + win.removeEventListener("load", onLoad); 1.28 + runTest(win); 1.29 + }, false); 1.30 +}); 1.31 + 1.32 +function runTest(win) { 1.33 + SimpleTest.waitForFocus(function() { 1.34 + var doc = win.document; 1.35 + var sel = win.getSelection(); 1.36 + doc.body.focus(); 1.37 + sel.collapse(doc.body.firstChild, 2); 1.38 + synthesizeKey("VK_BACK_SPACE", {ctrlKey: true}, win); 1.39 + is(doc.body.textContent, "st"); 1.40 + win.close(); 1.41 + SimpleTest.finish(); 1.42 + }, win); 1.43 +} 1.44 + 1.45 +</script> 1.46 +</pre> 1.47 +</body> 1.48 +</html>