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/renderer_host/media/audio_renderer_host_unittest.cc

Issue 66183002: Replace MessageLoopProxy with SingleThreadTaskRunner for the rest of media/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win and audio tests Created 6 years, 11 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/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/sync_socket.h" 8 #include "base/sync_socket.h"
9 #include "content/browser/media/media_internals.h" 9 #include "content/browser/media/media_internals.h"
10 #include "content/browser/renderer_host/media/audio_input_device_manager.h" 10 #include "content/browser/renderer_host/media/audio_input_device_manager.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 } 258 }
259 259
260 // SyncWithAudioThread() waits until all pending tasks on the audio thread 260 // SyncWithAudioThread() waits until all pending tasks on the audio thread
261 // are executed while also processing pending task in message_loop_ on the 261 // are executed while also processing pending task in message_loop_ on the
262 // current thread. It is used to synchronize with the audio thread when we are 262 // current thread. It is used to synchronize with the audio thread when we are
263 // closing an audio stream. 263 // closing an audio stream.
264 void SyncWithAudioThread() { 264 void SyncWithAudioThread() {
265 base::RunLoop().RunUntilIdle(); 265 base::RunLoop().RunUntilIdle();
266 266
267 base::RunLoop run_loop; 267 base::RunLoop run_loop;
268 audio_manager_->GetMessageLoop()->PostTask( 268 audio_manager_->GetTaskRunner()->PostTask(
269 FROM_HERE, media::BindToCurrentLoop(run_loop.QuitClosure())); 269 FROM_HERE, media::BindToCurrentLoop(run_loop.QuitClosure()));
270 run_loop.Run(); 270 run_loop.Run();
271 } 271 }
272 272
273 private: 273 private:
274 // MediaStreamManager uses a DestructionObserver, so it must outlive the 274 // MediaStreamManager uses a DestructionObserver, so it must outlive the
275 // TestBrowserThreadBundle. 275 // TestBrowserThreadBundle.
276 scoped_ptr<MediaStreamManager> media_stream_manager_; 276 scoped_ptr<MediaStreamManager> media_stream_manager_;
277 TestBrowserThreadBundle thread_bundle_; 277 TestBrowserThreadBundle thread_bundle_;
278 scoped_ptr<media::AudioManager> audio_manager_; 278 scoped_ptr<media::AudioManager> audio_manager_;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } 343 }
344 344
345 TEST_F(AudioRendererHostTest, CreateUnifiedStreamAndClose) { 345 TEST_F(AudioRendererHostTest, CreateUnifiedStreamAndClose) {
346 Create(true); 346 Create(true);
347 Close(); 347 Close();
348 } 348 }
349 349
350 // TODO(hclam): Add tests for data conversation in low latency mode. 350 // TODO(hclam): Add tests for data conversation in low latency mode.
351 351
352 } // namespace content 352 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698