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

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: 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 void RunDefaultTest() { 162 void RunDefaultTest() {
163 output_.rv = trans_->Start(&request_, callback.callback(), log_); 163 output_.rv = trans_->Start(&request_, callback.callback(), log_);
164 164
165 // We expect an IO Pending or some sort of error. 165 // We expect an IO Pending or some sort of error.
166 EXPECT_LT(output_.rv, 0); 166 EXPECT_LT(output_.rv, 0);
167 if (output_.rv != ERR_IO_PENDING) 167 if (output_.rv != ERR_IO_PENDING)
168 return; 168 return;
169 169
170 output_.rv = callback.WaitForResult(); 170 output_.rv = callback.WaitForResult();
171 if (output_.rv != OK) { 171 if (output_.rv != OK) {
172 session_->spdy_session_pool()->CloseCurrentSessions(); 172 session_->spdy_session_pool()->CloseCurrentSessions(net::ERR_ABORTED);
173 return; 173 return;
174 } 174 }
175 175
176 // Verify responses. 176 // Verify responses.
177 const HttpResponseInfo* response = trans_->GetResponseInfo(); 177 const HttpResponseInfo* response = trans_->GetResponseInfo();
178 ASSERT_TRUE(response != NULL); 178 ASSERT_TRUE(response != NULL);
179 ASSERT_TRUE(response->headers != NULL); 179 ASSERT_TRUE(response->headers != NULL);
180 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); 180 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine());
181 EXPECT_EQ(spdy_enabled_, response->was_fetched_via_spdy); 181 EXPECT_EQ(spdy_enabled_, response->was_fetched_via_spdy);
182 if (test_type_ == SPDYNPN && spdy_enabled_) { 182 if (test_type_ == SPDYNPN && spdy_enabled_) {
(...skipping 5583 matching lines...) Expand 10 before | Expand all | Expand 10 after
5766 // And now we can allow everything else to run to completion. 5766 // And now we can allow everything else to run to completion.
5767 data.SetStop(10); 5767 data.SetStop(10);
5768 data.Run(); 5768 data.Run();
5769 EXPECT_EQ(OK, callback2.WaitForResult()); 5769 EXPECT_EQ(OK, callback2.WaitForResult());
5770 EXPECT_EQ(OK, callback3.WaitForResult()); 5770 EXPECT_EQ(OK, callback3.WaitForResult());
5771 5771
5772 helper.VerifyDataConsumed(); 5772 helper.VerifyDataConsumed();
5773 } 5773 }
5774 5774
5775 } // namespace net 5775 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698