| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 virtual void AbortAllSessionsForListener( | 118 virtual void AbortAllSessionsForListener( |
| 119 content::SpeechRecognitionEventListener* listener) OVERRIDE { | 119 content::SpeechRecognitionEventListener* listener) OVERRIDE { |
| 120 VLOG(1) << "CancelAllRequestsWithDelegate invoked."; | 120 VLOG(1) << "CancelAllRequestsWithDelegate invoked."; |
| 121 // listener_ is set to NULL if a fake result was received (see below), so | 121 // listener_ is set to NULL if a fake result was received (see below), so |
| 122 // check that listener_ matches the incoming parameter only when there is | 122 // check that listener_ matches the incoming parameter only when there is |
| 123 // no fake result sent. | 123 // no fake result sent. |
| 124 EXPECT_TRUE(should_send_fake_response_ || listener_ == listener); | 124 EXPECT_TRUE(should_send_fake_response_ || listener_ == listener); |
| 125 did_cancel_all_ = true; | 125 did_cancel_all_ = true; |
| 126 } | 126 } |
| 127 | 127 |
| 128 virtual void AbortAllSessionsForRenderer(int, int) { NOTREACHED(); } |
| 128 virtual bool HasAudioInputDevices() OVERRIDE { return true; } | 129 virtual bool HasAudioInputDevices() OVERRIDE { return true; } |
| 129 virtual bool IsCapturingAudio() OVERRIDE { return true; } | 130 virtual bool IsCapturingAudio() OVERRIDE { return true; } |
| 130 virtual string16 GetAudioInputDeviceModel() OVERRIDE { return string16(); } | 131 virtual string16 GetAudioInputDeviceModel() OVERRIDE { return string16(); } |
| 131 virtual void ShowAudioInputSettings() OVERRIDE {} | 132 virtual void ShowAudioInputSettings() OVERRIDE {} |
| 132 | 133 |
| 133 virtual int GetSession(int render_process_id, | 134 virtual int GetSession(int render_process_id, |
| 134 int render_view_id, | 135 int render_view_id, |
| 135 int request_id) const OVERRIDE { | 136 int request_id) const OVERRIDE { |
| 136 return session_ctx_.render_process_id == render_process_id && | 137 return session_ctx_.render_process_id == render_process_id && |
| 137 session_ctx_.render_view_id == render_view_id && | 138 session_ctx_.render_view_id == render_view_id && |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 286 |
| 286 // Make the renderer crash. This should trigger | 287 // Make the renderer crash. This should trigger |
| 287 // InputTagSpeechDispatcherHost to cancel all pending sessions. | 288 // InputTagSpeechDispatcherHost to cancel all pending sessions. |
| 288 GURL test_url("about:crash"); | 289 GURL test_url("about:crash"); |
| 289 ui_test_utils::NavigateToURL(browser(), test_url); | 290 ui_test_utils::NavigateToURL(browser(), test_url); |
| 290 | 291 |
| 291 EXPECT_TRUE(fake_speech_recognition_manager_.did_cancel_all()); | 292 EXPECT_TRUE(fake_speech_recognition_manager_.did_cancel_all()); |
| 292 } | 293 } |
| 293 | 294 |
| 294 } // namespace speech | 295 } // namespace speech |
| OLD | NEW |