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

Unified Diff: remoting/protocol/jingle_session_unittest.cc

Issue 1420273002: Add TransportSession interface to prepare for WebRTC-based transport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « remoting/protocol/jingle_session.cc ('k') | remoting/protocol/libjingle_transport_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_session_unittest.cc
diff --git a/remoting/protocol/jingle_session_unittest.cc b/remoting/protocol/jingle_session_unittest.cc
index 8a643c36d91affb2b7cb75dc8f187a3389f24408..8a7a910a7e31a6fbc6aed2c87c4dad91004beec4 100644
--- a/remoting/protocol/jingle_session_unittest.cc
+++ b/remoting/protocol/jingle_session_unittest.cc
@@ -19,8 +19,8 @@
#include "remoting/protocol/chromium_port_allocator.h"
#include "remoting/protocol/connection_tester.h"
#include "remoting/protocol/fake_authenticator.h"
+#include "remoting/protocol/ice_transport_factory.h"
#include "remoting/protocol/jingle_session_manager.h"
-#include "remoting/protocol/libjingle_transport_factory.h"
#include "remoting/protocol/network_settings.h"
#include "remoting/protocol/p2p_stream_socket.h"
#include "remoting/protocol/stream_channel_factory.h"
@@ -147,7 +147,7 @@ class JingleSessionTest : public testing::Test {
EXPECT_CALL(host_server_listener_, OnSessionManagerReady())
.Times(1);
- scoped_ptr<TransportFactory> host_transport(new LibjingleTransportFactory(
+ scoped_ptr<TransportFactory> host_transport(new IceTransportFactory(
nullptr,
ChromiumPortAllocator::Create(nullptr, network_settings_).Pass(),
network_settings_, TransportRole::SERVER));
@@ -161,7 +161,7 @@ class JingleSessionTest : public testing::Test {
EXPECT_CALL(client_server_listener_, OnSessionManagerReady())
.Times(1);
- scoped_ptr<TransportFactory> client_transport(new LibjingleTransportFactory(
+ scoped_ptr<TransportFactory> client_transport(new IceTransportFactory(
nullptr,
ChromiumPortAllocator::Create(nullptr, network_settings_).Pass(),
network_settings_, TransportRole::CLIENT));
@@ -255,12 +255,16 @@ class JingleSessionTest : public testing::Test {
}
void CreateChannel() {
- client_session_->GetTransportChannelFactory()->CreateChannel(
- kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated,
- base::Unretained(this)));
- host_session_->GetTransportChannelFactory()->CreateChannel(
- kChannelName, base::Bind(&JingleSessionTest::OnHostChannelCreated,
- base::Unretained(this)));
+ client_session_->GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->CreateChannel(kChannelName,
+ base::Bind(&JingleSessionTest::OnClientChannelCreated,
+ base::Unretained(this)));
+ host_session_->GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->CreateChannel(kChannelName,
+ base::Bind(&JingleSessionTest::OnHostChannelCreated,
+ base::Unretained(this)));
int counter = 2;
ExpectRouteChange(kChannelName);
@@ -496,12 +500,16 @@ TEST_F(JingleSessionTest, TestMuxStreamChannel) {
ASSERT_NO_FATAL_FAILURE(
InitiateConnection(1, FakeAuthenticator::ACCEPT, false));
- client_session_->GetMultiplexedChannelFactory()->CreateChannel(
- kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated,
- base::Unretained(this)));
- host_session_->GetMultiplexedChannelFactory()->CreateChannel(
- kChannelName, base::Bind(&JingleSessionTest::OnHostChannelCreated,
- base::Unretained(this)));
+ client_session_->GetTransportSession()
+ ->GetMultiplexedChannelFactory()
+ ->CreateChannel(kChannelName,
+ base::Bind(&JingleSessionTest::OnClientChannelCreated,
+ base::Unretained(this)));
+ host_session_->GetTransportSession()
+ ->GetMultiplexedChannelFactory()
+ ->CreateChannel(kChannelName,
+ base::Bind(&JingleSessionTest::OnHostChannelCreated,
+ base::Unretained(this)));
int counter = 2;
ExpectRouteChange("mux");
@@ -616,12 +624,16 @@ TEST_F(JingleSessionTest, TestFailedChannelAuth) {
ASSERT_NO_FATAL_FAILURE(
InitiateConnection(1, FakeAuthenticator::ACCEPT, false));
- client_session_->GetTransportChannelFactory()->CreateChannel(
- kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated,
- base::Unretained(this)));
- host_session_->GetTransportChannelFactory()->CreateChannel(
- kChannelName, base::Bind(&JingleSessionTest::OnHostChannelCreated,
- base::Unretained(this)));
+ client_session_->GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->CreateChannel(kChannelName,
+ base::Bind(&JingleSessionTest::OnClientChannelCreated,
+ base::Unretained(this)));
+ host_session_->GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->CreateChannel(kChannelName,
+ base::Bind(&JingleSessionTest::OnHostChannelCreated,
+ base::Unretained(this)));
// Terminate the message loop when we get rejection notification
// from the host.
@@ -631,8 +643,9 @@ TEST_F(JingleSessionTest, TestFailedChannelAuth) {
message_loop_->Run();
- client_session_->GetTransportChannelFactory()->CancelChannelCreation(
- kChannelName);
+ client_session_->GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->CancelChannelCreation(kChannelName);
EXPECT_TRUE(!host_socket_.get());
}
@@ -642,11 +655,14 @@ TEST_F(JingleSessionTest, TestCancelChannelCreation) {
ASSERT_NO_FATAL_FAILURE(
InitiateConnection(1, FakeAuthenticator::ACCEPT, false));
- client_session_->GetTransportChannelFactory()->CreateChannel(
- kChannelName, base::Bind(&JingleSessionTest::OnClientChannelCreated,
- base::Unretained(this)));
- client_session_->GetTransportChannelFactory()->CancelChannelCreation(
- kChannelName);
+ client_session_->GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->CreateChannel(kChannelName,
+ base::Bind(&JingleSessionTest::OnClientChannelCreated,
+ base::Unretained(this)));
+ client_session_->GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->CancelChannelCreation(kChannelName);
EXPECT_TRUE(!client_socket_.get());
}
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | remoting/protocol/libjingle_transport_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698