| 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 <string> | 5 #include <string> |
| 6 #include <utility> | 6 #include <utility> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 3049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3060 BoundNetLog(), GetParam(), NULL); | 3060 BoundNetLog(), GetParam(), NULL); |
| 3061 helper.RunToCompletion(&data); | 3061 helper.RunToCompletion(&data); |
| 3062 TransactionHelperResult out = helper.output(); | 3062 TransactionHelperResult out = helper.output(); |
| 3063 | 3063 |
| 3064 EXPECT_EQ(OK, out.rv); | 3064 EXPECT_EQ(OK, out.rv); |
| 3065 EXPECT_EQ("HTTP/1.1 200", out.status_line); | 3065 EXPECT_EQ("HTTP/1.1 200", out.status_line); |
| 3066 EXPECT_EQ("hello!", out.response_data); | 3066 EXPECT_EQ("hello!", out.response_data); |
| 3067 | 3067 |
| 3068 scoped_refptr<HttpResponseHeaders> headers = out.response_info.headers; | 3068 scoped_refptr<HttpResponseHeaders> headers = out.response_info.headers; |
| 3069 EXPECT_TRUE(headers.get() != NULL); | 3069 EXPECT_TRUE(headers.get() != NULL); |
| 3070 void* iter = NULL; | 3070 size_t iter = 0; |
| 3071 std::string name, value; | 3071 std::string name, value; |
| 3072 SpdyHeaderBlock header_block; | 3072 SpdyHeaderBlock header_block; |
| 3073 while (headers->EnumerateHeaderLines(&iter, &name, &value)) { | 3073 while (headers->EnumerateHeaderLines(&iter, &name, &value)) { |
| 3074 SpdyHeaderBlock::StringPieceProxy mutable_header_block_value = | 3074 SpdyHeaderBlock::StringPieceProxy mutable_header_block_value = |
| 3075 header_block[name]; | 3075 header_block[name]; |
| 3076 if (static_cast<StringPiece>(mutable_header_block_value).empty()) { | 3076 if (static_cast<StringPiece>(mutable_header_block_value).empty()) { |
| 3077 mutable_header_block_value = value; | 3077 mutable_header_block_value = value; |
| 3078 } else { | 3078 } else { |
| 3079 std::string joint_value = mutable_header_block_value.as_string(); | 3079 std::string joint_value = mutable_header_block_value.as_string(); |
| 3080 joint_value.append(1, '\0'); | 3080 joint_value.append(1, '\0'); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3173 EXPECT_EQ("HTTP/1.1 200", out.status_line) << i; | 3173 EXPECT_EQ("HTTP/1.1 200", out.status_line) << i; |
| 3174 EXPECT_EQ("hello!", out.response_data) << i; | 3174 EXPECT_EQ("hello!", out.response_data) << i; |
| 3175 | 3175 |
| 3176 // Test the response information. | 3176 // Test the response information. |
| 3177 EXPECT_EQ(out.response_info.vary_data.is_valid(), | 3177 EXPECT_EQ(out.response_info.vary_data.is_valid(), |
| 3178 test_cases[i].vary_matches) << i; | 3178 test_cases[i].vary_matches) << i; |
| 3179 | 3179 |
| 3180 // Check the headers. | 3180 // Check the headers. |
| 3181 scoped_refptr<HttpResponseHeaders> headers = out.response_info.headers; | 3181 scoped_refptr<HttpResponseHeaders> headers = out.response_info.headers; |
| 3182 ASSERT_TRUE(headers.get() != NULL) << i; | 3182 ASSERT_TRUE(headers.get() != NULL) << i; |
| 3183 void* iter = NULL; | 3183 size_t iter = 0; |
| 3184 std::string name, value, lines; | 3184 std::string name, value, lines; |
| 3185 while (headers->EnumerateHeaderLines(&iter, &name, &value)) { | 3185 while (headers->EnumerateHeaderLines(&iter, &name, &value)) { |
| 3186 lines.append(name); | 3186 lines.append(name); |
| 3187 lines.append(": "); | 3187 lines.append(": "); |
| 3188 lines.append(value); | 3188 lines.append(value); |
| 3189 lines.append("\n"); | 3189 lines.append("\n"); |
| 3190 } | 3190 } |
| 3191 | 3191 |
| 3192 // Construct the expected header reply string. | 3192 // Construct the expected header reply string. |
| 3193 std::string expected_reply = | 3193 std::string expected_reply = |
| (...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6568 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { | 6568 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { |
| 6569 scoped_ptr<SSLSocketDataProvider> ssl_provider( | 6569 scoped_ptr<SSLSocketDataProvider> ssl_provider( |
| 6570 new SSLSocketDataProvider(ASYNC, OK)); | 6570 new SSLSocketDataProvider(ASYNC, OK)); |
| 6571 // Set to TLS_RSA_WITH_NULL_MD5 | 6571 // Set to TLS_RSA_WITH_NULL_MD5 |
| 6572 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); | 6572 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); |
| 6573 | 6573 |
| 6574 RunTLSUsageCheckTest(std::move(ssl_provider)); | 6574 RunTLSUsageCheckTest(std::move(ssl_provider)); |
| 6575 } | 6575 } |
| 6576 | 6576 |
| 6577 } // namespace net | 6577 } // namespace net |
| OLD | NEW |