1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 chrome.app.runtime.onLaunched.addListener(function() {
7 function testWebkitSpeechRecognition() {
10 var r = new webkitSpeechRecognition();
11 r.onerror = function(e) {
17 r.onstart = function() {
19 chrome.test.succeed();
21 // With FakeSpeechRecognitionManager, we do not get onstart event. We
22 // directly get results instead.
23 r.onresult = function(e) {
25 chrome.test.assertTrue(e.results.length > 0);
26 var transcript = e.results[0][0].transcript;
27 chrome.test.assertEq('Pictures of the moon', transcript);
28 chrome.test.succeed();