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

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

Issue 1864483002: Forward output glitch information from stream WebRTC log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 6 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
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/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/test/test_message_loop.h" 10 #include "base/test/test_message_loop.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 class MockAudioManagerAlsa : public AudioManagerAlsa { 76 class MockAudioManagerAlsa : public AudioManagerAlsa {
77 public: 77 public:
78 MockAudioManagerAlsa() 78 MockAudioManagerAlsa()
79 : AudioManagerAlsa(base::ThreadTaskRunnerHandle::Get(), 79 : AudioManagerAlsa(base::ThreadTaskRunnerHandle::Get(),
80 base::ThreadTaskRunnerHandle::Get(), 80 base::ThreadTaskRunnerHandle::Get(),
81 &fake_audio_log_factory_) {} 81 &fake_audio_log_factory_) {}
82 MOCK_METHOD0(Init, void()); 82 MOCK_METHOD0(Init, void());
83 MOCK_METHOD0(HasAudioOutputDevices, bool()); 83 MOCK_METHOD0(HasAudioOutputDevices, bool());
84 MOCK_METHOD0(HasAudioInputDevices, bool()); 84 MOCK_METHOD0(HasAudioInputDevices, bool());
85 MOCK_METHOD1(MakeLinearOutputStream, AudioOutputStream*( 85 MOCK_METHOD2(MakeLinearOutputStream,
86 const AudioParameters& params)); 86 AudioOutputStream*(const AudioParameters& params,
87 MOCK_METHOD2(MakeLowLatencyOutputStream, AudioOutputStream*( 87 const LogCallback& log_callback));
88 const AudioParameters& params, 88 MOCK_METHOD3(MakeLowLatencyOutputStream,
89 const std::string& device_id)); 89 AudioOutputStream*(const AudioParameters& params,
90 MOCK_METHOD2(MakeLowLatencyInputStream, AudioInputStream*( 90 const std::string& device_id,
91 const AudioParameters& params, const std::string& device_id)); 91 const LogCallback& log_callback));
92 MOCK_METHOD3(MakeLowLatencyInputStream,
93 AudioInputStream*(const AudioParameters& params,
94 const std::string& device_id,
95 const LogCallback& log_callback));
92 96
93 // We need to override this function in order to skip the checking the number 97 // We need to override this function in order to skip the checking the number
94 // of active output streams. It is because the number of active streams 98 // of active output streams. It is because the number of active streams
95 // is managed inside MakeAudioOutputStream, and we don't use 99 // is managed inside MakeAudioOutputStream, and we don't use
96 // MakeAudioOutputStream to create the stream in the tests. 100 // MakeAudioOutputStream to create the stream in the tests.
97 void ReleaseOutputStream(AudioOutputStream* stream) override { 101 void ReleaseOutputStream(AudioOutputStream* stream) override {
98 DCHECK(stream); 102 DCHECK(stream);
99 delete stream; 103 delete stream;
100 } 104 }
101 105
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 858
855 // TODO(ajwong): Find a way to test whether or not another task has been 859 // TODO(ajwong): Find a way to test whether or not another task has been
856 // posted so we can verify that the Alsa code will indeed break the task 860 // posted so we can verify that the Alsa code will indeed break the task
857 // posting loop. 861 // posting loop.
858 862
859 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed); 863 test_stream->TransitionTo(AlsaPcmOutputStream::kIsClosed);
860 test_stream->Close(); 864 test_stream->Close();
861 } 865 }
862 866
863 } // namespace media 867 } // namespace media
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/video_capture_manager.cc ('k') | media/audio/alsa/audio_manager_alsa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698