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

Unified Diff: blimp/net/tcp_transport_unittest.cc

Issue 1962393004: Added a debug info UI for Blimp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added empty implementation for linux client Created 4 years, 7 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 | « blimp/net/tcp_engine_transport.cc ('k') | cc/trees/remote_channel_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/net/tcp_transport_unittest.cc
diff --git a/blimp/net/tcp_transport_unittest.cc b/blimp/net/tcp_transport_unittest.cc
index f6980d951f5e8eb772db1a4ddb702ead1830a269..d8f5bbc86a2c840e2f8f4eebd6634ed71fdba143 100644
--- a/blimp/net/tcp_transport_unittest.cc
+++ b/blimp/net/tcp_transport_unittest.cc
@@ -10,6 +10,7 @@
#include "blimp/common/proto/blimp_message.pb.h"
#include "blimp/common/proto/protocol_control.pb.h"
#include "blimp/net/blimp_connection.h"
+#include "blimp/net/blimp_connection_statistics.h"
#include "blimp/net/tcp_client_transport.h"
#include "blimp/net/tcp_engine_transport.h"
#include "blimp/net/test_common.h"
@@ -32,7 +33,7 @@ class TCPTransportTest : public testing::Test {
protected:
TCPTransportTest() {
net::IPEndPoint local_address(net::IPAddress(127, 0, 0, 1), 0);
- engine_.reset(new TCPEngineTransport(local_address, nullptr));
+ engine_.reset(new TCPEngineTransport(local_address, &statistics_, nullptr));
}
net::IPEndPoint GetLocalEndpoint() const {
@@ -42,15 +43,17 @@ class TCPTransportTest : public testing::Test {
}
base::MessageLoopForIO message_loop_;
+ BlimpConnectionStatistics statistics_;
std::unique_ptr<TCPEngineTransport> engine_;
};
TEST_F(TCPTransportTest, Connect) {
+ BlimpConnectionStatistics statistics;
net::TestCompletionCallback accept_callback;
engine_->Connect(accept_callback.callback());
net::TestCompletionCallback connect_callback;
- TCPClientTransport client(GetLocalEndpoint(), nullptr);
+ TCPClientTransport client(GetLocalEndpoint(), &statistics, nullptr);
client.Connect(connect_callback.callback());
EXPECT_EQ(net::OK, connect_callback.WaitForResult());
@@ -59,15 +62,16 @@ TEST_F(TCPTransportTest, Connect) {
}
TEST_F(TCPTransportTest, TwoClientConnections) {
+ BlimpConnectionStatistics statistics;
net::TestCompletionCallback accept_callback1;
engine_->Connect(accept_callback1.callback());
net::TestCompletionCallback connect_callback1;
- TCPClientTransport client1(GetLocalEndpoint(), nullptr);
+ TCPClientTransport client1(GetLocalEndpoint(), &statistics, nullptr);
client1.Connect(connect_callback1.callback());
net::TestCompletionCallback connect_callback2;
- TCPClientTransport client2(GetLocalEndpoint(), nullptr);
+ TCPClientTransport client2(GetLocalEndpoint(), &statistics, nullptr);
client2.Connect(connect_callback2.callback());
EXPECT_EQ(net::OK, connect_callback1.WaitForResult());
@@ -82,11 +86,14 @@ TEST_F(TCPTransportTest, TwoClientConnections) {
}
TEST_F(TCPTransportTest, ExchangeMessages) {
+ BlimpConnectionStatistics statistics;
+
// Start the Engine transport and connect a client to it.
net::TestCompletionCallback accept_callback;
engine_->Connect(accept_callback.callback());
net::TestCompletionCallback client_connect_callback;
- TCPClientTransport client(GetLocalEndpoint(), nullptr /* NetLog */);
+ TCPClientTransport client(GetLocalEndpoint(), &statistics,
+ nullptr /* NetLog */);
client.Connect(client_connect_callback.callback());
EXPECT_EQ(net::OK, client_connect_callback.WaitForResult());
EXPECT_EQ(net::OK, accept_callback.WaitForResult());
« no previous file with comments | « blimp/net/tcp_engine_transport.cc ('k') | cc/trees/remote_channel_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698