OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |