/* * Copyright 2021 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
TEST_F(AudioRtpReceiverTest, VolumesSetBeforeStartingAreRespected) { // Set the volume before setting the media channel. It should still be used // as the initial volume.
receiver_->OnSetVolume(kVolume);
// The previosly set initial volume should be propagated to the provided // media_channel_ as soon as SetupMediaChannel is called.
EXPECT_CALL(receive_channel_, SetOutputVolume(kSsrc, kVolume));
receiver_->SetupMediaChannel(kSsrc);
}
// Tests that OnChanged notifications are processed correctly on the worker // thread when a media channel pointer is passed to the receiver via the // constructor.
TEST(AudioRtpReceiver, OnChangedNotificationsAfterConstruction) {
test::RunLoop loop; auto* thread = rtc::Thread::Current(); // Points to loop's thread.
cricket::MockVoiceMediaReceiveChannelInterface receive_channel; auto receiver = rtc::make_ref_counted<AudioRtpReceiver>(
thread, std::string(), std::vector<std::string>(), true,
&receive_channel);
// Mark the track as disabled.
receiver->track()->set_enabled(false);
// When the track was marked as disabled, an async notification was queued // for the worker thread. This notification should trigger the volume // of the media channel to be set to kVolumeMuted. // Flush the worker thread, but set the expectation first for the call.
EXPECT_CALL(receive_channel, SetDefaultOutputVolume(kVolumeMuted)).Times(1);
loop.Flush();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.