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

Side by Side Diff: media/audio/audio_output_proxy_unittest.cc

Issue 1538563002: Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review fix. git cl format. Rebase. Created 5 years 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 | « media/audio/audio_output_device_unittest.cc ('k') | media/audio/audio_output_resampler.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 5 #include <string>
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "media/audio/audio_manager.h" 9 #include "media/audio/audio_manager.h"
10 #include "media/audio/audio_manager_base.h" 10 #include "media/audio/audio_manager_base.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 const AudioParameters& params, const std::string& device_id)); 117 const AudioParameters& params, const std::string& device_id));
118 MOCK_METHOD2(GetPreferredOutputStreamParameters, AudioParameters( 118 MOCK_METHOD2(GetPreferredOutputStreamParameters, AudioParameters(
119 const std::string& device_id, const AudioParameters& params)); 119 const std::string& device_id, const AudioParameters& params));
120 120
121 private: 121 private:
122 media::FakeAudioLogFactory fake_audio_log_factory_; 122 media::FakeAudioLogFactory fake_audio_log_factory_;
123 }; 123 };
124 124
125 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { 125 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback {
126 public: 126 public:
127 int OnMoreData(AudioBus* audio_bus, uint32 total_bytes_delay) { 127 int OnMoreData(AudioBus* audio_bus,
128 uint32_t total_bytes_delay,
129 uint32_t frames_skipped) {
128 audio_bus->Zero(); 130 audio_bus->Zero();
129 return audio_bus->frames(); 131 return audio_bus->frames();
130 } 132 }
131 MOCK_METHOD1(OnError, void(AudioOutputStream* stream)); 133 MOCK_METHOD1(OnError, void(AudioOutputStream* stream));
132 }; 134 };
133 135
134 } // namespace 136 } // namespace
135 137
136 namespace media { 138 namespace media {
137 139
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 _)).WillOnce(Return(&real_stream)); 723 _)).WillOnce(Return(&real_stream));
722 724
723 // Stream1 should be able to successfully open and start. 725 // Stream1 should be able to successfully open and start.
724 EXPECT_CALL(real_stream, Open()).WillOnce(Return(true)); 726 EXPECT_CALL(real_stream, Open()).WillOnce(Return(true));
725 proxy = new AudioOutputProxy(resampler_.get()); 727 proxy = new AudioOutputProxy(resampler_.get());
726 EXPECT_TRUE(proxy->Open()); 728 EXPECT_TRUE(proxy->Open());
727 CloseAndWaitForCloseTimer(proxy, &real_stream); 729 CloseAndWaitForCloseTimer(proxy, &real_stream);
728 } 730 }
729 731
730 } // namespace media 732 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_output_device_unittest.cc ('k') | media/audio/audio_output_resampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698