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

Side by Side Diff: net/spdy/spdy_network_transaction_spdy2_unittest.cc

Issue 11464028: Introduce ERR_NETWORK_CHANGED and allow URLFetcher to automatically retry on that error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed nits Created 8 years 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 void RunDefaultTest() { 163 void RunDefaultTest() {
164 output_.rv = trans_->Start(&request_, callback.callback(), log_); 164 output_.rv = trans_->Start(&request_, callback.callback(), log_);
165 165
166 // We expect an IO Pending or some sort of error. 166 // We expect an IO Pending or some sort of error.
167 EXPECT_LT(output_.rv, 0); 167 EXPECT_LT(output_.rv, 0);
168 if (output_.rv != ERR_IO_PENDING) 168 if (output_.rv != ERR_IO_PENDING)
169 return; 169 return;
170 170
171 output_.rv = callback.WaitForResult(); 171 output_.rv = callback.WaitForResult();
172 if (output_.rv != OK) { 172 if (output_.rv != OK) {
173 session_->spdy_session_pool()->CloseCurrentSessions(); 173 session_->spdy_session_pool()->CloseCurrentSessions(net::ERR_ABORTED);
174 return; 174 return;
175 } 175 }
176 176
177 // Verify responses. 177 // Verify responses.
178 const HttpResponseInfo* response = trans_->GetResponseInfo(); 178 const HttpResponseInfo* response = trans_->GetResponseInfo();
179 ASSERT_TRUE(response != NULL); 179 ASSERT_TRUE(response != NULL);
180 ASSERT_TRUE(response->headers != NULL); 180 ASSERT_TRUE(response->headers != NULL);
181 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); 181 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
182 EXPECT_EQ(spdy_enabled_, response->was_fetched_via_spdy); 182 EXPECT_EQ(spdy_enabled_, response->was_fetched_via_spdy);
183 if (test_type_ == SPDYNPN && spdy_enabled_) { 183 if (test_type_ == SPDYNPN && spdy_enabled_) {
(...skipping 5587 matching lines...) Expand 10 before | Expand all | Expand 10 after
5771 // And now we can allow everything else to run to completion. 5771 // And now we can allow everything else to run to completion.
5772 data.SetStop(10); 5772 data.SetStop(10);
5773 data.Run(); 5773 data.Run();
5774 EXPECT_EQ(OK, callback2.WaitForResult()); 5774 EXPECT_EQ(OK, callback2.WaitForResult());
5775 EXPECT_EQ(OK, callback3.WaitForResult()); 5775 EXPECT_EQ(OK, callback3.WaitForResult());
5776 5776
5777 helper.VerifyDataConsumed(); 5777 helper.VerifyDataConsumed();
5778 } 5778 }
5779 5779
5780 } // namespace net 5780 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/transport_client_socket_pool_unittest.cc ('k') | net/spdy/spdy_network_transaction_spdy3_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698