| OLD | NEW |
| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 void RunDefaultTest() { | 164 void RunDefaultTest() { |
| 165 output_.rv = trans_->Start(&request_, callback.callback(), log_); | 165 output_.rv = trans_->Start(&request_, callback.callback(), log_); |
| 166 | 166 |
| 167 // We expect an IO Pending or some sort of error. | 167 // We expect an IO Pending or some sort of error. |
| 168 EXPECT_LT(output_.rv, 0); | 168 EXPECT_LT(output_.rv, 0); |
| 169 if (output_.rv != ERR_IO_PENDING) | 169 if (output_.rv != ERR_IO_PENDING) |
| 170 return; | 170 return; |
| 171 | 171 |
| 172 output_.rv = callback.WaitForResult(); | 172 output_.rv = callback.WaitForResult(); |
| 173 if (output_.rv != OK) { | 173 if (output_.rv != OK) { |
| 174 session_->spdy_session_pool()->CloseCurrentSessions(); | 174 session_->spdy_session_pool()->CloseCurrentSessions(net::ERR_ABORTED); |
| 175 return; | 175 return; |
| 176 } | 176 } |
| 177 | 177 |
| 178 // Verify responses. | 178 // Verify responses. |
| 179 const HttpResponseInfo* response = trans_->GetResponseInfo(); | 179 const HttpResponseInfo* response = trans_->GetResponseInfo(); |
| 180 ASSERT_TRUE(response != NULL); | 180 ASSERT_TRUE(response != NULL); |
| 181 ASSERT_TRUE(response->headers != NULL); | 181 ASSERT_TRUE(response->headers != NULL); |
| 182 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); | 182 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
| 183 EXPECT_EQ(spdy_enabled_, response->was_fetched_via_spdy); | 183 EXPECT_EQ(spdy_enabled_, response->was_fetched_via_spdy); |
| 184 if (test_type_ == SPDYNPN && spdy_enabled_) { | 184 if (test_type_ == SPDYNPN && spdy_enabled_) { |
| (...skipping 6170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6355 // And now we can allow everything else to run to completion. | 6355 // And now we can allow everything else to run to completion. |
| 6356 data.SetStop(10); | 6356 data.SetStop(10); |
| 6357 data.Run(); | 6357 data.Run(); |
| 6358 EXPECT_EQ(OK, callback2.WaitForResult()); | 6358 EXPECT_EQ(OK, callback2.WaitForResult()); |
| 6359 EXPECT_EQ(OK, callback3.WaitForResult()); | 6359 EXPECT_EQ(OK, callback3.WaitForResult()); |
| 6360 | 6360 |
| 6361 helper.VerifyDataConsumed(); | 6361 helper.VerifyDataConsumed(); |
| 6362 } | 6362 } |
| 6363 | 6363 |
| 6364 } // namespace net | 6364 } // namespace net |
| OLD | NEW |