| OLD | NEW |
| 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 <list> | 5 #include <list> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 : data_pushed_(false, false) { | 34 : data_pushed_(false, false) { |
| 35 ON_CALL(*this, OnData(_, _, _, _)).WillByDefault( | 35 ON_CALL(*this, OnData(_, _, _, _)).WillByDefault( |
| 36 InvokeWithoutArgs(&data_pushed_, &base::WaitableEvent::Signal)); | 36 InvokeWithoutArgs(&data_pushed_, &base::WaitableEvent::Signal)); |
| 37 } | 37 } |
| 38 | 38 |
| 39 virtual ~MockInputCallback() {} | 39 virtual ~MockInputCallback() {} |
| 40 | 40 |
| 41 MOCK_METHOD4(OnData, | 41 MOCK_METHOD4(OnData, |
| 42 void(AudioInputStream* stream, | 42 void(AudioInputStream* stream, |
| 43 const AudioBus* source, | 43 const AudioBus* source, |
| 44 uint32 hardware_delay_bytes, | 44 uint32_t hardware_delay_bytes, |
| 45 double volume)); | 45 double volume)); |
| 46 MOCK_METHOD1(OnError, void(AudioInputStream* stream)); | 46 MOCK_METHOD1(OnError, void(AudioInputStream* stream)); |
| 47 | 47 |
| 48 void WaitForDataPushes() { | 48 void WaitForDataPushes() { |
| 49 for (int i = 0; i < 3; ++i) { | 49 for (int i = 0; i < 3; ++i) { |
| 50 data_pushed_.Wait(); | 50 data_pushed_.Wait(); |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 private: | 54 private: |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 RUN_ON_AUDIO_THREAD(Close); | 340 RUN_ON_AUDIO_THREAD(Close); |
| 341 WaitUntilClosed(); | 341 WaitUntilClosed(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded, | 344 INSTANTIATE_TEST_CASE_P(SingleVersusMultithreaded, |
| 345 VirtualAudioInputStreamTest, | 345 VirtualAudioInputStreamTest, |
| 346 ::testing::Values(false, true)); | 346 ::testing::Values(false, true)); |
| 347 | 347 |
| 348 } // namespace media | 348 } // namespace media |
| OLD | NEW |