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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <vector> 5 #include <vector>
6 6
7 #include "content/browser/browser_thread_impl.h" 7 #include "content/browser/browser_thread_impl.h"
8 #include "content/browser/speech/google_one_shot_remote_engine.h" 8 #include "content/browser/speech/google_one_shot_remote_engine.h"
9 #include "content/browser/speech/speech_recognizer_impl.h" 9 #include "content/browser/speech/speech_recognizer_impl.h"
10 #include "content/public/browser/speech_recognition_event_listener.h" 10 #include "content/public/browser/speech_recognition_event_listener.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 SpeechRecognizerImpl::kNumBitsPerAudioSample; 50 SpeechRecognizerImpl::kNumBitsPerAudioSample;
51 config.audio_sample_rate = SpeechRecognizerImpl::kAudioSampleRate; 51 config.audio_sample_rate = SpeechRecognizerImpl::kAudioSampleRate;
52 config.filter_profanities = false; 52 config.filter_profanities = false;
53 sr_engine->SetConfig(config); 53 sr_engine->SetConfig(config);
54 54
55 const int kTestingSessionId = 1; 55 const int kTestingSessionId = 1;
56 const bool kOneShotMode = true; 56 const bool kOneShotMode = true;
57 recognizer_ = new SpeechRecognizerImpl( 57 recognizer_ = new SpeechRecognizerImpl(
58 this, kTestingSessionId, kOneShotMode, sr_engine); 58 this, kTestingSessionId, kOneShotMode, sr_engine);
59 audio_manager_.reset(new media::MockAudioManager( 59 audio_manager_.reset(new media::MockAudioManager(
60 base::MessageLoop::current()->message_loop_proxy())); 60 base::MessageLoop::current()->message_loop_proxy().get()));
61 recognizer_->SetAudioManagerForTests(audio_manager_.get()); 61 recognizer_->SetAudioManagerForTests(audio_manager_.get());
62 62
63 int audio_packet_length_bytes = 63 int audio_packet_length_bytes =
64 (SpeechRecognizerImpl::kAudioSampleRate * 64 (SpeechRecognizerImpl::kAudioSampleRate *
65 GoogleOneShotRemoteEngine::kAudioPacketIntervalMs * 65 GoogleOneShotRemoteEngine::kAudioPacketIntervalMs *
66 ChannelLayoutToChannelCount(SpeechRecognizerImpl::kChannelLayout) * 66 ChannelLayoutToChannelCount(SpeechRecognizerImpl::kChannelLayout) *
67 SpeechRecognizerImpl::kNumBitsPerAudioSample) / (8 * 1000); 67 SpeechRecognizerImpl::kNumBitsPerAudioSample) / (8 * 1000);
68 audio_packet_.resize(audio_packet_length_bytes); 68 audio_packet_.resize(audio_packet_length_bytes);
69 } 69 }
70 70
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 489
490 EXPECT_EQ(SPEECH_RECOGNITION_ERROR_NONE, error_); 490 EXPECT_EQ(SPEECH_RECOGNITION_ERROR_NONE, error_);
491 EXPECT_FALSE(audio_ended_); 491 EXPECT_FALSE(audio_ended_);
492 EXPECT_FALSE(recognition_ended_); 492 EXPECT_FALSE(recognition_ended_);
493 recognizer_->AbortRecognition(); 493 recognizer_->AbortRecognition();
494 base::MessageLoop::current()->RunUntilIdle(); 494 base::MessageLoop::current()->RunUntilIdle();
495 CheckFinalEventsConsistency(); 495 CheckFinalEventsConsistency();
496 } 496 }
497 497
498 } // namespace content 498 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/speech/speech_recognition_manager_impl.cc ('k') | content/browser/storage_partition_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698