| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 const std::string& device_id)); | 42 const std::string& device_id)); |
| 43 MOCK_METHOD2(MakeLinearOutputStream, AudioInputStream*( | 43 MOCK_METHOD2(MakeLinearOutputStream, AudioInputStream*( |
| 44 const AudioParameters& params, const std::string& device_id)); | 44 const AudioParameters& params, const std::string& device_id)); |
| 45 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( | 45 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( |
| 46 const AudioParameters& params, const std::string& device_id)); | 46 const AudioParameters& params, const std::string& device_id)); |
| 47 | 47 |
| 48 // We need to override this function in order to skip the checking the number | 48 // We need to override this function in order to skip the checking the number |
| 49 // of active output streams. It is because the number of active streams | 49 // of active output streams. It is because the number of active streams |
| 50 // is managed inside MakeAudioOutputStream, and we don't use | 50 // is managed inside MakeAudioOutputStream, and we don't use |
| 51 // MakeAudioOutputStream to create the stream in the tests. | 51 // MakeAudioOutputStream to create the stream in the tests. |
| 52 virtual void ReleaseOutputStream(AudioOutputStream* stream) OVERRIDE { | 52 virtual void ReleaseOutputStream(AudioOutputStream* stream) override { |
| 53 DCHECK(stream); | 53 DCHECK(stream); |
| 54 delete stream; | 54 delete stream; |
| 55 } | 55 } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 FakeAudioLogFactory fake_audio_log_factory_; | 58 FakeAudioLogFactory fake_audio_log_factory_; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class CrasUnifiedStreamTest : public testing::Test { | 61 class CrasUnifiedStreamTest : public testing::Test { |
| 62 protected: | 62 protected: |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |