Files
platform-external-webrtc/webrtc/call/call_unittest.cc
solenberg 43e83d44f0 Revert of Implement AudioReceiveStream::GetStats(). (patchset #19 id:360001 of https://codereview.webrtc.org/1390753002/ )
Reason for revert:
webrtc_perf_tests started failing on Win32 Release, Mac32 Release and Linux64 Release (all running large tests). These were not caught by try bots.

Original issue's description:
> Implement AudioReceiveStream::GetStats().
>
> R=tommi@webrtc.org
> TBR=hta@webrtc.org
> BUG=webrtc:4690
>
> Committed: a457752f4a

TBR=tommi@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4690

Review URL: https://codereview.webrtc.org/1411083006

Cr-Commit-Position: refs/heads/master@{#10340}
2015-10-20 13:41:06 +00:00

105 lines
2.7 KiB
C++

/*
* Copyright (c) 2015 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.
*/
#include <list>
#include "testing/gtest/include/gtest/gtest.h"
#include "webrtc/call.h"
namespace {
struct CallHelper {
CallHelper() {
webrtc::Call::Config config;
// TODO(solenberg): Fill in with VoiceEngine* etc.
call_.reset(webrtc::Call::Create(config));
}
webrtc::Call* operator->() { return call_.get(); }
private:
rtc::scoped_ptr<webrtc::Call> call_;
};
} // namespace
namespace webrtc {
TEST(CallTest, ConstructDestruct) {
CallHelper call;
}
TEST(CallTest, CreateDestroy_AudioSendStream) {
CallHelper call;
AudioSendStream::Config config(nullptr);
config.rtp.ssrc = 42;
config.voe_channel_id = 123;
AudioSendStream* stream = call->CreateAudioSendStream(config);
EXPECT_NE(stream, nullptr);
call->DestroyAudioSendStream(stream);
}
TEST(CallTest, CreateDestroy_AudioReceiveStream) {
CallHelper call;
AudioReceiveStream::Config config;
config.rtp.remote_ssrc = 42;
config.voe_channel_id = 123;
AudioReceiveStream* stream = call->CreateAudioReceiveStream(config);
EXPECT_NE(stream, nullptr);
call->DestroyAudioReceiveStream(stream);
}
TEST(CallTest, CreateDestroy_AudioSendStreams) {
CallHelper call;
AudioSendStream::Config config(nullptr);
config.voe_channel_id = 123;
std::list<AudioSendStream*> streams;
for (int i = 0; i < 2; ++i) {
for (uint32_t ssrc = 0; ssrc < 1234567; ssrc += 34567) {
config.rtp.ssrc = ssrc;
AudioSendStream* stream = call->CreateAudioSendStream(config);
EXPECT_NE(stream, nullptr);
if (ssrc & 1) {
streams.push_back(stream);
} else {
streams.push_front(stream);
}
}
for (auto s : streams) {
call->DestroyAudioSendStream(s);
}
streams.clear();
}
}
TEST(CallTest, CreateDestroy_AudioReceiveStreams) {
CallHelper call;
AudioReceiveStream::Config config;
config.voe_channel_id = 123;
std::list<AudioReceiveStream*> streams;
for (int i = 0; i < 2; ++i) {
for (uint32_t ssrc = 0; ssrc < 1234567; ssrc += 34567) {
config.rtp.remote_ssrc = ssrc;
AudioReceiveStream* stream = call->CreateAudioReceiveStream(config);
EXPECT_NE(stream, nullptr);
if (ssrc & 1) {
streams.push_back(stream);
} else {
streams.push_front(stream);
}
}
for (auto s : streams) {
call->DestroyAudioReceiveStream(s);
}
streams.clear();
}
}
} // namespace webrtc