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

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html lang="en-US">
michael@0 3 <!--
michael@0 4 https://bugzilla.mozilla.org/show_bug.cgi?id=525444
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <meta charset="utf-8">
michael@0 8 <title>Test for Bug 525444: Web Speech API, check speech synth queue</title>
michael@0 9 <script type="application/javascript">
michael@0 10 window.SimpleTest = parent.SimpleTest;
michael@0 11 window.is = parent.is;
michael@0 12 window.isnot = parent.isnot;
michael@0 13 window.ok = parent.ok;
michael@0 14 </script>
michael@0 15 <script type="application/javascript" src="common.js"></script>
michael@0 16 </head>
michael@0 17 <body>
michael@0 18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=525444">Mozilla Bug 525444</a>
michael@0 19 <p id="display"></p>
michael@0 20 <div id="content" style="display: none">
michael@0 21
michael@0 22 </div>
michael@0 23 <pre id="test">
michael@0 24 <script type="application/javascript">
michael@0 25
michael@0 26 /** Test for Bug 525444 **/
michael@0 27
michael@0 28 var englishJamaican = synthAddVoice('TestSpeechServiceNoAudio',
michael@0 29 'Bob Marley', 'en-JM', true);
michael@0 30 var englishBritish = synthAddVoice('TestSpeechServiceNoAudio',
michael@0 31 'Amy Winehouse', 'en-GB', true);
michael@0 32 var englishCanadian = synthAddVoice('TestSpeechServiceNoAudio',
michael@0 33 'Leonard Cohen', 'en-CA', true);
michael@0 34 var frenchCanadian = synthAddVoice('TestSpeechServiceNoAudio',
michael@0 35 'Celine Dion', 'fr-CA', true);
michael@0 36 var spanishMexican = synthAddVoice('TestSpeechServiceNoAudio',
michael@0 37 'Julieta Venegas', 'es-MX', true);
michael@0 38
michael@0 39 synthSetDefault(englishBritish, true);
michael@0 40
michael@0 41 synthTestQueue(
michael@0 42 [[{text: "Hello, world."},
michael@0 43 { uri: englishBritish }],
michael@0 44 [{text: "Bonjour tout le monde .", lang: "fr", rate: 0.5, pitch: 0.75},
michael@0 45 { uri: frenchCanadian, rate: 0.5, pitch: 0.75}],
michael@0 46 [{text: "How are you doing?", lang: "en-GB"},
michael@0 47 { rate: 1, pitch: 1, uri: englishBritish}],
michael@0 48 [{text: "¡hasta mañana", lang: "es-ES"},
michael@0 49 { uri: spanishMexican }]],
michael@0 50 function () {
michael@0 51 synthSetDefault(englishJamaican, true);
michael@0 52 var test_data = [[{text: "I shot the sheriff."},
michael@0 53 { uri: englishJamaican }]];
michael@0 54 var voices = speechSynthesis.getVoices();
michael@0 55 for (var i in voices) {
michael@0 56 test_data.push([{text: "Hello world", voice: voices[i]},
michael@0 57 {uri: voices[i].voiceURI}]);
michael@0 58 }
michael@0 59
michael@0 60 synthTestQueue(test_data,
michael@0 61 function () {
michael@0 62 synthCleanup();
michael@0 63 SimpleTest.finish();
michael@0 64 });
michael@0 65 });
michael@0 66
michael@0 67
michael@0 68
michael@0 69 </script>
michael@0 70 </pre>
michael@0 71 </body>
michael@0 72 </html>

mercurial