Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / data / speech / web_speech_test.html
blob94a4a7c93ce38d75578612068ee019bc4d54ecad
1 <!doctype html>
2 <body>
3 <script>
4 window.results = null;
6 window.getFirstTranscript = function() {
7 var rs = window.results;
8 if (!rs || !rs.length) { return 'NOTFOUND'; }
9 var r = rs[0];
10 if (!r.length) { return 'NOTFOUND'; }
11 return r.item(0).transcript;
14 window.testSpeechRecognition = function() {
15 var reco = new webkitSpeechRecognition();
16 reco.continuous = true;
17 reco.onresult = function(e) {
18 try {
19 document.title = 'PASS';
20 window.results = e.results;
21 } catch(ex) {
22 document.title = 'FAIL';
25 reco.onerror = function(e) {
26 document.title = 'FAIL';
28 try {
29 reco.start();
30 } catch(e) {
31 document.title = 'FAIL';
34 </script>
35 </body>