/** Test for Bug 1200533 **/
/** Visit the elements defined above and check the dictionary we got **/
SimpleTest.waitForExplicitFinish(); var content = document.getElementById("content");
var tests = [
// text area, value of spellchecker.dictionary, result.
// Result: Document language.
[ "none", "", "en-US" ],
// Result: Element language.
[ "en-GB", "", "en-GB" ],
[ "en-gb", "", "en-GB" ],
// Result: Random en-* or en-US (if application locale is en-US).
[ "en-ZA-not-avail", "", "*" ],
[ "en-generic", "", "*" ],
[ "en", "", "*" ],
// Result: Locale.
[ "ko-not-avail", "", "en-US" ],
// Result: Preference value in all cases.
[ "en-ZA-not-avail", "en-AU", "en-AU" ],
[ "en-generic", "en-AU", "en-AU" ],
[ "ko-not-avail", "en-AU", "en-AU" ],
if (!currentDictionaries && !retrying) {
// It's possible for an asynchronous font-list update to cause a reflow
// that disrupts the async spell-check and results in not getting a
// current dictionary here; if that happens, we retry the same testcase
// by reloading the iframe without bumping loadCount.
info(`No current dictionary: retrying testcase ${loadCount}`);
retrying = true;
} else {
is(currentDictionaries.length, 1, "expected one dictionary");
let dict = currentDictionaries[0];
if (tests[loadCount][2] != "*") {
is(dict, tests[loadCount][2], "expected " + tests[loadCount][2]);
} else if (is_en_US && tests[loadCount][0].startsWith("en")) {
// Current application locale is en-US and content lang is en or
// en-unknown, so we should use en-US dictionary as default.
is(dict, "en-US", "expected en-US that is application locale");
} else { var gotEn = (dict == "en-GB" || dict == "en-AU" || dict == "en-US");
is(gotEn, true, "expected en-AU or en-GB or en-US");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.