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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 MOCK_METHOD1(MakeAudioOutputStream, AudioOutputStream*( | 81 MOCK_METHOD1(MakeAudioOutputStream, AudioOutputStream*( |
82 const AudioParameters& params)); | 82 const AudioParameters& params)); |
83 MOCK_METHOD2(MakeAudioInputStream, AudioInputStream*( | 83 MOCK_METHOD2(MakeAudioInputStream, AudioInputStream*( |
84 const AudioParameters& params, const std::string& device_id)); | 84 const AudioParameters& params, const std::string& device_id)); |
85 MOCK_METHOD0(MuteAll, void()); | 85 MOCK_METHOD0(MuteAll, void()); |
86 MOCK_METHOD0(UnMuteAll, void()); | 86 MOCK_METHOD0(UnMuteAll, void()); |
87 MOCK_METHOD1(ReleaseOutputStream, void(AudioOutputStream* stream)); | 87 MOCK_METHOD1(ReleaseOutputStream, void(AudioOutputStream* stream)); |
88 | 88 |
89 // We don't mock this method since all tests will do the same thing | 89 // We don't mock this method since all tests will do the same thing |
90 // and use the current message loop. | 90 // and use the current message loop. |
91 virtual MessageLoop* GetMessageLoop() { | 91 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() OVERRIDE { |
92 return MessageLoop::current(); | 92 return MessageLoop::current()->message_loop_proxy(); |
93 } | 93 } |
94 }; | 94 }; |
95 | 95 |
96 class AlsaPcmOutputStreamTest : public testing::Test { | 96 class AlsaPcmOutputStreamTest : public testing::Test { |
97 protected: | 97 protected: |
98 AlsaPcmOutputStreamTest() { | 98 AlsaPcmOutputStreamTest() { |
99 mock_manager_ = new StrictMock<MockAudioManagerLinux>(); | 99 mock_manager_ = new StrictMock<MockAudioManagerLinux>(); |
100 test_stream_.reset(CreateStream(kTestChannelLayout)); | 100 test_stream_.reset(CreateStream(kTestChannelLayout)); |
101 } | 101 } |
102 | 102 |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 | 783 |
784 test_stream_->stop_stream_ = true; | 784 test_stream_->stop_stream_ = true; |
785 test_stream_->ScheduleNextWrite(true); | 785 test_stream_->ScheduleNextWrite(true); |
786 | 786 |
787 // TODO(ajwong): Find a way to test whether or not another task has been | 787 // TODO(ajwong): Find a way to test whether or not another task has been |
788 // posted so we can verify that the Alsa code will indeed break the task | 788 // posted so we can verify that the Alsa code will indeed break the task |
789 // posting loop. | 789 // posting loop. |
790 | 790 |
791 test_stream_->TransitionTo(AlsaPcmOutputStream::kIsClosed); | 791 test_stream_->TransitionTo(AlsaPcmOutputStream::kIsClosed); |
792 } | 792 } |
OLD | NEW |