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

Side by Side Diff: media/audio/cras/cras_unified_unittest.cc

Issue 2043303004: More WaitableEvent stragglers migrated to enum-based constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d_4_misc
Patch Set: Created 4 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
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 EXPECT_FALSE(test_stream->Open()); 132 EXPECT_FALSE(test_stream->Open());
133 test_stream->Close(); 133 test_stream->Close();
134 } 134 }
135 135
136 TEST_F(CrasUnifiedStreamTest, RenderFrames) { 136 TEST_F(CrasUnifiedStreamTest, RenderFrames) {
137 CrasUnifiedStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); 137 CrasUnifiedStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO);
138 MockAudioSourceCallback mock_callback; 138 MockAudioSourceCallback mock_callback;
139 139
140 ASSERT_TRUE(test_stream->Open()); 140 ASSERT_TRUE(test_stream->Open());
141 141
142 base::WaitableEvent event(false, false); 142 base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
143 base::WaitableEvent::InitialState::NOT_SIGNALED);
143 144
144 EXPECT_CALL(mock_callback, OnMoreData(_, _, 0)) 145 EXPECT_CALL(mock_callback, OnMoreData(_, _, 0))
145 .WillRepeatedly( 146 .WillRepeatedly(
146 DoAll(InvokeWithoutArgs(&event, &base::WaitableEvent::Signal), 147 DoAll(InvokeWithoutArgs(&event, &base::WaitableEvent::Signal),
147 Return(kTestFramesPerPacket))); 148 Return(kTestFramesPerPacket)));
148 149
149 test_stream->Start(&mock_callback); 150 test_stream->Start(&mock_callback);
150 151
151 // Wait for samples to be captured. 152 // Wait for samples to be captured.
152 EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout())); 153 EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout()));
153 154
154 test_stream->Stop(); 155 test_stream->Stop();
155 156
156 test_stream->Close(); 157 test_stream->Close();
157 } 158 }
158 159
159 } // namespace media 160 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/cras/cras_input_unittest.cc ('k') | media/gpu/v4l2_slice_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698