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

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

Issue 2101303004: Pass delay and timestamp to AudioSourceCallback::OnMoreData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix Mac CQ errors. Created 4 years, 2 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 (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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 const LogCallback& log_callback)); 134 const LogCallback& log_callback));
135 MOCK_METHOD2(GetPreferredOutputStreamParameters, AudioParameters( 135 MOCK_METHOD2(GetPreferredOutputStreamParameters, AudioParameters(
136 const std::string& device_id, const AudioParameters& params)); 136 const std::string& device_id, const AudioParameters& params));
137 137
138 private: 138 private:
139 media::FakeAudioLogFactory fake_audio_log_factory_; 139 media::FakeAudioLogFactory fake_audio_log_factory_;
140 }; 140 };
141 141
142 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback { 142 class MockAudioSourceCallback : public AudioOutputStream::AudioSourceCallback {
143 public: 143 public:
144 int OnMoreData(AudioBus* audio_bus, 144 int OnMoreData(base::TimeDelta /* delay */,
145 uint32_t total_bytes_delay, 145 base::TimeTicks /* delay_timestamp */,
146 uint32_t frames_skipped) { 146 int /* prior_frames_skipped */,
147 audio_bus->Zero(); 147 AudioBus* dest) override {
148 return audio_bus->frames(); 148 dest->Zero();
149 return dest->frames();
149 } 150 }
150 MOCK_METHOD1(OnError, void(AudioOutputStream* stream)); 151 MOCK_METHOD1(OnError, void(AudioOutputStream* stream));
151 }; 152 };
152 153
153 } // namespace 154 } // namespace
154 155
155 namespace media { 156 namespace media {
156 157
157 class AudioOutputProxyTest : public testing::Test { 158 class AudioOutputProxyTest : public testing::Test {
158 protected: 159 protected:
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 .WillOnce(Return(&real_stream)); 741 .WillOnce(Return(&real_stream));
741 742
742 // Stream1 should be able to successfully open and start. 743 // Stream1 should be able to successfully open and start.
743 EXPECT_CALL(real_stream, Open()).WillOnce(Return(true)); 744 EXPECT_CALL(real_stream, Open()).WillOnce(Return(true));
744 proxy = new AudioOutputProxy(resampler_.get()); 745 proxy = new AudioOutputProxy(resampler_.get());
745 EXPECT_TRUE(proxy->Open()); 746 EXPECT_TRUE(proxy->Open());
746 CloseAndWaitForCloseTimer(proxy, &real_stream); 747 CloseAndWaitForCloseTimer(proxy, &real_stream);
747 } 748 }
748 749
749 } // namespace media 750 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698