Chromium Code Reviews| 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="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.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() { |
| 11 // Check availability of constructors. | 11 // Check availability of constructors. |
| 12 shouldBeTrue("'webkitSpeechRecognition' in self"); | 12 shouldBeTrue("'webkitSpeechRecognition' in self"); |
| 13 shouldBeFalse("webkitSpeechRecognition == null"); | 13 shouldBeFalse("webkitSpeechRecognition == null"); |
| 14 | 14 |
| 15 oneMatchTest(); | 15 nullServiceURI(); |
| 16 } | |
| 17 | |
| 18 function nullServiceURI(){ | |
| 19 debug('\nnullServiceURI():'); | |
| 20 evalAndLog("window.r = new webkitSpeechRecognition()"); | |
| 21 | |
| 22 r.onend = function() { | |
| 23 debug('onend'); | |
| 24 validServiceURI(); | |
| 25 } | |
| 26 | |
| 27 shouldNotThrow("r.start()"); | |
| 28 } | |
| 29 | |
| 30 function validServiceURI(){ | |
| 31 debug('\nvalidServiceURI():'); | |
| 32 evalAndLog("window.r = new webkitSpeechRecognition()"); | |
| 33 evalAndLog("r.serviceURI = 'vendor://com.google?foo=bar&client=chromium/com. example'"); | |
|
gshires1
2015/05/20 20:55:09
Change this to "chrome://speech-recognition?foo=ba
kirtia
2015/06/02 20:56:57
Done.
| |
| 34 | |
| 35 r.onend = function() { | |
| 36 debug('onend'); | |
| 37 oneMatchTest(); | |
| 38 } | |
| 39 | |
| 40 shouldNotThrow("r.start()"); | |
| 16 } | 41 } |
| 17 | 42 |
| 18 function oneMatchTest() { | 43 function oneMatchTest() { |
| 19 debug('\noneMatchTest():'); | 44 debug('\noneMatchTest():'); |
| 20 var r = new webkitSpeechRecognition(); | 45 var r = new webkitSpeechRecognition(); |
| 21 window.count = 0; | 46 window.count = 0; |
| 22 | 47 |
| 23 r.onstart = function() { debug('onstart'); shouldBe('count', ' 0'); ++count; } | 48 r.onstart = function() { debug('onstart'); shouldBe('count', ' 0'); ++count; } |
| 24 r.onaudiostart = function() { debug('onaudiostart'); shouldBe('count', ' 1'); ++count; } | 49 r.onaudiostart = function() { debug('onaudiostart'); shouldBe('count', ' 1'); ++count; } |
| 25 r.onsoundstart = function() { debug('onsoundstart'); shouldBe('count', ' 2'); ++count; } | 50 r.onsoundstart = function() { debug('onsoundstart'); shouldBe('count', ' 2'); ++count; } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 } | 111 } |
| 87 | 112 |
| 88 r.start(); | 113 r.start(); |
| 89 } | 114 } |
| 90 | 115 |
| 91 window.onload = run; | 116 window.onload = run; |
| 92 window.jsTestIsAsync = true; | 117 window.jsTestIsAsync = true; |
| 93 </script> | 118 </script> |
| 94 </body> | 119 </body> |
| 95 </html> | 120 </html> |
| OLD | NEW |