mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1133363 - Part 3 - Fix tests. r=ehsan
This commit is contained in:
parent
8b15f2fbc5
commit
0f01e3abb2
@ -7,13 +7,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=484181
|
||||
<title>Test for Bug 484181</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=484181">Mozilla Bug 484181</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
@ -38,7 +38,7 @@ function getEditor() {
|
||||
function getSpellCheckSelection() {
|
||||
var editor = getEditor();
|
||||
var selcon = editor.selectionController;
|
||||
return selcon.getSelection(selcon.SELECTION_SPELLCHECK);
|
||||
return selcon.getSelection(selcon.SELECTION_SPELLCHECK);
|
||||
}
|
||||
|
||||
function append(str) {
|
||||
@ -63,10 +63,10 @@ function runTest() {
|
||||
onSpellCheck(edit, function () {
|
||||
is(isSpellingCheckOk(), true, "All misspellings before editing are accounted for.");
|
||||
|
||||
append(" becaz I'm a lolcat!");
|
||||
append(" becaz I'm a lulcat!");
|
||||
onSpellCheck(edit, function () {
|
||||
gMisspeltWords.push("becaz");
|
||||
gMisspeltWords.push("lolcat");
|
||||
gMisspeltWords.push("lulcat");
|
||||
is(isSpellingCheckOk(), true, "All misspellings after typing are accounted for.");
|
||||
|
||||
SimpleTest.finish();
|
||||
@ -78,12 +78,12 @@ function isSpellingCheckOk() {
|
||||
|
||||
var sel = getSpellCheckSelection();
|
||||
var numWords = sel.rangeCount;
|
||||
|
||||
|
||||
is(numWords, gMisspeltWords.length, "Correct number of misspellings and words.");
|
||||
|
||||
if (numWords != gMisspeltWords.length)
|
||||
|
||||
if (numWords != gMisspeltWords.length)
|
||||
return false;
|
||||
|
||||
|
||||
for (var i=0; i<numWords; i++) {
|
||||
var word = sel.getRangeAt(i);
|
||||
is (word, gMisspeltWords[i], "Misspelling is what we think it is.");
|
||||
|
@ -71,10 +71,10 @@ function runOnFocus() {
|
||||
|
||||
gMisspeltWords = ["haz", "cheezburger"];
|
||||
is(isSpellingCheckOk(), true, "All misspellings before editing are accounted for.");
|
||||
append(" becaz I'm a lolcat!");
|
||||
append(" becaz I'm a lulcat!");
|
||||
onSpellCheck(edit, function () {
|
||||
gMisspeltWords.push("becaz");
|
||||
gMisspeltWords.push("lolcat");
|
||||
gMisspeltWords.push("lulcat");
|
||||
is(isSpellingCheckOk(), true, "All misspellings after typing are accounted for.");
|
||||
|
||||
// Now, type an invalid word, and instead of hitting "space" at the end, just blur
|
||||
|
Loading…
Reference in New Issue
Block a user