blob: 94a4a7c93ce38d75578612068ee019bc4d54ecad [file] [log] [blame]
<!doctype html>
<body>
<script>
window.results = null;
window.getFirstTranscript = function() {
var rs = window.results;
if (!rs || !rs.length) { return 'NOTFOUND'; }
var r = rs[0];
if (!r.length) { return 'NOTFOUND'; }
return r.item(0).transcript;
};
window.testSpeechRecognition = function() {
var reco = new webkitSpeechRecognition();
reco.continuous = true;
reco.onresult = function(e) {
try {
document.title = 'PASS';
window.results = e.results;
} catch(ex) {
document.title = 'FAIL';
}
}
reco.onerror = function(e) {
document.title = 'FAIL';
}
try {
reco.start();
} catch(e) {
document.title = 'FAIL';
}
};
</script>
</body>