| 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/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
| 7 #include "media/audio/linux/alsa_output.h" | 7 #include "media/audio/linux/alsa_output.h" |
| 8 #include "media/audio/linux/alsa_wrapper.h" | 8 #include "media/audio/linux/alsa_wrapper.h" |
| 9 #include "media/audio/linux/audio_manager_linux.h" | 9 #include "media/audio/linux/audio_manager_linux.h" |
| 10 #include "media/base/data_buffer.h" | 10 #include "media/base/data_buffer.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 MOCK_METHOD0(Init, void()); | 78 MOCK_METHOD0(Init, void()); |
| 79 MOCK_METHOD0(HasAudioOutputDevices, bool()); | 79 MOCK_METHOD0(HasAudioOutputDevices, bool()); |
| 80 MOCK_METHOD0(HasAudioInputDevices, bool()); | 80 MOCK_METHOD0(HasAudioInputDevices, bool()); |
| 81 MOCK_METHOD1(MakeAudioOutputStream, AudioOutputStream*( | 81 MOCK_METHOD1(MakeAudioOutputStream, AudioOutputStream*( |
| 82 const AudioParameters& params)); | 82 const AudioParameters& params)); |
| 83 MOCK_METHOD1(MakeAudioInputStream, AudioInputStream*( | 83 MOCK_METHOD1(MakeAudioInputStream, AudioInputStream*( |
| 84 const AudioParameters& params)); | 84 const AudioParameters& params)); |
| 85 MOCK_METHOD0(MuteAll, void()); | 85 MOCK_METHOD0(MuteAll, void()); |
| 86 MOCK_METHOD0(UnMuteAll, void()); | 86 MOCK_METHOD0(UnMuteAll, void()); |
| 87 | 87 |
| 88 MOCK_METHOD1(ReleaseOutputStream, void(AlsaPcmOutputStream* stream)); | 88 MOCK_METHOD1(ReleaseOutputStream, void(AudioOutputStream* stream)); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 class AlsaPcmOutputStreamTest : public testing::Test { | 91 class AlsaPcmOutputStreamTest : public testing::Test { |
| 92 protected: | 92 protected: |
| 93 AlsaPcmOutputStreamTest() { | 93 AlsaPcmOutputStreamTest() { |
| 94 test_stream_.reset(CreateStream(kTestChannelLayout)); | 94 test_stream_.reset(CreateStream(kTestChannelLayout)); |
| 95 } | 95 } |
| 96 | 96 |
| 97 virtual ~AlsaPcmOutputStreamTest() { | 97 virtual ~AlsaPcmOutputStreamTest() { |
| 98 test_stream_.reset(NULL); | 98 test_stream_.reset(NULL); |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 | 792 |
| 793 test_stream_->stop_stream_ = true; | 793 test_stream_->stop_stream_ = true; |
| 794 test_stream_->ScheduleNextWrite(true); | 794 test_stream_->ScheduleNextWrite(true); |
| 795 | 795 |
| 796 // TODO(ajwong): Find a way to test whether or not another task has been | 796 // TODO(ajwong): Find a way to test whether or not another task has been |
| 797 // posted so we can verify that the Alsa code will indeed break the task | 797 // posted so we can verify that the Alsa code will indeed break the task |
| 798 // posting loop. | 798 // posting loop. |
| 799 | 799 |
| 800 test_stream_->TransitionTo(AlsaPcmOutputStream::kIsClosed); | 800 test_stream_->TransitionTo(AlsaPcmOutputStream::kIsClosed); |
| 801 } | 801 } |
| OLD | NEW |