| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/public/test/fake_speech_recognition_manager.h" | 5 #include "content/public/test/fake_speech_recognition_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 did_cancel_all_ = true; | 121 did_cancel_all_ = true; |
| 122 } | 122 } |
| 123 | 123 |
| 124 void FakeSpeechRecognitionManager::AbortAllSessionsForRenderView( | 124 void FakeSpeechRecognitionManager::AbortAllSessionsForRenderView( |
| 125 int render_process_id, int render_view_id) { | 125 int render_process_id, int render_view_id) { |
| 126 DCHECK(delegate_); // We only expect this to be called via |delegate_|. | 126 DCHECK(delegate_); // We only expect this to be called via |delegate_|. |
| 127 } | 127 } |
| 128 | 128 |
| 129 bool FakeSpeechRecognitionManager::HasAudioInputDevices() { return true; } | 129 bool FakeSpeechRecognitionManager::HasAudioInputDevices() { return true; } |
| 130 | 130 |
| 131 base::string16 FakeSpeechRecognitionManager::GetAudioInputDeviceModel() { | |
| 132 return base::string16(); | |
| 133 } | |
| 134 | |
| 135 int FakeSpeechRecognitionManager::GetSession(int render_process_id, | 131 int FakeSpeechRecognitionManager::GetSession(int render_process_id, |
| 136 int render_view_id, | 132 int render_view_id, |
| 137 int request_id) const { | 133 int request_id) const { |
| 138 return session_ctx_.render_process_id == render_process_id && | 134 return session_ctx_.render_process_id == render_process_id && |
| 139 session_ctx_.render_view_id == render_view_id && | 135 session_ctx_.render_view_id == render_view_id && |
| 140 session_ctx_.request_id == request_id; | 136 session_ctx_.request_id == request_id; |
| 141 } | 137 } |
| 142 | 138 |
| 143 const SpeechRecognitionSessionConfig& | 139 const SpeechRecognitionSessionConfig& |
| 144 FakeSpeechRecognitionManager::GetSessionConfig(int session_id) const { | 140 FakeSpeechRecognitionManager::GetSessionConfig(int session_id) const { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 164 SpeechRecognitionResults results; | 160 SpeechRecognitionResults results; |
| 165 results.push_back(result); | 161 results.push_back(result); |
| 166 listener_->OnRecognitionResults(session_id_, results); | 162 listener_->OnRecognitionResults(session_id_, results); |
| 167 listener_->OnRecognitionEnd(session_id_); | 163 listener_->OnRecognitionEnd(session_id_); |
| 168 session_id_ = 0; | 164 session_id_ = 0; |
| 169 listener_ = NULL; | 165 listener_ = NULL; |
| 170 VLOG(1) << "Finished setting fake recognition result."; | 166 VLOG(1) << "Finished setting fake recognition result."; |
| 171 } | 167 } |
| 172 | 168 |
| 173 } // namespace content | 169 } // namespace content |
| OLD | NEW |