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

Unified Diff: remoting/protocol/webrtc_transport_unittest.cc

Issue 1662673002: Add MessageChanneFactory interface and use it in ChannelDispatcherBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@framing
Patch Set: Created 4 years, 11 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/webrtc_transport.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/webrtc_transport_unittest.cc
diff --git a/remoting/protocol/webrtc_transport_unittest.cc b/remoting/protocol/webrtc_transport_unittest.cc
index b4e3ec60c1f95d90bf9370c5b269f63733cf8560..591e216f1d833d96050e063cac926ed1dfa035ff 100644
--- a/remoting/protocol/webrtc_transport_unittest.cc
+++ b/remoting/protocol/webrtc_transport_unittest.cc
@@ -12,11 +12,11 @@
#include "jingle/glue/thread_wrapper.h"
#include "net/base/io_buffer.h"
#include "net/url_request/url_request_context_getter.h"
-#include "remoting/protocol/chromium_port_allocator.h"
#include "remoting/protocol/connection_tester.h"
#include "remoting/protocol/fake_authenticator.h"
+#include "remoting/protocol/message_channel_factory.h"
+#include "remoting/protocol/message_pipe.h"
#include "remoting/protocol/network_settings.h"
-#include "remoting/protocol/p2p_stream_socket.h"
#include "remoting/protocol/transport_context.h"
#include "remoting/signaling/fake_signal_strategy.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -85,9 +85,9 @@ class WebrtcTransportTest : public testing::Test {
void TearDown() override {
run_loop_.reset();
- client_socket_.reset();
+ client_message_pipe_.reset();
client_transport_.reset();
- host_socket_.reset();
+ host_message_pipe_.reset();
host_transport_.reset();
base::RunLoop().RunUntilIdle();
}
@@ -165,15 +165,15 @@ class WebrtcTransportTest : public testing::Test {
base::Unretained(this)));
}
- void OnClientChannelCreated(scoped_ptr<P2PStreamSocket> socket) {
- client_socket_ = std::move(socket);
- if (run_loop_ && host_socket_)
+ void OnClientChannelCreated(scoped_ptr<MessagePipe> pipe) {
+ client_message_pipe_ = std::move(pipe);
+ if (run_loop_ && host_message_pipe_)
run_loop_->Quit();
}
- void OnHostChannelCreated(scoped_ptr<P2PStreamSocket> socket) {
- host_socket_ = std::move(socket);
- if (run_loop_ && client_socket_)
+ void OnHostChannelCreated(scoped_ptr<MessagePipe> pipe) {
+ host_message_pipe_ = std::move(pipe);
+ if (run_loop_ && client_message_pipe_)
run_loop_->Quit();
}
@@ -202,8 +202,8 @@ class WebrtcTransportTest : public testing::Test {
TestTransportEventHandler client_event_handler_;
scoped_ptr<FakeAuthenticator> client_authenticator_;
- scoped_ptr<P2PStreamSocket> client_socket_;
- scoped_ptr<P2PStreamSocket> host_socket_;
+ scoped_ptr<MessagePipe> client_message_pipe_;
+ scoped_ptr<MessagePipe> host_message_pipe_;
ErrorCode error_ = OK;
};
@@ -226,16 +226,15 @@ TEST_F(WebrtcTransportTest, DataStream) {
run_loop_.reset(new base::RunLoop());
run_loop_->Run();
- EXPECT_TRUE(client_socket_);
- EXPECT_TRUE(host_socket_);
+ EXPECT_TRUE(client_message_pipe_);
+ EXPECT_TRUE(host_message_pipe_);
const int kMessageSize = 1024;
const int kMessages = 100;
- StreamConnectionTester tester(host_socket_.get(), client_socket_.get(),
- kMessageSize, kMessages);
- tester.Start();
- message_loop_.Run();
- tester.CheckResults();
+ MessagePipeConnectionTester tester(host_message_pipe_.get(),
+ client_message_pipe_.get(), kMessageSize,
+ kMessages);
+ tester.RunAndCheckResults();
}
// Verify that data streams can be created after connection has been initiated.
@@ -250,8 +249,8 @@ TEST_F(WebrtcTransportTest, DataStreamLate) {
run_loop_.reset(new base::RunLoop());
run_loop_->Run();
- EXPECT_TRUE(client_socket_);
- EXPECT_TRUE(host_socket_);
+ EXPECT_TRUE(client_message_pipe_);
+ EXPECT_TRUE(host_message_pipe_);
}
} // namespace protocol
« no previous file with comments | « remoting/protocol/webrtc_transport.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698