OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/string_util.h" | 6 #include "base/string_util.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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); | 73 MOCK_METHOD2(OnError, void(AudioOutputStream* stream, int code)); |
74 }; | 74 }; |
75 | 75 |
76 class MockAudioManagerLinux : public AudioManagerLinux { | 76 class MockAudioManagerLinux : public AudioManagerLinux { |
77 public: | 77 public: |
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 AudioParameters params)); | 82 AudioParameters params)); |
83 MOCK_METHOD5(MakeAudioInputStream, AudioInputStream*( | 83 MOCK_METHOD1(MakeAudioInputStream, AudioInputStream*( |
84 AudioParameters::Format format, | 84 AudioParameters params)); |
85 int channels, | |
86 int sample_rate, | |
87 char bits_per_sample, | |
88 uint32 samples_per_packet)); | |
89 MOCK_METHOD0(MuteAll, void()); | 85 MOCK_METHOD0(MuteAll, void()); |
90 MOCK_METHOD0(UnMuteAll, void()); | 86 MOCK_METHOD0(UnMuteAll, void()); |
91 | 87 |
92 MOCK_METHOD1(ReleaseOutputStream, void(AlsaPcmOutputStream* stream)); | 88 MOCK_METHOD1(ReleaseOutputStream, void(AlsaPcmOutputStream* stream)); |
93 }; | 89 }; |
94 | 90 |
95 class AlsaPcmOutputStreamTest : public testing::Test { | 91 class AlsaPcmOutputStreamTest : public testing::Test { |
96 protected: | 92 protected: |
97 AlsaPcmOutputStreamTest() { | 93 AlsaPcmOutputStreamTest() { |
98 test_stream_ = CreateStream(kTestChannels); | 94 test_stream_ = CreateStream(kTestChannels); |
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 | 789 |
794 test_stream_->stop_stream_ = true; | 790 test_stream_->stop_stream_ = true; |
795 test_stream_->ScheduleNextWrite(true); | 791 test_stream_->ScheduleNextWrite(true); |
796 | 792 |
797 // TODO(ajwong): Find a way to test whether or not another task has been | 793 // TODO(ajwong): Find a way to test whether or not another task has been |
798 // posted so we can verify that the Alsa code will indeed break the task | 794 // posted so we can verify that the Alsa code will indeed break the task |
799 // posting loop. | 795 // posting loop. |
800 | 796 |
801 test_stream_->shared_data_.TransitionTo(AlsaPcmOutputStream::kIsClosed); | 797 test_stream_->shared_data_.TransitionTo(AlsaPcmOutputStream::kIsClosed); |
802 } | 798 } |
OLD | NEW |