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

Side by Side Diff: chrome/browser/speech/speech_recognizer_unittest.cc

Issue 4119004: Add ability to parse multiple recognition results and send them to WebKit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move header to chrome/common and address review comments. Created 10 years, 1 month 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
« no previous file with comments | « chrome/browser/speech/speech_recognizer.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <vector> 5 #include <vector>
6 6
7 #include "chrome/browser/browser_thread.h" 7 #include "chrome/browser/browser_thread.h"
8 #include "chrome/browser/speech/speech_recognizer.h" 8 #include "chrome/browser/speech/speech_recognizer.h"
9 #include "chrome/common/net/test_url_fetcher_factory.h" 9 #include "chrome/common/net/test_url_fetcher_factory.h"
10 #include "media/audio/test_audio_input_controller_factory.h" 10 #include "media/audio/test_audio_input_controller_factory.h"
(...skipping 26 matching lines...) Expand all
37 audio_packet_.resize(audio_packet_length_bytes); 37 audio_packet_.resize(audio_packet_length_bytes);
38 } 38 }
39 39
40 void StartTest() { 40 void StartTest() {
41 EXPECT_TRUE(recognizer_->StartRecording()); 41 EXPECT_TRUE(recognizer_->StartRecording());
42 } 42 }
43 43
44 // SpeechRecognizer::Delegate methods. 44 // SpeechRecognizer::Delegate methods.
45 virtual void SetRecognitionResult(int caller_id, 45 virtual void SetRecognitionResult(int caller_id,
46 bool error, 46 bool error,
47 const string16& result) { 47 const SpeechInputResultArray& result) {
48 result_received_ = true; 48 result_received_ = true;
49 } 49 }
50 50
51 virtual void DidCompleteRecording(int caller_id) { 51 virtual void DidCompleteRecording(int caller_id) {
52 recording_complete_ = true; 52 recording_complete_ = true;
53 } 53 }
54 54
55 virtual void DidCompleteRecognition(int caller_id) { 55 virtual void DidCompleteRecognition(int caller_id) {
56 recognition_complete_ = true; 56 recognition_complete_ = true;
57 } 57 }
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 MessageLoop::current()->RunAllPending(); 293 MessageLoop::current()->RunAllPending();
294 EXPECT_FLOAT_EQ(0.9f, volume_); 294 EXPECT_FLOAT_EQ(0.9f, volume_);
295 295
296 EXPECT_EQ(SpeechRecognizer::RECOGNIZER_NO_ERROR, error_); 296 EXPECT_EQ(SpeechRecognizer::RECOGNIZER_NO_ERROR, error_);
297 EXPECT_FALSE(recording_complete_); 297 EXPECT_FALSE(recording_complete_);
298 EXPECT_FALSE(recognition_complete_); 298 EXPECT_FALSE(recognition_complete_);
299 recognizer_->CancelRecognition(); 299 recognizer_->CancelRecognition();
300 } 300 }
301 301
302 } // namespace speech_input 302 } // namespace speech_input
OLDNEW
« no previous file with comments | « chrome/browser/speech/speech_recognizer.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698