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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "media/audio/audio_io.h" | 10 #include "media/audio/audio_io.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // Wait for the AudioManager to finish any initialization on the audio loop. | 38 // Wait for the AudioManager to finish any initialization on the audio loop. |
39 base::RunLoop().RunUntilIdle(); | 39 base::RunLoop().RunUntilIdle(); |
40 } | 40 } |
41 | 41 |
42 virtual ~AUHALStreamTest() { | 42 virtual ~AUHALStreamTest() { |
43 base::RunLoop().RunUntilIdle(); | 43 base::RunLoop().RunUntilIdle(); |
44 } | 44 } |
45 | 45 |
46 AudioOutputStream* Create() { | 46 AudioOutputStream* Create() { |
47 return manager_->MakeAudioOutputStream( | 47 return manager_->MakeAudioOutputStream( |
48 manager_->GetDefaultOutputStreamParameters(), "", ""); | 48 manager_->GetDefaultOutputStreamParameters(), ""); |
49 } | 49 } |
50 | 50 |
51 bool CanRunAudioTests() { | 51 bool CanRunAudioTests() { |
52 return manager_->HasAudioOutputDevices(); | 52 return manager_->HasAudioOutputDevices(); |
53 } | 53 } |
54 | 54 |
55 protected: | 55 protected: |
56 base::MessageLoop message_loop_; | 56 base::MessageLoop message_loop_; |
57 scoped_ptr<AudioManager> manager_; | 57 scoped_ptr<AudioManager> manager_; |
58 MockAudioSourceCallback source_; | 58 MockAudioSourceCallback source_; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 .WillOnce(DoAll(ZeroBuffer(), SignalEvent(&event), Return(0))); | 97 .WillOnce(DoAll(ZeroBuffer(), SignalEvent(&event), Return(0))); |
98 EXPECT_CALL(source_, OnError(_)).Times(0); | 98 EXPECT_CALL(source_, OnError(_)).Times(0); |
99 stream->Start(&source_); | 99 stream->Start(&source_); |
100 event.Wait(); | 100 event.Wait(); |
101 | 101 |
102 stream->Stop(); | 102 stream->Stop(); |
103 stream->Close(); | 103 stream->Close(); |
104 } | 104 } |
105 | 105 |
106 } // namespace media | 106 } // namespace media |
OLD | NEW |