content/media/webspeech/synth/test/file_speech_simple.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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">
    23 </div>
    24 <pre id="test">
    25 <script type="application/javascript">
    27 /** Test for Bug 525444 **/
    29 synthAddVoice('TestSpeechServiceWithAudio', 'Male 1', 'en-GB', true);
    31 var gotStartEvent = false;
    32 var gotBoundaryEvent = false;
    33 var utterance = new SpeechSynthesisUtterance("Hello, world!");
    34 utterance.addEventListener('start', function(e) {
    35   ok(speechSynthesis.speaking, "speechSynthesis is speaking.");
    36   ok(!speechSynthesis.pending, "speechSynthesis has no other utterances queued.");
    37   gotStartEvent = true;
    38 });
    40 utterance.addEventListener('end', function(e) {
    41   ok(!speechSynthesis.speaking, "speechSynthesis is not speaking.");
    42   ok(!speechSynthesis.pending, "speechSynthesis has no other utterances queued.");
    43   ok(gotStartEvent, "Got 'start' event.");
    44   info('end ' + e.elapsedTime);
    45   synthCleanup();
    46   SimpleTest.finish();
    47 });
    49 speechSynthesis.speak(utterance);
    50 ok(!speechSynthesis.speaking, "speechSynthesis is not speaking yet.");
    51 ok(speechSynthesis.pending, "speechSynthesis has an utterance queued.");
    53 </script>
    54 </pre>
    55 </body>
    56 </html>

mercurial