This commit is contained in:
Simon Montagu 2011-06-15 10:45:57 +03:00
Родитель 6af87e936f
Коммит 674618958f
3 изменённых файлов: 121 добавлений и 0 удалений

Просмотреть файл

@ -149,6 +149,8 @@ _TEST_FILES = \
test_bug548545.xhtml \
test_bug558663.html \
test_bug559499.html \
test_bug582181-1.html \
test_bug582181-2.html \
test_flush_on_paint.html \
test_mozPaintCount.html \
test_scroll_selection_into_view.html \

Просмотреть файл

@ -0,0 +1,58 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=582181
-->
<head>
<title>Test for Bug 582181</title>
<meta charset="utf-8">
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="test()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=582181">Mozilla Bug 582181</a>
<p id="display"></p>
<div id="content" dir="rtl">
<textarea rows="4" id="testInput">فارسی
[[en:Farsi]]</textarea>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 582181 **/
SimpleTest.waitForExplicitFinish();
function test() {
var textInput = $("testInput");
var s1, s2, s3, equal, str1, str2;
textInput.focus();
s1 = snapshotWindow(window);
synthesizeKey("VK_DOWN", { });
synthesizeKey("VK_DOWN", { });
synthesizeKey("VK_ENTER", { });
s2 = snapshotWindow(window);
[equal, str1, str2] = compareSnapshots(s1, s2, true);
ok(equal, "enter after text shouldn't change rendering: expected " +
str1 + " but got " + str2);
synthesizeKey("VK_BACK_SPACE", { });
s3 = snapshotWindow(window);
[equal, str1, str2] = compareSnapshots(s1, s3, true);
ok(equal, "backspace shouldn't change rendering: expected " + str1 +
" but got " + str2);
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -0,0 +1,61 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=582181
-->
<head>
<title>Test for Bug 582181</title>
<meta charset="utf-8">
<script type="text/javascript" src="/MochiKit/packed.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="test()">
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=582181">Mozilla Bug 582181</a>
<p id="display"></p>
<div id="content" dir="rtl">
<textarea rows="5" id="testInput">Blah blah
فلان فلان
&lt;ref&gt;ooo&lt;/ref&gt;
&lt;references /&gt;</textarea>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
/** Test for Bug 582181 **/
SimpleTest.waitForExplicitFinish();
function test() {
var textInput = $("testInput");
var s1, s2, s3, equal, str1, str2;
textInput.focus();
s1 = snapshotWindow(window);
synthesizeKey("VK_DOWN", { });
synthesizeKey("VK_DOWN", { });
synthesizeKey("VK_DOWN", { });
synthesizeKey("VK_DOWN", { });
synthesizeKey("VK_BACK_SPACE", { });
s2 = snapshotWindow(window);
[unequal, str1, str2] = compareSnapshots(s1, s2, false);
ok(unequal, "backspace after text should change rendering: got " + str2);
synthesizeKey(">", { });
s3 = snapshotWindow(window);
[equal, str1, str2] = compareSnapshots(s1, s3, true);
ok(equal, "entering '>' should restore original rendering: expected " + str1 +
" but got " + str2);
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>