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

Side by Side Diff: content/browser/speech/speech_recognition_browsertest.cc

Issue 10663018: Changing tab closure handling logic in speech recognition code and cleaning bubble controller. (Spe… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: jochen review Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 virtual void AbortAllSessionsForListener( 119 virtual void AbortAllSessionsForListener(
120 content::SpeechRecognitionEventListener* listener) OVERRIDE { 120 content::SpeechRecognitionEventListener* listener) OVERRIDE {
121 VLOG(1) << "CancelAllRequestsWithDelegate invoked."; 121 VLOG(1) << "CancelAllRequestsWithDelegate invoked.";
122 // listener_ is set to NULL if a fake result was received (see below), so 122 // listener_ is set to NULL if a fake result was received (see below), so
123 // check that listener_ matches the incoming parameter only when there is 123 // check that listener_ matches the incoming parameter only when there is
124 // no fake result sent. 124 // no fake result sent.
125 EXPECT_TRUE(should_send_fake_response_ || listener_ == listener); 125 EXPECT_TRUE(should_send_fake_response_ || listener_ == listener);
126 did_cancel_all_ = true; 126 did_cancel_all_ = true;
127 } 127 }
128 128
129 virtual void AbortAllSessionsForRenderView(int render_process_id,
130 int render_view_id) OVERRIDE {
131 NOTREACHED();
132 }
129 virtual bool HasAudioInputDevices() OVERRIDE { return true; } 133 virtual bool HasAudioInputDevices() OVERRIDE { return true; }
130 virtual bool IsCapturingAudio() OVERRIDE { return true; } 134 virtual bool IsCapturingAudio() OVERRIDE { return true; }
131 virtual string16 GetAudioInputDeviceModel() OVERRIDE { return string16(); } 135 virtual string16 GetAudioInputDeviceModel() OVERRIDE { return string16(); }
132 virtual void ShowAudioInputSettings() OVERRIDE {} 136 virtual void ShowAudioInputSettings() OVERRIDE {}
133 137
134 virtual int GetSession(int render_process_id, 138 virtual int GetSession(int render_process_id,
135 int render_view_id, 139 int render_view_id,
136 int request_id) const OVERRIDE { 140 int request_id) const OVERRIDE {
137 return session_ctx_.render_process_id == render_process_id && 141 return session_ctx_.render_process_id == render_process_id &&
138 session_ctx_.render_view_id == render_view_id && 142 session_ctx_.render_view_id == render_view_id &&
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 290
287 // Make the renderer crash. This should trigger 291 // Make the renderer crash. This should trigger
288 // InputTagSpeechDispatcherHost to cancel all pending sessions. 292 // InputTagSpeechDispatcherHost to cancel all pending sessions.
289 GURL test_url("about:crash"); 293 GURL test_url("about:crash");
290 ui_test_utils::NavigateToURL(browser(), test_url); 294 ui_test_utils::NavigateToURL(browser(), test_url);
291 295
292 EXPECT_TRUE(fake_speech_recognition_manager_.did_cancel_all()); 296 EXPECT_TRUE(fake_speech_recognition_manager_.did_cancel_all());
293 } 297 }
294 298
295 } // namespace speech 299 } // namespace speech
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698