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

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

Issue 1246913005: TransportController refactoring (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Set media engine on voice channel Created 5 years, 4 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
Index: webrtc/p2p/base/transport_unittest.cc
diff --git a/webrtc/p2p/base/transport_unittest.cc b/webrtc/p2p/base/transport_unittest.cc
index 7b8df64eabb57883e78e283381f0bd8867f30b73..a2271e6f54e513130f162f14041932b7b23d49f0 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", NULL)),
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
@@ -242,7 +225,7 @@ TEST_F(TransportTest, TestChannelCompletedAndFailed) {
NULL));
channel_->SetConnectionCount(2);
- channel_->SignalCandidatesAllocationDone(channel_);
+ channel_->SetCandidatesAllocationDone();
channel_->SetWritable(true);
EXPECT_TRUE_WAIT(transport_->all_channels_writable(), 100);
// ICE is not yet completed because there is still more than one connection.

Powered by Google App Engine
This is Rietveld 408576698