| 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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 .WillByDefault(InvokeWithoutArgs(&data_pushed_, | 37 .WillByDefault(InvokeWithoutArgs(&data_pushed_, |
| 38 &base::WaitableEvent::Signal)); | 38 &base::WaitableEvent::Signal)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 virtual ~MockInputCallback() {} | 41 virtual ~MockInputCallback() {} |
| 42 | 42 |
| 43 MOCK_METHOD5(OnData, void(AudioInputStream* stream, const uint8* data, | 43 MOCK_METHOD5(OnData, void(AudioInputStream* stream, const uint8* data, |
| 44 uint32 size, uint32 hardware_delay_bytes, | 44 uint32 size, uint32 hardware_delay_bytes, |
| 45 double volume)); | 45 double volume)); |
| 46 MOCK_METHOD1(OnClose, void(AudioInputStream* stream)); | 46 MOCK_METHOD1(OnClose, void(AudioInputStream* stream)); |
| 47 MOCK_METHOD2(OnError, void(AudioInputStream* stream, int code)); | 47 MOCK_METHOD1(OnError, void(AudioInputStream* stream)); |
| 48 | 48 |
| 49 void WaitForDataPushes() { | 49 void WaitForDataPushes() { |
| 50 for (int i = 0; i < 3; ++i) { | 50 for (int i = 0; i < 3; ++i) { |
| 51 data_pushed_.Wait(); | 51 data_pushed_.Wait(); |
| 52 } | 52 } |
| 53 } | 53 } |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 base::WaitableEvent data_pushed_; | 56 base::WaitableEvent data_pushed_; |
| 57 | 57 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 328 } |
| 329 RUN_ON_AUDIO_THREAD(Stop); | 329 RUN_ON_AUDIO_THREAD(Stop); |
| 330 for (int i = 0; i < kHalfNumOutputs; ++i) { | 330 for (int i = 0; i < kHalfNumOutputs; ++i) { |
| 331 RUN_ON_AUDIO_THREAD(StopAndCloseOneOutputStream); | 331 RUN_ON_AUDIO_THREAD(StopAndCloseOneOutputStream); |
| 332 } | 332 } |
| 333 RUN_ON_AUDIO_THREAD(Close); | 333 RUN_ON_AUDIO_THREAD(Close); |
| 334 WaitUntilClosed(); | 334 WaitUntilClosed(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 } // namespace media | 337 } // namespace media |
| OLD | NEW |