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

Side by Side Diff: net/spdy/spdy_network_transaction_unittest.cc

Issue 1594973004: Remove use of void** from HttpResponseHeaders::EnumerateHeaderLines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 4 years, 11 months 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
« no previous file with comments | « net/spdy/spdy_http_utils.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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
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
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
OLDNEW
« no previous file with comments | « net/spdy/spdy_http_utils.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698