summaryrefslogtreecommitdiffstats
path: root/content/browser/speech
diff options
context:
space:
mode:
authorjanx@chromium.org <janx@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-01 21:09:54 +0000
committerjanx@chromium.org <janx@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-01 21:09:54 +0000
commit0a208bf4f2c0fb0ae4434567b3fe924c62568a9c (patch)
treeefe9d8cd8df0c9535d1371b8e95c5477a969cb52 /content/browser/speech
parentff6c5f4110e63914b08f7f3e5e17ccb525e15b1d (diff)
downloadchromium_src-0a208bf4f2c0fb0ae4434567b3fe924c62568a9c.zip
chromium_src-0a208bf4f2c0fb0ae4434567b3fe924c62568a9c.tar.gz
chromium_src-0a208bf4f2c0fb0ae4434567b3fe924c62568a9c.tar.bz2
Rename speech test methods to *ForTesting instead of *ForTests.
This allows these methods to be checked by the "*ForTesting" hook in the presubmit checks. BUG=301679 Review URL: https://codereview.chromium.org/25276002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226300 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/speech')
-rw-r--r--content/browser/speech/google_streaming_remote_engine.cc9
-rw-r--r--content/browser/speech/google_streaming_remote_engine.h4
-rw-r--r--content/browser/speech/google_streaming_remote_engine_unittest.cc4
-rw-r--r--content/browser/speech/input_tag_speech_browsertest.cc2
-rw-r--r--content/browser/speech/speech_recognition_manager_impl.cc2
-rw-r--r--content/browser/speech/speech_recognizer_impl.cc2
-rw-r--r--content/browser/speech/speech_recognizer_impl.h2
-rw-r--r--content/browser/speech/speech_recognizer_impl_unittest.cc2
8 files changed, 14 insertions, 13 deletions
diff --git a/content/browser/speech/google_streaming_remote_engine.cc b/content/browser/speech/google_streaming_remote_engine.cc
index beacb22..a067278 100644
--- a/content/browser/speech/google_streaming_remote_engine.cc
+++ b/content/browser/speech/google_streaming_remote_engine.cc
@@ -86,8 +86,8 @@ std::string GetAPIKey() {
} // namespace
-const int GoogleStreamingRemoteEngine::kUpstreamUrlFetcherIdForTests = 0;
-const int GoogleStreamingRemoteEngine::kDownstreamUrlFetcherIdForTests = 1;
+const int GoogleStreamingRemoteEngine::kUpstreamUrlFetcherIdForTesting = 0;
+const int GoogleStreamingRemoteEngine::kDownstreamUrlFetcherIdForTesting = 1;
const int GoogleStreamingRemoteEngine::kWebserviceStatusNoError = 0;
const int GoogleStreamingRemoteEngine::kWebserviceStatusErrorNoMatch = 5;
@@ -324,7 +324,8 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) {
JoinString(downstream_args, '&'));
downstream_fetcher_.reset(URLFetcher::Create(
- kDownstreamUrlFetcherIdForTests, downstream_url, URLFetcher::GET, this));
+ kDownstreamUrlFetcherIdForTesting, downstream_url, URLFetcher::GET,
+ this));
downstream_fetcher_->SetRequestContext(url_context_.get());
downstream_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
net::LOAD_DO_NOT_SEND_COOKIES |
@@ -363,7 +364,7 @@ GoogleStreamingRemoteEngine::ConnectBothStreams(const FSMEventArgs&) {
JoinString(upstream_args, '&'));
upstream_fetcher_.reset(URLFetcher::Create(
- kUpstreamUrlFetcherIdForTests, upstream_url, URLFetcher::POST, this));
+ kUpstreamUrlFetcherIdForTesting, upstream_url, URLFetcher::POST, this));
upstream_fetcher_->SetChunkedUpload(encoder_->mime_type());
upstream_fetcher_->SetRequestContext(url_context_.get());
upstream_fetcher_->SetReferrer(config_.origin_url);
diff --git a/content/browser/speech/google_streaming_remote_engine.h b/content/browser/speech/google_streaming_remote_engine.h
index 488971b..6f3bf41 100644
--- a/content/browser/speech/google_streaming_remote_engine.h
+++ b/content/browser/speech/google_streaming_remote_engine.h
@@ -70,8 +70,8 @@ class CONTENT_EXPORT GoogleStreamingRemoteEngine
friend class GoogleStreamingRemoteEngineTest;
// IDs passed to URLFetcher::Create(). Used for testing.
- static const int kUpstreamUrlFetcherIdForTests;
- static const int kDownstreamUrlFetcherIdForTests;
+ static const int kUpstreamUrlFetcherIdForTesting;
+ static const int kDownstreamUrlFetcherIdForTesting;
// Response status codes from the speech recognition webservice.
static const int kWebserviceStatusNoError;
diff --git a/content/browser/speech/google_streaming_remote_engine_unittest.cc b/content/browser/speech/google_streaming_remote_engine_unittest.cc
index 3972506..dd0ef89 100644
--- a/content/browser/speech/google_streaming_remote_engine_unittest.cc
+++ b/content/browser/speech/google_streaming_remote_engine_unittest.cc
@@ -337,12 +337,12 @@ void GoogleStreamingRemoteEngineTest::TearDown() {
TestURLFetcher* GoogleStreamingRemoteEngineTest::GetUpstreamFetcher() {
return url_fetcher_factory_.GetFetcherByID(
- GoogleStreamingRemoteEngine::kUpstreamUrlFetcherIdForTests);
+ GoogleStreamingRemoteEngine::kUpstreamUrlFetcherIdForTesting);
}
TestURLFetcher* GoogleStreamingRemoteEngineTest::GetDownstreamFetcher() {
return url_fetcher_factory_.GetFetcherByID(
- GoogleStreamingRemoteEngine::kDownstreamUrlFetcherIdForTests);
+ GoogleStreamingRemoteEngine::kDownstreamUrlFetcherIdForTesting);
}
// Starts recognition on the engine, ensuring that both stream fetchers are
diff --git a/content/browser/speech/input_tag_speech_browsertest.cc b/content/browser/speech/input_tag_speech_browsertest.cc
index 0a1b2a9..425a0cf 100644
--- a/content/browser/speech/input_tag_speech_browsertest.cc
+++ b/content/browser/speech/input_tag_speech_browsertest.cc
@@ -79,7 +79,7 @@ class InputTagSpeechBrowserTest : public ContentBrowserTest {
// Inject the fake manager factory so that the test result is returned to
// the web page.
- SpeechRecognitionManager::SetManagerForTests(speech_recognition_manager_);
+ SpeechRecognitionManager::SetManagerForTesting(speech_recognition_manager_);
}
virtual void TearDownInProcessBrowserTestFixture() OVERRIDE {
diff --git a/content/browser/speech/speech_recognition_manager_impl.cc b/content/browser/speech/speech_recognition_manager_impl.cc
index c741002..51cf027 100644
--- a/content/browser/speech/speech_recognition_manager_impl.cc
+++ b/content/browser/speech/speech_recognition_manager_impl.cc
@@ -51,7 +51,7 @@ SpeechRecognitionManager* SpeechRecognitionManager::GetInstance() {
return SpeechRecognitionManagerImpl::GetInstance();
}
-void SpeechRecognitionManager::SetManagerForTests(
+void SpeechRecognitionManager::SetManagerForTesting(
SpeechRecognitionManager* manager) {
manager_for_tests_ = manager;
}
diff --git a/content/browser/speech/speech_recognizer_impl.cc b/content/browser/speech/speech_recognizer_impl.cc
index 2dae430..ecd24ab 100644
--- a/content/browser/speech/speech_recognizer_impl.cc
+++ b/content/browser/speech/speech_recognizer_impl.cc
@@ -802,7 +802,7 @@ void SpeechRecognizerImpl::UpdateSignalAndNoiseLevels(const float& rms,
session_id(), clip_detected ? 1.0f : audio_level_, noise_level);
}
-void SpeechRecognizerImpl::SetAudioManagerForTests(
+void SpeechRecognizerImpl::SetAudioManagerForTesting(
AudioManager* audio_manager) {
audio_manager_for_tests_ = audio_manager;
}
diff --git a/content/browser/speech/speech_recognizer_impl.h b/content/browser/speech/speech_recognizer_impl.h
index 4945132..c2abb33 100644
--- a/content/browser/speech/speech_recognizer_impl.h
+++ b/content/browser/speech/speech_recognizer_impl.h
@@ -37,7 +37,7 @@ class CONTENT_EXPORT SpeechRecognizerImpl
static const int kNoSpeechTimeoutMs;
static const int kEndpointerEstimationTimeMs;
- static void SetAudioManagerForTests(media::AudioManager* audio_manager);
+ static void SetAudioManagerForTesting(media::AudioManager* audio_manager);
SpeechRecognizerImpl(SpeechRecognitionEventListener* listener,
int session_id,
diff --git a/content/browser/speech/speech_recognizer_impl_unittest.cc b/content/browser/speech/speech_recognizer_impl_unittest.cc
index dcd4d5b..54d9709 100644
--- a/content/browser/speech/speech_recognizer_impl_unittest.cc
+++ b/content/browser/speech/speech_recognizer_impl_unittest.cc
@@ -59,7 +59,7 @@ class SpeechRecognizerImplTest : public SpeechRecognitionEventListener,
this, kTestingSessionId, kOneShotMode, sr_engine);
audio_manager_.reset(new media::MockAudioManager(
base::MessageLoop::current()->message_loop_proxy().get()));
- recognizer_->SetAudioManagerForTests(audio_manager_.get());
+ recognizer_->SetAudioManagerForTesting(audio_manager_.get());
int audio_packet_length_bytes =
(SpeechRecognizerImpl::kAudioSampleRate *