Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: media/audio/alsa/alsa_output_unittest.cc

Issue 1780333007: AudioManagerBase: Create and run the audio thread lazily. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: fixed media unittests on mac Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_low_latency_input_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698