| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/environment.h" | 6 #include "base/environment.h" |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/task.h" | 9 #include "base/task.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 class MockAudioOutputControllerSyncReader | 49 class MockAudioOutputControllerSyncReader |
| 50 : public AudioOutputController::SyncReader { | 50 : public AudioOutputController::SyncReader { |
| 51 public: | 51 public: |
| 52 MockAudioOutputControllerSyncReader() {} | 52 MockAudioOutputControllerSyncReader() {} |
| 53 | 53 |
| 54 MOCK_METHOD1(UpdatePendingBytes, void(uint32 bytes)); | 54 MOCK_METHOD1(UpdatePendingBytes, void(uint32 bytes)); |
| 55 MOCK_METHOD2(Read, uint32(void* data, uint32 size)); | 55 MOCK_METHOD2(Read, uint32(void* data, uint32 size)); |
| 56 MOCK_METHOD0(Close, void()); | 56 MOCK_METHOD0(Close, void()); |
| 57 MOCK_METHOD0(DataReady, bool()); |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 DISALLOW_COPY_AND_ASSIGN(MockAudioOutputControllerSyncReader); | 60 DISALLOW_COPY_AND_ASSIGN(MockAudioOutputControllerSyncReader); |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 static bool HasAudioOutputDevices() { | 63 static bool HasAudioOutputDevices() { |
| 63 AudioManager* audio_man = AudioManager::GetAudioManager(); | 64 AudioManager* audio_man = AudioManager::GetAudioManager(); |
| 64 CHECK(audio_man); | 65 CHECK(audio_man); |
| 65 return audio_man->HasAudioOutputDevices(); | 66 return audio_man->HasAudioOutputDevices(); |
| 66 } | 67 } |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 controller->Close(base::Bind(&SignalClosedEvent, &closed_event_1)); | 325 controller->Close(base::Bind(&SignalClosedEvent, &closed_event_1)); |
| 325 | 326 |
| 326 base::WaitableEvent closed_event_2(true, false); | 327 base::WaitableEvent closed_event_2(true, false); |
| 327 controller->Close(base::Bind(&SignalClosedEvent, &closed_event_2)); | 328 controller->Close(base::Bind(&SignalClosedEvent, &closed_event_2)); |
| 328 | 329 |
| 329 closed_event_1.Wait(); | 330 closed_event_1.Wait(); |
| 330 closed_event_2.Wait(); | 331 closed_event_2.Wait(); |
| 331 } | 332 } |
| 332 | 333 |
| 333 } // namespace media | 334 } // namespace media |
| OLD | NEW |