| OLD | NEW |
| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/synchronization/waitable_event.h" | 7 #include "base/synchronization/waitable_event.h" |
| 8 #include "base/test/test_timeouts.h" | 8 #include "base/test/test_timeouts.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "media/audio/cras/audio_manager_cras.h" | 10 #include "media/audio/cras/audio_manager_cras.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 135 } |
| 136 | 136 |
| 137 TEST_F(CrasUnifiedStreamTest, RenderFrames) { | 137 TEST_F(CrasUnifiedStreamTest, RenderFrames) { |
| 138 CrasUnifiedStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); | 138 CrasUnifiedStream* test_stream = CreateStream(CHANNEL_LAYOUT_MONO); |
| 139 MockAudioSourceCallback mock_callback; | 139 MockAudioSourceCallback mock_callback; |
| 140 | 140 |
| 141 ASSERT_TRUE(test_stream->Open()); | 141 ASSERT_TRUE(test_stream->Open()); |
| 142 | 142 |
| 143 base::WaitableEvent event(false, false); | 143 base::WaitableEvent event(false, false); |
| 144 | 144 |
| 145 EXPECT_CALL(mock_callback, OnMoreData(_, _, 0)) | 145 EXPECT_CALL(mock_callback, OnMoreData(_, _)) |
| 146 .WillRepeatedly( | 146 .WillRepeatedly(DoAll( |
| 147 DoAll(InvokeWithoutArgs(&event, &base::WaitableEvent::Signal), | 147 InvokeWithoutArgs(&event, &base::WaitableEvent::Signal), |
| 148 Return(kTestFramesPerPacket))); | 148 Return(kTestFramesPerPacket))); |
| 149 | 149 |
| 150 test_stream->Start(&mock_callback); | 150 test_stream->Start(&mock_callback); |
| 151 | 151 |
| 152 // Wait for samples to be captured. | 152 // Wait for samples to be captured. |
| 153 EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout())); | 153 EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout())); |
| 154 | 154 |
| 155 test_stream->Stop(); | 155 test_stream->Stop(); |
| 156 | 156 |
| 157 test_stream->Close(); | 157 test_stream->Close(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace media | 160 } // namespace media |
| OLD | NEW |