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 <memory> | 5 #include <memory> |
6 #include <ostream> | 6 #include <ostream> |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 } | 575 } |
576 | 576 |
577 void CheckWasHttpResponse( | 577 void CheckWasHttpResponse( |
578 const std::unique_ptr<HttpNetworkTransaction>& trans) { | 578 const std::unique_ptr<HttpNetworkTransaction>& trans) { |
579 const HttpResponseInfo* response = trans->GetResponseInfo(); | 579 const HttpResponseInfo* response = trans->GetResponseInfo(); |
580 ASSERT_TRUE(response != nullptr); | 580 ASSERT_TRUE(response != nullptr); |
581 ASSERT_TRUE(response->headers.get() != nullptr); | 581 ASSERT_TRUE(response->headers.get() != nullptr); |
582 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); | 582 EXPECT_EQ("HTTP/1.1 200 OK", response->headers->GetStatusLine()); |
583 EXPECT_FALSE(response->was_fetched_via_spdy); | 583 EXPECT_FALSE(response->was_fetched_via_spdy); |
584 EXPECT_FALSE(response->was_npn_negotiated); | 584 EXPECT_FALSE(response->was_npn_negotiated); |
585 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1, | 585 EXPECT_EQ(HttpResponseInfo::CONNECTION_INFO_HTTP1_1, |
586 response->connection_info); | 586 response->connection_info); |
587 } | 587 } |
588 | 588 |
589 void CheckResponseData(const std::unique_ptr<HttpNetworkTransaction>& trans, | 589 void CheckResponseData(const std::unique_ptr<HttpNetworkTransaction>& trans, |
590 const std::string& expected) { | 590 const std::string& expected) { |
591 std::string response_data; | 591 std::string response_data; |
592 ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); | 592 ASSERT_EQ(OK, ReadTransaction(trans.get(), &response_data)); |
593 EXPECT_EQ(expected, response_data); | 593 EXPECT_EQ(expected, response_data); |
594 } | 594 } |
595 | 595 |
(...skipping 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2742 AddHangingSocketData(); | 2742 AddHangingSocketData(); |
2743 | 2743 |
2744 SendRequestAndExpectQuicResponse(origin1_); | 2744 SendRequestAndExpectQuicResponse(origin1_); |
2745 SendRequestAndExpectQuicResponse(origin2_); | 2745 SendRequestAndExpectQuicResponse(origin2_); |
2746 | 2746 |
2747 EXPECT_TRUE(AllDataConsumed()); | 2747 EXPECT_TRUE(AllDataConsumed()); |
2748 } | 2748 } |
2749 | 2749 |
2750 } // namespace test | 2750 } // namespace test |
2751 } // namespace net | 2751 } // namespace net |
OLD | NEW |