1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/editor/libeditor/text/tests/test_bug596001.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=596001 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 596001</title> 1.11 + <script type="application/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=596001">Mozilla Bug 596001</a> 1.17 +<p id="display"></p> 1.18 +<div id="content"> 1.19 +<textarea id="src">a	b</textarea> 1.20 +<textarea id="dst"></textarea> 1.21 +</div> 1.22 +<pre id="test"> 1.23 +<script type="application/javascript"> 1.24 + 1.25 +/** Test for Bug 596001 **/ 1.26 + 1.27 +function testTab(prefix, callback) { 1.28 + var src = document.getElementById("src"); 1.29 + var dst = document.getElementById("dst"); 1.30 + dst.value = prefix; 1.31 + src.focus(); 1.32 + src.select(); 1.33 + SimpleTest.waitForClipboard("a\tb", 1.34 + function() { 1.35 + synthesizeKey("c", {accelKey: true}); 1.36 + }, 1.37 + function() { 1.38 + dst.focus(); 1.39 + var inputReceived = false; 1.40 + dst.addEventListener("input", function() inputReceived = true, false); 1.41 + synthesizeKey("v", {accelKey: true}); 1.42 + ok(inputReceived, "An input event should be raised"); 1.43 + is(dst.value, prefix + src.value, "The value should be pasted verbatim"); 1.44 + callback(); 1.45 + }, 1.46 + callback 1.47 + ); 1.48 +} 1.49 + 1.50 +testTab("", function() { 1.51 + testTab("foo", function() { 1.52 + }); 1.53 +}); 1.54 + 1.55 +</script> 1.56 +</pre> 1.57 +</body> 1.58 +</html>