From 4c25c671466b56aecd7581ea86342746d274a6bd Mon Sep 17 00:00:00 2001 From: "buildbot@webrtc.org" Date: Fri, 20 Jun 2014 04:42:34 +0000 Subject: [PATCH] (Auto)update libjingle 69589535-> 69600065 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6504 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/p2p/client/basicportallocator.cc | 2 -- talk/p2p/client/portallocator_unittest.cc | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/talk/p2p/client/basicportallocator.cc b/talk/p2p/client/basicportallocator.cc index 762726fbb2..549e6f489c 100644 --- a/talk/p2p/client/basicportallocator.cc +++ b/talk/p2p/client/basicportallocator.cc @@ -398,8 +398,6 @@ void BasicPortAllocatorSession::OnAllocate() { DoAllocate(); allocation_started_ = true; - if (running_) - network_thread_->PostDelayed(ALLOCATE_DELAY, this, MSG_ALLOCATE); } // For each network, see if we have a sequence that covers it already. If not, diff --git a/talk/p2p/client/portallocator_unittest.cc b/talk/p2p/client/portallocator_unittest.cc index 44a8f2725d..b9def30411 100644 --- a/talk/p2p/client/portallocator_unittest.cc +++ b/talk/p2p/client/portallocator_unittest.cc @@ -280,6 +280,19 @@ TEST_F(PortAllocatorTest, TestBasic) { EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); } +// Tests that we allocator session not trying to allocate ports for every 250ms. +TEST_F(PortAllocatorTest, TestNoNetworkInterface) { + EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP)); + session_->StartGettingPorts(); + // Waiting for one second to make sure BasicPortAllocatorSession has not + // called OnAllocate multiple times. In old behavior it's called every 250ms. + // When there are no network interfaces, each execution of OnAllocate will + // result in SignalCandidatesAllocationDone signal. + talk_base::Thread::Current()->ProcessMessages(1000); + EXPECT_TRUE(candidate_allocation_done_); + EXPECT_EQ(0U, candidates_.size()); +} + // Tests that we can get all the desired addresses successfully. TEST_F(PortAllocatorTest, TestGetAllPortsWithMinimumStepDelay) { AddInterface(kClientAddr);