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

Unified Diff: webrtc/p2p/base/transport_unittest.cc

Issue 1350523003: TransportController refactoring. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing Mac test. Created 5 years, 3 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/p2p/base/transport.cc ('k') | webrtc/p2p/base/transportchannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/transport_unittest.cc
diff --git a/webrtc/p2p/base/transport_unittest.cc b/webrtc/p2p/base/transport_unittest.cc
index 43b761a64c9a07a3cea5fcd10f10b31233271899..9febfe33f7e55c03866781b7aa6bc82a9745ca39 100644
--- a/webrtc/p2p/base/transport_unittest.cc
+++ b/webrtc/p2p/base/transport_unittest.cc
@@ -11,8 +11,7 @@
#include "webrtc/base/fakesslidentity.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/network.h"
-#include "webrtc/base/thread.h"
-#include "webrtc/p2p/base/fakesession.h"
+#include "webrtc/p2p/base/faketransportcontroller.h"
#include "webrtc/p2p/base/p2ptransport.h"
using cricket::Candidate;
@@ -35,9 +34,7 @@ class TransportTest : public testing::Test,
public sigslot::has_slots<> {
public:
TransportTest()
- : thread_(rtc::Thread::Current()),
- transport_(new FakeTransport(
- thread_, thread_, "test content name", NULL)),
+ : transport_(new FakeTransport("test content name")),
channel_(NULL),
connecting_signalled_(false),
completed_(false),
@@ -73,7 +70,6 @@ class TransportTest : public testing::Test,
failed_ = true;
}
- rtc::Thread* thread_;
rtc::scoped_ptr<FakeTransport> transport_;
FakeTransportChannel* channel_;
bool connecting_signalled_;
@@ -85,20 +81,7 @@ class TransportTest : public testing::Test,
TEST_F(TransportTest, TestConnectChannelsDoesSignal) {
EXPECT_TRUE(SetupChannel());
transport_->ConnectChannels();
- EXPECT_FALSE(connecting_signalled_);
-
- EXPECT_TRUE_WAIT(connecting_signalled_, 100);
-}
-
-// Test that DestroyAllChannels kills any pending OnConnecting signals.
-TEST_F(TransportTest, TestDestroyAllClearsPosts) {
- EXPECT_TRUE(transport_->CreateChannel(1) != NULL);
-
- transport_->ConnectChannels();
- transport_->DestroyAllChannels();
-
- thread_->ProcessMessages(0);
- EXPECT_FALSE(connecting_signalled_);
+ EXPECT_TRUE(connecting_signalled_);
}
// This test verifies channels are created with proper ICE
@@ -232,7 +215,7 @@ TEST_F(TransportTest, TestChannelCompletedAndFailed) {
NULL));
channel_->SetConnectionCount(2);
- channel_->SignalCandidatesAllocationDone(channel_);
+ channel_->SetCandidatesGatheringComplete();
channel_->SetWritable(true);
EXPECT_TRUE_WAIT(transport_->all_channels_writable(), 100);
// ICE is not yet completed because there is still more than one connection.
« no previous file with comments | « webrtc/p2p/base/transport.cc ('k') | webrtc/p2p/base/transportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698