Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/test/data/extensions/api_test/speech_input/recognition_error/test.js

Issue 11745015: Update references to the extension messaging APIs to point to the "runtime" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Extension Speech Input api test. 5 // Extension Speech Input api test.
6 // browser_tests --gtest_filter="ExtensionSpeechInputApiTest.*" 6 // browser_tests --gtest_filter="ExtensionSpeechInputApiTest.*"
7 7
8 chrome.test.runTests([ 8 chrome.test.runTests([
9 function testSpeechInputRecognitionError() { 9 function testSpeechInputRecognitionError() {
10 // Results should never be provided in this test case. 10 // Results should never be provided in this test case.
11 chrome.experimental.speechInput.onResult.addListener(function(event) { 11 chrome.experimental.speechInput.onResult.addListener(function(event) {
12 chrome.test.fail(); 12 chrome.test.fail();
13 }); 13 });
14 14
15 // Ensure the recognition error happens. 15 // Ensure the recognition error happens.
16 chrome.experimental.speechInput.onError.addListener(function(error) { 16 chrome.experimental.speechInput.onError.addListener(function(error) {
17 chrome.test.assertEq(error.code, "networkError"); 17 chrome.test.assertEq(error.code, "networkError");
18 18
19 // No recording should be happening after an error. 19 // No recording should be happening after an error.
20 chrome.experimental.speechInput.isRecording(function(recording) { 20 chrome.experimental.speechInput.isRecording(function(recording) {
21 chrome.test.assertNoLastError(); 21 chrome.test.assertNoLastError();
22 chrome.test.assertFalse(recording); 22 chrome.test.assertFalse(recording);
23 23
24 // Stopping should fail since we're in the idle state again. 24 // Stopping should fail since we're in the idle state again.
25 chrome.experimental.speechInput.stop(function() { 25 chrome.experimental.speechInput.stop(function() {
26 chrome.test.assertEq(chrome.extension.lastError.message, 26 chrome.test.assertEq(chrome.runtime.lastError.message,
27 "invalidOperation"); 27 "invalidOperation");
28 chrome.test.succeed(); 28 chrome.test.succeed();
29 }); 29 });
30 }); 30 });
31 }); 31 });
32 32
33 // Start recording. 33 // Start recording.
34 chrome.experimental.speechInput.start({}, function() { 34 chrome.experimental.speechInput.start({}, function() {
35 chrome.test.assertNoLastError(); 35 chrome.test.assertNoLastError();
36 }); 36 });
37 } 37 }
38 ]); 38 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698