| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "media/audio/alsa/alsa_output.h" | 9 #include "media/audio/alsa/alsa_output.h" |
| 10 #include "media/audio/alsa/alsa_wrapper.h" | 10 #include "media/audio/alsa/alsa_wrapper.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // of active output streams. It is because the number of active streams | 88 // of active output streams. It is because the number of active streams |
| 89 // is managed inside MakeAudioOutputStream, and we don't use | 89 // is managed inside MakeAudioOutputStream, and we don't use |
| 90 // MakeAudioOutputStream to create the stream in the tests. | 90 // MakeAudioOutputStream to create the stream in the tests. |
| 91 void ReleaseOutputStream(AudioOutputStream* stream) override { | 91 void ReleaseOutputStream(AudioOutputStream* stream) override { |
| 92 DCHECK(stream); | 92 DCHECK(stream); |
| 93 delete stream; | 93 delete stream; |
| 94 } | 94 } |
| 95 | 95 |
| 96 // We don't mock this method since all tests will do the same thing | 96 // We don't mock this method since all tests will do the same thing |
| 97 // and use the current task runner. | 97 // and use the current task runner. |
| 98 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() const override { | 98 scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override { |
| 99 return base::MessageLoop::current()->task_runner(); | 99 return base::MessageLoop::current()->task_runner(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 FakeAudioLogFactory fake_audio_log_factory_; | 103 FakeAudioLogFactory fake_audio_log_factory_; |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 class AlsaPcmOutputStreamTest : public testing::Test { | 106 class AlsaPcmOutputStreamTest : public testing::Test { |
| 107 protected: | 107 protected: |
| 108 AlsaPcmOutputStreamTest() { | 108 AlsaPcmOutputStreamTest() { |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 | 853 |
| 854 // TODO(ajwong): Find a way to test whether or not another task has been | 854 // TODO(ajwong): Find a way to test whether or not another task has been |
| 855 // posted so we can verify that the Alsa code will indeed break the task | 855 // posted so we can verify that the Alsa code will indeed break the task |
| 856 // posting loop. | 856 // posting loop. |
| 857 | 857 |
| 858 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); | 858 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); |
| 859 test_stream->Close(); | 859 test_stream->Close(); |
| 860 } | 860 } |
| 861 | 861 |
| 862 } // namespace media | 862 } // namespace media |
| OLD | NEW |