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

Unified Diff: chrome/test/data/extensions/api_test/speech_input/start_error/test.js

Issue 8321003: Add API tests to the experimental Speech Input API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removing unnecessary header. Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/speech_input/start_error/test.js
diff --git a/chrome/test/data/extensions/api_test/speech_input/start_error/test.js b/chrome/test/data/extensions/api_test/speech_input/start_error/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..39a8831f772d741e261e09d329b0c2f14602d45e
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/speech_input/start_error/test.js
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Extension Speech Input api test.
+// browser_tests --gtest_filter="ExtensionSpeechInputApiTest.*"
+
+chrome.test.runTests([
+ function testSpeechInputStartError() {
+
+ // Recording is not active, start it.
+ chrome.experimental.speechInput.isRecording(function(recording) {
+ chrome.test.assertNoLastError();
+ chrome.test.assertFalse(recording);
+ chrome.experimental.speechInput.start({}, started);
+ });
+
+ // Start should fail because no devices are available.
+ function started() {
+ chrome.test.assertEq(chrome.extension.lastError.message,
+ "noRecordingDeviceFound");
+
+ // Recording shouldn't have started.
+ chrome.experimental.speechInput.isRecording(function(recording) {
+ chrome.test.assertNoLastError();
+ chrome.test.assertFalse(recording);
+
+ // Stopping should fail since we're back in the idle state.
+ chrome.experimental.speechInput.stop(function() {
+ chrome.test.assertEq(chrome.extension.lastError.message,
+ "invalidOperation");
+ chrome.test.succeed();
+ });
+ });
+ }
+ }
+]);

Powered by Google App Engine
This is Rietveld 408576698