зеркало из https://github.com/mozilla/pjs.git
Tests for bug 582181, r=roc
This commit is contained in:
Родитель
6af87e936f
Коммит
674618958f
|
@ -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
|
||||
فلان فلان
|
||||
<ref>ooo</ref>
|
||||
<references /></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>
|
Загрузка…
Ссылка в новой задаче