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

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

Issue 1358413003: Revert of TransportController refactoring. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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 9febfe33f7e55c03866781b7aa6bc82a9745ca39..43b761a64c9a07a3cea5fcd10f10b31233271899 100644
--- a/webrtc/p2p/base/transport_unittest.cc
+++ b/webrtc/p2p/base/transport_unittest.cc
@@ -11,7 +11,8 @@
#include "webrtc/base/fakesslidentity.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/network.h"
-#include "webrtc/p2p/base/faketransportcontroller.h"
+#include "webrtc/base/thread.h"
+#include "webrtc/p2p/base/fakesession.h"
#include "webrtc/p2p/base/p2ptransport.h"
using cricket::Candidate;
@@ -34,7 +35,9 @@
public sigslot::has_slots<> {
public:
TransportTest()
- : transport_(new FakeTransport("test content name")),
+ : thread_(rtc::Thread::Current()),
+ transport_(new FakeTransport(
+ thread_, thread_, "test content name", NULL)),
channel_(NULL),
connecting_signalled_(false),
completed_(false),
@@ -70,6 +73,7 @@
failed_ = true;
}
+ rtc::Thread* thread_;
rtc::scoped_ptr<FakeTransport> transport_;
FakeTransportChannel* channel_;
bool connecting_signalled_;
@@ -81,7 +85,20 @@
TEST_F(TransportTest, TestConnectChannelsDoesSignal) {
EXPECT_TRUE(SetupChannel());
transport_->ConnectChannels();
- EXPECT_TRUE(connecting_signalled_);
+ 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_);
}
// This test verifies channels are created with proper ICE
@@ -215,7 +232,7 @@
NULL));
channel_->SetConnectionCount(2);
- channel_->SetCandidatesGatheringComplete();
+ channel_->SignalCandidatesAllocationDone(channel_);
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