| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script type="text/javascript"> | 7 <script type="text/javascript"> |
| 8 description('Test basic interaction with the Speech JavaScript API'); | 8 description('Test basic interaction with the Speech JavaScript API'); |
| 9 | 9 |
| 10 function run() { | 10 function run() { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 r.onsoundstart = function() { debug('onsoundstart'); shouldBe('count', '
2'); ++count; } | 25 r.onsoundstart = function() { debug('onsoundstart'); shouldBe('count', '
2'); ++count; } |
| 26 r.onspeechstart = function() { debug('onspeechstart'); shouldBe('count', '
3'); ++count; } | 26 r.onspeechstart = function() { debug('onspeechstart'); shouldBe('count', '
3'); ++count; } |
| 27 | 27 |
| 28 r.onresult = function() { | 28 r.onresult = function() { |
| 29 debug('onresult'); | 29 debug('onresult'); |
| 30 shouldBe('count', '4'); | 30 shouldBe('count', '4'); |
| 31 ++count; | 31 ++count; |
| 32 shouldBeNull('event.emma'); | 32 shouldBeNull('event.emma'); |
| 33 shouldBeNull('event.interpretation'); | 33 shouldBeNull('event.interpretation'); |
| 34 shouldBe('event.results.length', '1'); | 34 shouldBe('event.results.length', '1'); |
| 35 shouldBeNull('event.results.item(-1)'); |
| 35 shouldBe('event.results[0].length', '1'); | 36 shouldBe('event.results[0].length', '1'); |
| 36 shouldBe('event.results[0].isFinal', 'true'); | 37 shouldBe('event.results[0].isFinal', 'true'); |
| 37 shouldBeEqualToString('event.results[0].item(0).transcript', 'hello, wor
ld'); | 38 shouldBeEqualToString('event.results[0].item(0).transcript', 'hello, wor
ld'); |
| 38 shouldBeCloseTo('event.results[0].item(0).confidence', 0.42, 1e-3); | 39 shouldBeCloseTo('event.results[0].item(0).confidence', 0.42, 1e-3); |
| 40 shouldBeNull('event.results[0].item(-1)'); |
| 39 } | 41 } |
| 40 | 42 |
| 41 r.onspeechend = function() { debug('onspeechend'); shouldBe('count', '
5'); ++count; } | 43 r.onspeechend = function() { debug('onspeechend'); shouldBe('count', '
5'); ++count; } |
| 42 r.onsoundend = function() { debug('onsoundend'); shouldBe('count', '
6'); ++count; } | 44 r.onsoundend = function() { debug('onsoundend'); shouldBe('count', '
6'); ++count; } |
| 43 r.onaudioend = function() { debug('onaudioend'); shouldBe('count', '
7'); ++count; } | 45 r.onaudioend = function() { debug('onaudioend'); shouldBe('count', '
7'); ++count; } |
| 44 | 46 |
| 45 r.onend = function() { | 47 r.onend = function() { |
| 46 debug('onend'); | 48 debug('onend'); |
| 47 shouldBe('count', '8'); | 49 shouldBe('count', '8'); |
| 48 ++count; | 50 ++count; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 87 |
| 86 r.start(); | 88 r.start(); |
| 87 } | 89 } |
| 88 | 90 |
| 89 window.onload = run; | 91 window.onload = run; |
| 90 window.jsTestIsAsync = true; | 92 window.jsTestIsAsync = true; |
| 91 </script> | 93 </script> |
| 92 <script src="../../js/resources/js-test-post.js"></script> | 94 <script src="../../js/resources/js-test-post.js"></script> |
| 93 </body> | 95 </body> |
| 94 </html> | 96 </html> |
| OLD | NEW |