layout/base/tests/test_bug332655-1.html

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

mercurial