tor-browser

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

file_speech_simple.html (1612B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=650295
      5 -->
      6 <head>
      7  <meta charset="utf-8">
      8  <title>Test for Bug 650295: Web Speech API check all classes are present</title>
      9  <script type="application/javascript">
     10    window.SimpleTest = parent.SimpleTest;
     11    window.info = parent.info;
     12    window.is = parent.is;
     13    window.isnot = parent.isnot;
     14    window.ok = parent.ok;
     15  </script>
     16  <script type="application/javascript" src="common.js"></script>
     17 </head>
     18 <body>
     19 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=650295">Mozilla Bug 650295</a>
     20 <p id="display"></p>
     21 <div id="content" style="display: none">
     22  
     23 </div>
     24 <pre id="test">
     25 <script type="application/javascript">
     26 
     27 /** Test for Bug 525444 */
     28 
     29 var gotStartEvent = false;
     30 var gotBoundaryEvent = false;
     31 var utterance = new SpeechSynthesisUtterance("Hello, world!");
     32 utterance.addEventListener('start', function(e) {
     33  ok(speechSynthesis.speaking, "speechSynthesis is speaking.");
     34  ok(!speechSynthesis.pending, "speechSynthesis has no other utterances queued.");
     35  gotStartEvent = true;
     36 });
     37 
     38 utterance.addEventListener('end', function(e) {
     39  ok(!speechSynthesis.speaking, "speechSynthesis is not speaking.");
     40  ok(!speechSynthesis.pending, "speechSynthesis has no other utterances queued.");
     41  ok(gotStartEvent, "Got 'start' event.");
     42  info('end ' + e.elapsedTime);
     43  SimpleTest.finish();
     44 });
     45 
     46 speechSynthesis.speak(utterance);
     47 ok(!speechSynthesis.speaking, "speechSynthesis is not speaking yet.");
     48 ok(speechSynthesis.pending, "speechSynthesis has an utterance queued.");
     49 
     50 </script>
     51 </pre>
     52 </body>
     53 </html>