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

Unified Diff: chrome/browser/speech/speech_input_browsertest.cc

Issue 6358007: Cancel any pending speech recognitions when the dispatcher host terminates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/speech/speech_input_dispatcher_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/speech_input_browsertest.cc
diff --git a/chrome/browser/speech/speech_input_browsertest.cc b/chrome/browser/speech/speech_input_browsertest.cc
index e0b2aff27f693388bf6002bd398c7fa8d4380562..45b41be1318eef3f0c1781e4ddd20b4c17f0695e 100644
--- a/chrome/browser/speech/speech_input_browsertest.cc
+++ b/chrome/browser/speech/speech_input_browsertest.cc
@@ -42,14 +42,14 @@ class FakeSpeechInputManager : public SpeechInputManager {
}
// SpeechInputManager methods.
- void StartRecognition(Delegate* delegate,
- int caller_id,
- int render_process_id,
- int render_view_id,
- const gfx::Rect& element_rect,
- const std::string& language,
- const std::string& grammar,
- const std::string& origin_url) {
+ virtual void StartRecognition(Delegate* delegate,
+ int caller_id,
+ int render_process_id,
+ int render_view_id,
+ const gfx::Rect& element_rect,
+ const std::string& language,
+ const std::string& grammar,
+ const std::string& origin_url) {
VLOG(1) << "StartRecognition invoked.";
EXPECT_EQ(0, caller_id_);
EXPECT_EQ(NULL, delegate_);
@@ -60,17 +60,20 @@ class FakeSpeechInputManager : public SpeechInputManager {
MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(this,
&FakeSpeechInputManager::SetFakeRecognitionResult));
}
- void CancelRecognition(int caller_id) {
+ virtual void CancelRecognition(int caller_id) {
VLOG(1) << "CancelRecognition invoked.";
EXPECT_EQ(caller_id_, caller_id);
caller_id_ = 0;
delegate_ = NULL;
}
- void StopRecording(int caller_id) {
+ virtual void StopRecording(int caller_id) {
VLOG(1) << "StopRecording invoked.";
EXPECT_EQ(caller_id_, caller_id);
// Nothing to do here since we aren't really recording.
}
+ virtual void CancelAllRequestsWithDelegate(Delegate* delegate) {
+ VLOG(1) << "CancelAllRequestsWithDelegate invoked.";
+ }
private:
void SetFakeRecognitionResult() {
@@ -167,6 +170,11 @@ SpeechInputManager* SpeechInputBrowserTest::speech_input_manager_ = NULL;
// check for sending many clicks in succession to the speech button and verify
// that it doesn't cause any crash but works as expected. This should act as the
// test for http://crbug.com/59173
+//
+// TODO(satish): Similar to above, once this flakiness has been fixed add
+// another test here to check that when speech recognition is in progress and
+// a renderer crashes, we get a call to
+// SpeechInputManager::CancelAllRequestsWithDelegate.
#if defined(OS_WIN)
#define MAYBE_TestBasicRecognition FLAKY_TestBasicRecognition
#else
« no previous file with comments | « no previous file | chrome/browser/speech/speech_input_dispatcher_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698