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

Unified Diff: webrtc/api/peerconnectioninterface_unittest.cc

Issue 2097653002: Add virtual Initialize methods to PortAllocator and NetworkManager. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing typo in test. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/base/network.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnectioninterface_unittest.cc
diff --git a/webrtc/api/peerconnectioninterface_unittest.cc b/webrtc/api/peerconnectioninterface_unittest.cc
index 71233e06081fc5d703712aaf3b6b2bcdb3be61c9..843a312292cb5fcfaab6cabca4b64fcff65ee798 100644
--- a/webrtc/api/peerconnectioninterface_unittest.cc
+++ b/webrtc/api/peerconnectioninterface_unittest.cc
@@ -1066,6 +1066,28 @@ TEST_F(PeerConnectionInterfaceTest, CreatePeerConnectionWithPooledCandidates) {
session->flags() & cricket::PORTALLOCATOR_DISABLE_COSTLY_NETWORKS);
}
+// Test that the PeerConnection initializes the port allocator passed into it,
+// and on the correct thread.
+TEST_F(PeerConnectionInterfaceTest,
+ CreatePeerConnectionInitializesPortAllocator) {
+ rtc::Thread network_thread;
+ network_thread.Start();
+ rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory(
+ webrtc::CreatePeerConnectionFactory(
+ &network_thread, rtc::Thread::Current(), rtc::Thread::Current(),
+ nullptr, nullptr, nullptr));
+ std::unique_ptr<cricket::FakePortAllocator> port_allocator(
+ new cricket::FakePortAllocator(&network_thread, nullptr));
+ cricket::FakePortAllocator* raw_port_allocator = port_allocator.get();
+ PeerConnectionInterface::RTCConfiguration config;
+ rtc::scoped_refptr<PeerConnectionInterface> pc(
+ pc_factory->CreatePeerConnection(
+ config, nullptr, std::move(port_allocator), nullptr, &observer_));
+ // FakePortAllocator RTC_CHECKs that it's initialized on the right thread,
+ // so all we have to do here is check that it's initialized.
+ EXPECT_TRUE(raw_port_allocator->initialized());
+}
+
TEST_F(PeerConnectionInterfaceTest, AddStreams) {
CreatePeerConnection();
AddVideoStream(kStreamLabel1);
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/base/network.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698