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

Unified Diff: net/tools/quic/quic_epoll_connection_helper_test.cc

Issue 15074007: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for windows Created 7 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 | « net/tools/quic/quic_epoll_connection_helper.h ('k') | net/tools/quic/quic_reliable_client_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_epoll_connection_helper_test.cc
diff --git a/net/tools/quic/quic_epoll_connection_helper_test.cc b/net/tools/quic/quic_epoll_connection_helper_test.cc
index 91fafa0d27a753864b21c294e03df22efea9e38b..5f5dc1b3ea1f407587eb9d2fa2a243a54472b5f6 100644
--- a/net/tools/quic/quic_epoll_connection_helper_test.cc
+++ b/net/tools/quic/quic_epoll_connection_helper_test.cc
@@ -29,7 +29,7 @@ namespace test {
namespace {
const char data1[] = "foo";
-const bool kHasData = true;
+const bool kFromPeer = true;
class TestConnectionHelper : public QuicEpollConnectionHelper {
public:
@@ -141,17 +141,18 @@ TEST_F(QuicConnectionHelperTest, InitialTimeout) {
EXPECT_TRUE(connection_.connected());
EXPECT_CALL(*send_algorithm_, SentPacket(_, 1, _, NOT_RETRANSMISSION));
- EXPECT_CALL(visitor_, ConnectionClose(QUIC_CONNECTION_TIMED_OUT, !kHasData));
+ EXPECT_CALL(visitor_, ConnectionClose(QUIC_CONNECTION_TIMED_OUT, !kFromPeer));
epoll_server_.WaitForEventsAndExecuteCallbacks();
EXPECT_FALSE(connection_.connected());
- EXPECT_EQ(kDefaultTimeoutUs, epoll_server_.NowInUsec());
+ EXPECT_EQ(kDefaultInitialTimeoutSecs * 1000000, epoll_server_.NowInUsec());
}
TEST_F(QuicConnectionHelperTest, TimeoutAfterSend) {
EXPECT_TRUE(connection_.connected());
EXPECT_EQ(0, epoll_server_.NowInUsec());
- // When we send a packet, the timeout will change to 5000 + kDefaultTimeout.
+ // When we send a packet, the timeout will change to 5000 +
+ // kDefaultInitialTimeoutSecs.
epoll_server_.AdvanceBy(5000);
EXPECT_EQ(5000, epoll_server_.NowInUsec());
@@ -162,13 +163,14 @@ TEST_F(QuicConnectionHelperTest, TimeoutAfterSend) {
// The original alarm will fire. We should not time out because we had a
// network event at t=5000. The alarm will reregister.
epoll_server_.WaitForEventsAndExecuteCallbacks();
- EXPECT_EQ(kDefaultTimeoutUs, epoll_server_.NowInUsec());
+ EXPECT_EQ(kDefaultInitialTimeoutSecs * 1000000, epoll_server_.NowInUsec());
// This time, we should time out.
- EXPECT_CALL(visitor_, ConnectionClose(QUIC_CONNECTION_TIMED_OUT, false));
+ EXPECT_CALL(visitor_, ConnectionClose(QUIC_CONNECTION_TIMED_OUT, !kFromPeer));
EXPECT_CALL(*send_algorithm_, SentPacket(_, 2, _, NOT_RETRANSMISSION));
epoll_server_.WaitForEventsAndExecuteCallbacks();
- EXPECT_EQ(kDefaultTimeoutUs + 5000, epoll_server_.NowInUsec());
+ EXPECT_EQ(kDefaultInitialTimeoutSecs * 1000000 + 5000,
+ epoll_server_.NowInUsec());
EXPECT_FALSE(connection_.connected());
}
« no previous file with comments | « net/tools/quic/quic_epoll_connection_helper.h ('k') | net/tools/quic/quic_reliable_client_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698