1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/editor/composer/test/test_bug338427.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,57 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=338427 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 338427</title> 1.11 + <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" /> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=338427">Mozilla Bug 338427</a> 1.16 +<p id="display"></p> 1.17 +<div id="content"> 1.18 +<textarea id="editor" lang="testing-XX" spellcheck="true"></textarea> 1.19 + 1.20 +</div> 1.21 +<pre id="test"> 1.22 +<script class="testbody" type="text/javascript"> 1.23 + 1.24 +/** Test for Bug 338427 **/ 1.25 +function init() { 1.26 + Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm"); 1.27 + 1.28 + var textarea = document.getElementById("editor"); 1.29 + var editor = textarea.editor; 1.30 + var spellchecker = editor.getInlineSpellChecker(true); 1.31 + spellchecker.enableRealTimeSpell = true; 1.32 + textarea.focus(); 1.33 + 1.34 + onSpellCheck(textarea, function () { 1.35 + var list = {}, count = {}; 1.36 + spellchecker.spellChecker.GetDictionaryList(list, count); 1.37 + ok(count.value > 0, "At least one dictionary should be present"); 1.38 + 1.39 + var lang = list.value[0]; 1.40 + spellchecker.spellChecker.SetCurrentDictionary(lang); 1.41 + 1.42 + onSpellCheck(textarea, function () { 1.43 + try { 1.44 + var dictionary = 1.45 + spellchecker.spellChecker.GetCurrentDictionary(); 1.46 + } catch(e) {} 1.47 + is(dictionary, lang, "Unexpected spell check dictionary"); 1.48 + SimpleTest.finish(); 1.49 + }); 1.50 + }); 1.51 +} 1.52 + 1.53 +SimpleTest.waitForExplicitFinish(); 1.54 +addLoadEvent(init); 1.55 + 1.56 +</script> 1.57 +</pre> 1.58 +</body> 1.59 +</html> 1.60 +