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

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 8230037: Send PING to check the status of the SPDY connection. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <math.h> // ceil 7 #include <math.h> // ceil
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 struct SimpleGetHelperResult { 124 struct SimpleGetHelperResult {
125 int rv; 125 int rv;
126 std::string status_line; 126 std::string status_line;
127 std::string response_data; 127 std::string response_data;
128 }; 128 };
129 129
130 virtual void SetUp() { 130 virtual void SetUp() {
131 NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); 131 NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
132 MessageLoop::current()->RunAllPending(); 132 MessageLoop::current()->RunAllPending();
133 spdy::SpdyFramer::set_enable_compression_default(false); 133 spdy::SpdyFramer::set_enable_compression_default(false);
134 // Disable sending PING.
135 SpdySession::set_enable_ping_based_connection_checking(false);
134 } 136 }
135 137
136 virtual void TearDown() { 138 virtual void TearDown() {
137 NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); 139 NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
138 MessageLoop::current()->RunAllPending(); 140 MessageLoop::current()->RunAllPending();
139 spdy::SpdyFramer::set_enable_compression_default(true); 141 spdy::SpdyFramer::set_enable_compression_default(true);
140 // Empty the current queue. 142 // Empty the current queue.
141 MessageLoop::current()->RunAllPending(); 143 MessageLoop::current()->RunAllPending();
142 PlatformTest::TearDown(); 144 PlatformTest::TearDown();
143 NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); 145 NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
144 MessageLoop::current()->RunAllPending(); 146 MessageLoop::current()->RunAllPending();
147 // Enable sending PING.
148 SpdySession::set_enable_ping_based_connection_checking(true);
145 } 149 }
146 150
147 void KeepAliveConnectionResendRequestTest(const MockRead& read_failure); 151 void KeepAliveConnectionResendRequestTest(const MockRead& read_failure);
148 152
149 SimpleGetHelperResult SimpleGetHelper(MockRead data_reads[], 153 SimpleGetHelperResult SimpleGetHelper(MockRead data_reads[],
150 size_t reads_count) { 154 size_t reads_count) {
151 SimpleGetHelperResult out; 155 SimpleGetHelperResult out;
152 156
153 HttpRequestInfo request; 157 HttpRequestInfo request;
154 request.method = "GET"; 158 request.method = "GET";
(...skipping 9059 matching lines...) Expand 10 before | Expand all | Expand 10 after
9214 EXPECT_TRUE(response->was_fetched_via_spdy); 9218 EXPECT_TRUE(response->was_fetched_via_spdy);
9215 EXPECT_TRUE(response->was_npn_negotiated); 9219 EXPECT_TRUE(response->was_npn_negotiated);
9216 ASSERT_EQ(OK, ReadTransaction(&trans2, &response_data)); 9220 ASSERT_EQ(OK, ReadTransaction(&trans2, &response_data));
9217 EXPECT_EQ("hello!", response_data); 9221 EXPECT_EQ("hello!", response_data);
9218 9222
9219 HttpStreamFactory::set_next_protos(""); 9223 HttpStreamFactory::set_next_protos("");
9220 HttpStreamFactory::set_use_alternate_protocols(false); 9224 HttpStreamFactory::set_use_alternate_protocols(false);
9221 } 9225 }
9222 9226
9223 } // namespace net 9227 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698