tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug1365383.html (1286B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1365383
      5 -->
      6 <head>
      7  <title>Test for Bug 1365383</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" href="/tests/SimpleTest/test.css">
     10 </head>
     11 
     12 <body>
     13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1365383">Mozilla Bug 1365383</a>
     14 <p id="display"></p>
     15 <div id="content">
     16 <textarea id="editor" spellcheck="true"></textarea>
     17 </div>
     18 <pre id="test">
     19 <script class="testbody" type="text/javascript">
     20 SimpleTest.waitForExplicitFinish();
     21 SimpleTest.waitForFocus(() => {
     22  let textarea = document.getElementById("editor");
     23  let editor = SpecialPowers.wrap(textarea).editor;
     24 
     25  let spellChecker = SpecialPowers.Cu.createSpellChecker();
     26 
     27  // Callback parameter isn't set
     28  spellChecker.InitSpellChecker(editor, false);
     29 
     30  textarea.focus();
     31 
     32  const { onSpellCheck } = SpecialPowers.ChromeUtils.importESModule(
     33    "resource://testing-common/AsyncSpellCheckTestHelper.sys.mjs"
     34  );
     35  onSpellCheck(textarea, () => {
     36    // Callback parameter isn't set
     37    spellChecker.UpdateCurrentDictionary();
     38 
     39    var canSpellCheck = spellChecker.canSpellCheck();
     40    ok(canSpellCheck, "spellCheck is enabled");
     41    SimpleTest.finish();
     42  });
     43 });
     44 </script>
     45 </body>
     46 </html>