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 <stddef.h> | 5 #include <stddef.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 227 } |
228 | 228 |
229 ASSERT_TRUE(Initialize()); | 229 ASSERT_TRUE(Initialize()); |
230 | 230 |
231 HTTPMessage request(HttpConstants::HTTP_1_1, | 231 HTTPMessage request(HttpConstants::HTTP_1_1, |
232 HttpConstants::POST, "/foo"); | 232 HttpConstants::POST, "/foo"); |
233 request.set_has_complete_message(false); | 233 request.set_has_complete_message(false); |
234 | 234 |
235 client_->SendMessage(request); | 235 client_->SendMessage(request); |
236 | 236 |
237 client_->SendData("", true); | 237 client_->SendData(std::string(), true); |
238 | 238 |
239 client_->WaitForResponse(); | 239 client_->WaitForResponse(); |
240 EXPECT_EQ(kFooResponseBody, client_->response_body()); | 240 EXPECT_EQ(kFooResponseBody, client_->response_body()); |
241 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); | 241 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); |
242 | 242 |
243 request.AddBody("foo", true); | 243 request.AddBody("foo", true); |
244 | 244 |
245 client_->SendMessage(request); | 245 client_->SendMessage(request); |
246 client_->SendData("", true); | 246 client_->SendData(std::string(), true); |
247 client_->WaitForResponse(); | 247 client_->WaitForResponse(); |
248 EXPECT_EQ(kFooResponseBody, client_->response_body()); | 248 EXPECT_EQ(kFooResponseBody, client_->response_body()); |
249 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); | 249 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); |
250 } | 250 } |
251 | 251 |
252 TEST_F(EndToEndTest, MultipleRequestResponse) { | 252 TEST_F(EndToEndTest, MultipleRequestResponse) { |
253 // TODO(rtenneti): Delete this when NSS is supported. | 253 // TODO(rtenneti): Delete this when NSS is supported. |
254 if (!Aes128GcmEncrypter::IsSupported()) { | 254 if (!Aes128GcmEncrypter::IsSupported()) { |
255 LOG(INFO) << "AES GCM not supported. Test skipped."; | 255 LOG(INFO) << "AES GCM not supported. Test skipped."; |
256 return; | 256 return; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); | 518 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); |
519 client_->ResetConnection(); | 519 client_->ResetConnection(); |
520 EXPECT_EQ(kBarResponseBody, client_->SendSynchronousRequest("/bar")); | 520 EXPECT_EQ(kBarResponseBody, client_->SendSynchronousRequest("/bar")); |
521 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); | 521 EXPECT_EQ(200ul, client_->response_headers()->parsed_response_code()); |
522 } | 522 } |
523 | 523 |
524 } // namespace | 524 } // namespace |
525 } // namespace test | 525 } // namespace test |
526 } // namespace tools | 526 } // namespace tools |
527 } // namespace net | 527 } // namespace net |
OLD | NEW |