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

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

Issue 504273002: Remove implicit conversions from scoped_refptr to T* in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « content/browser/security_exploit_browsertest.cc ('k') | content/browser/startup_task_runner.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <list> 5 #include <list>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 (16 * buffer_size))); 141 (16 * buffer_size)));
142 } else { 142 } else {
143 memset(audio_buffer.get(), 0, buffer_size); 143 memset(audio_buffer.get(), 0, buffer_size);
144 } 144 }
145 145
146 scoped_ptr<media::AudioBus> audio_bus = 146 scoped_ptr<media::AudioBus> audio_bus =
147 media::AudioBus::Create(audio_params); 147 media::AudioBus::Create(audio_params);
148 audio_bus->FromInterleaved(&audio_buffer.get()[0], 148 audio_bus->FromInterleaved(&audio_buffer.get()[0],
149 audio_bus->frames(), 149 audio_bus->frames(),
150 audio_params.bits_per_sample() / 8); 150 audio_params.bits_per_sample() / 8);
151 controller->event_handler()->OnData(controller, audio_bus.get()); 151 controller->event_handler()->OnData(controller.get(), audio_bus.get());
152 } 152 }
153 153
154 void FeedAudioController(int duration_ms, bool feed_with_noise) { 154 void FeedAudioController(int duration_ms, bool feed_with_noise) {
155 media::TestAudioInputController* controller = 155 media::TestAudioInputController* controller =
156 test_audio_input_controller_factory_.controller(); 156 test_audio_input_controller_factory_.controller();
157 ASSERT_TRUE(controller); 157 ASSERT_TRUE(controller);
158 const media::AudioParameters& audio_params = controller->audio_parameters(); 158 const media::AudioParameters& audio_params = controller->audio_parameters();
159 const size_t buffer_size = audio_params.GetBytesPerBuffer(); 159 const size_t buffer_size = audio_params.GetBytesPerBuffer();
160 const int ms_per_buffer = audio_params.frames_per_buffer() * 1000 / 160 const int ms_per_buffer = audio_params.frames_per_buffer() * 1000 /
161 audio_params.sample_rate(); 161 audio_params.sample_rate();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) { 205 IN_PROC_BROWSER_TEST_F(SpeechRecognitionBrowserTest, OneShotRecognition) {
206 NavigateToURLBlockUntilNavigationsComplete( 206 NavigateToURLBlockUntilNavigationsComplete(
207 shell(), GetTestUrlFromFragment("oneshot"), 2); 207 shell(), GetTestUrlFromFragment("oneshot"), 2);
208 208
209 EXPECT_EQ(kClientDisconnected, streaming_server_state()); 209 EXPECT_EQ(kClientDisconnected, streaming_server_state());
210 EXPECT_EQ("goodresult1", GetPageFragment()); 210 EXPECT_EQ("goodresult1", GetPageFragment());
211 } 211 }
212 212
213 } // namespace content 213 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/security_exploit_browsertest.cc ('k') | content/browser/startup_task_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698