1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/base/tests/test_bug582181-1.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,60 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=582181 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 582181</title> 1.11 + <meta charset="utf-8"> 1.12 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script> 1.14 + <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script> 1.15 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.16 +</head> 1.17 +<body onload="test()"> 1.18 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=582181">Mozilla Bug 582181</a> 1.19 +<p id="display"></p> 1.20 +<div id="content" dir="rtl"> 1.21 +<textarea rows="4" id="testInput">فارسی 1.22 +[[en:Farsi]]</textarea> 1.23 +</div> 1.24 +<pre id="test"> 1.25 +<script class="testbody" type="text/javascript"> 1.26 + 1.27 +/** Test for Bug 582181 **/ 1.28 + 1.29 +SimpleTest.waitForExplicitFinish(); 1.30 + 1.31 +function test() { 1.32 + var textInput = $("testInput"); 1.33 + var s1, s2, s3, equal, str1, str2; 1.34 + 1.35 + s1 = snapshotWindow(window); 1.36 + 1.37 + textInput.focus(); 1.38 + synthesizeKey("VK_DOWN", { }); 1.39 + synthesizeKey("VK_DOWN", { }); 1.40 + synthesizeKey("VK_RETURN", { }); 1.41 + textInput.blur(); 1.42 + s2 = snapshotWindow(window); 1.43 + 1.44 + [equal, str1, str2] = compareSnapshots(s1, s2, true); 1.45 + ok(equal, "enter after text shouldn't change rendering: expected " + 1.46 + str1 + " but got " + str2); 1.47 + 1.48 + textInput.focus(); 1.49 + synthesizeKey("VK_BACK_SPACE", { }); 1.50 + textInput.blur(); 1.51 + s3 = snapshotWindow(window); 1.52 + 1.53 + [equal, str1, str2] = compareSnapshots(s1, s3, true); 1.54 + ok(equal, "backspace shouldn't change rendering: expected " + str1 + 1.55 + " but got " + str2); 1.56 + 1.57 + SimpleTest.finish(); 1.58 +} 1.59 + 1.60 +</script> 1.61 +</pre> 1.62 +</body> 1.63 +</html>