diff options
author | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-20 15:27:16 +0000 |
---|---|---|
committer | satish@chromium.org <satish@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-20 15:27:16 +0000 |
commit | 9dc1c1a6bc8f0342ca262d3002269f34642923d3 (patch) | |
tree | e0cc80f9276e3843fe7fcce4cc25b92521bf0692 /chrome/browser/speech/speech_input_browsertest.cc | |
parent | 2f7aa5e70b39ffc61ce637e3f1f0138278e98d1f (diff) | |
download | chromium_src-9dc1c1a6bc8f0342ca262d3002269f34642923d3.zip chromium_src-9dc1c1a6bc8f0342ca262d3002269f34642923d3.tar.gz chromium_src-9dc1c1a6bc8f0342ca262d3002269f34642923d3.tar.bz2 |
Cancel any pending speech recognitions when the dispatcher host terminates.
I have not added a new test for this because the existing test is flaky and
didn't seem right to add another flaky test like that. Instead I've added a TODO
to add a browser test for this case once the flaky test has been fixed.
BUG=none
TEST=manual
Review URL: http://codereview.chromium.org/6358007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/speech/speech_input_browsertest.cc')
-rw-r--r-- | chrome/browser/speech/speech_input_browsertest.cc | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/chrome/browser/speech/speech_input_browsertest.cc b/chrome/browser/speech/speech_input_browsertest.cc index e0b2aff..45b41be 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 |