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

Side by Side Diff: media/audio/virtual_audio_output_stream_unittest.cc

Issue 16297002: Update media/ to use scoped_refptr<T>::get() rather than 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) 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/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 TEST_F(VirtualAudioOutputStreamTest, StartStopStartStop) { 78 TEST_F(VirtualAudioOutputStreamTest, StartStopStartStop) {
79 static const int kCycles = 3; 79 static const int kCycles = 3;
80 80
81 MockVirtualAudioInputStream* const input_stream = 81 MockVirtualAudioInputStream* const input_stream =
82 new MockVirtualAudioInputStream(audio_message_loop()); 82 new MockVirtualAudioInputStream(audio_message_loop());
83 audio_message_loop()->PostTask( 83 audio_message_loop()->PostTask(
84 FROM_HERE, base::Bind( 84 FROM_HERE, base::Bind(
85 base::IgnoreResult(&MockVirtualAudioInputStream::Open), 85 base::IgnoreResult(&MockVirtualAudioInputStream::Open),
86 base::Unretained(input_stream))); 86 base::Unretained(input_stream)));
87 87
88 VirtualAudioOutputStream* const output_stream = 88 VirtualAudioOutputStream* const output_stream = new VirtualAudioOutputStream(
89 new VirtualAudioOutputStream( 89 kParams,
90 kParams, audio_message_loop(), input_stream, 90 audio_message_loop().get(),
91 base::Bind(&base::DeletePointer<VirtualAudioOutputStream>)); 91 input_stream,
92 base::Bind(&base::DeletePointer<VirtualAudioOutputStream>));
92 93
93 EXPECT_CALL(*input_stream, AddOutputStream(output_stream, _)) 94 EXPECT_CALL(*input_stream, AddOutputStream(output_stream, _))
94 .Times(kCycles); 95 .Times(kCycles);
95 EXPECT_CALL(*input_stream, RemoveOutputStream(output_stream, _)) 96 EXPECT_CALL(*input_stream, RemoveOutputStream(output_stream, _))
96 .Times(kCycles); 97 .Times(kCycles);
97 98
98 audio_message_loop()->PostTask( 99 audio_message_loop()->PostTask(
99 FROM_HERE, base::Bind(base::IgnoreResult(&VirtualAudioOutputStream::Open), 100 FROM_HERE, base::Bind(base::IgnoreResult(&VirtualAudioOutputStream::Open),
100 base::Unretained(output_stream))); 101 base::Unretained(output_stream)));
101 SineWaveAudioSource source(CHANNEL_LAYOUT_STEREO, 200.0, 128); 102 SineWaveAudioSource source(CHANNEL_LAYOUT_STEREO, 200.0, 128);
(...skipping 11 matching lines...) Expand all
113 base::Unretained(output_stream))); 114 base::Unretained(output_stream)));
114 115
115 audio_message_loop()->PostTask( 116 audio_message_loop()->PostTask(
116 FROM_HERE, base::Bind(&MockVirtualAudioInputStream::Close, 117 FROM_HERE, base::Bind(&MockVirtualAudioInputStream::Close,
117 base::Unretained(input_stream))); 118 base::Unretained(input_stream)));
118 119
119 SyncWithAudioThread(); 120 SyncWithAudioThread();
120 } 121 }
121 122
122 } // namespace media 123 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/virtual_audio_input_stream_unittest.cc ('k') | media/base/audio_renderer_mixer_input_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698