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

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

Issue 9688012: Refactoring of chrome speech recognition architecture (CL1.2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
Index: chrome/browser/speech/speech_input_extension_apitest.cc
diff --git a/chrome/browser/speech/speech_input_extension_apitest.cc b/chrome/browser/speech/speech_input_extension_apitest.cc
index 8d098e5f6bd8d051d500ae9b2eaea8f628338b78..2352a8110804a3c414995cfa7521e46e8ce441dd 100644
--- a/chrome/browser/speech/speech_input_extension_apitest.cc
+++ b/chrome/browser/speech/speech_input_extension_apitest.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
-#include "content/public/browser/speech_recognizer_delegate.h"
+#include "content/public/browser/speech_recognition_event_listener.h"
#include "content/public/common/speech_recognition_result.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -74,7 +74,7 @@ class SpeechInputExtensionApiTest : public ExtensionApiTest,
}
virtual void StartRecording(
- content::SpeechRecognizerDelegate* delegate,
+ content::SpeechRecognitionEventListener* listener,
net::URLRequestContextGetter* context_getter,
int caller_id,
const std::string& language,
@@ -128,7 +128,7 @@ SpeechInputExtensionApiTest::~SpeechInputExtensionApiTest() {
}
void SpeechInputExtensionApiTest::StartRecording(
- content::SpeechRecognizerDelegate* delegate,
+ content::SpeechRecognitionEventListener* listener,
net::URLRequestContextGetter* context_getter,
int caller_id,
const std::string& language,
@@ -140,7 +140,7 @@ void SpeechInputExtensionApiTest::StartRecording(
// Notify that recording started.
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- base::Bind(&SpeechInputExtensionManager::DidStartReceivingAudio,
+ base::Bind(&SpeechInputExtensionManager::OnAudioStart,
GetManager(),
caller_id),
base::TimeDelta());
@@ -148,7 +148,7 @@ void SpeechInputExtensionApiTest::StartRecording(
// Notify sound start in the input device.
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- base::Bind(&SpeechInputExtensionManager::DidStartReceivingSpeech,
+ base::Bind(&SpeechInputExtensionManager::OnSoundStart,
GetManager(),
caller_id),
base::TimeDelta());
@@ -173,12 +173,13 @@ void SpeechInputExtensionApiTest::ProvideResults(int caller_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (next_error_ != content::SPEECH_RECOGNITION_ERROR_NONE) {
- GetManager()->OnRecognizerError(caller_id, next_error_);
+ GetManager()->OnRecognitionError(caller_id, next_error_);
return;
}
- GetManager()->DidStopReceivingSpeech(caller_id);
- GetManager()->SetRecognitionResult(caller_id, next_result_);
+ GetManager()->OnSoundEnd(caller_id);
+ GetManager()->OnAudioEnd(caller_id);
+ GetManager()->OnRecognitionResult(caller_id, next_result_);
}
// Every test should leave the manager in the idle state when finished.

Powered by Google App Engine
This is Rietveld 408576698