Bug 1133363 - Part 3 - Fix tests. r=ehsan

This commit is contained in:
Ekanan Ketunuti 2015-02-25 20:24:58 +07:00
parent 8b15f2fbc5
commit 0f01e3abb2
2 changed files with 11 additions and 11 deletions

View File

@ -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.");

View File

@ -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