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

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

Issue 662553002: Convert ARRAYSIZE_UNSAFE -> arraysize in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/socket/ssl_client_socket_pool_unittest.cc ('k') | net/spdy/spdy_session_pool_unittest.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 <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 3220 matching lines...) Expand 10 before | Expand all | Expand 10 after
3231 test_cases[2].expected_headers["hello"] = "bye"; 3231 test_cases[2].expected_headers["hello"] = "bye";
3232 test_cases[2].expected_headers["status"] = "200"; 3232 test_cases[2].expected_headers["status"] = "200";
3233 3233
3234 if (spdy_util_.spdy_version() < SPDY4) { 3234 if (spdy_util_.spdy_version() < SPDY4) {
3235 // SPDY4/HTTP2 eliminates use of the :version header. 3235 // SPDY4/HTTP2 eliminates use of the :version header.
3236 test_cases[0].expected_headers["version"] = "HTTP/1.1"; 3236 test_cases[0].expected_headers["version"] = "HTTP/1.1";
3237 test_cases[1].expected_headers["version"] = "HTTP/1.1"; 3237 test_cases[1].expected_headers["version"] = "HTTP/1.1";
3238 test_cases[2].expected_headers["version"] = "HTTP/1.1"; 3238 test_cases[2].expected_headers["version"] = "HTTP/1.1";
3239 } 3239 }
3240 3240
3241 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 3241 for (size_t i = 0; i < arraysize(test_cases); ++i) {
3242 scoped_ptr<SpdyFrame> req( 3242 scoped_ptr<SpdyFrame> req(
3243 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); 3243 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true));
3244 MockWrite writes[] = { CreateMockWrite(*req) }; 3244 MockWrite writes[] = { CreateMockWrite(*req) };
3245 3245
3246 scoped_ptr<SpdyFrame> resp( 3246 scoped_ptr<SpdyFrame> resp(
3247 spdy_util_.ConstructSpdyGetSynReply(test_cases[i].extra_headers, 3247 spdy_util_.ConstructSpdyGetSynReply(test_cases[i].extra_headers,
3248 test_cases[i].num_headers, 3248 test_cases[i].num_headers,
3249 1)); 3249 1));
3250 scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true)); 3250 scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true));
3251 MockRead reads[] = { 3251 MockRead reads[] = {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
3344 { "vary", "friend,enemy", 3344 { "vary", "friend,enemy",
3345 spdy_util_.GetStatusKey(), "200", 3345 spdy_util_.GetStatusKey(), "200",
3346 spdy_util_.GetPathKey(), "/index.php", 3346 spdy_util_.GetPathKey(), "/index.php",
3347 spdy_util_.GetVersionKey(), "HTTP/1.1", 3347 spdy_util_.GetVersionKey(), "HTTP/1.1",
3348 NULL 3348 NULL
3349 } 3349 }
3350 } 3350 }
3351 } 3351 }
3352 }; 3352 };
3353 3353
3354 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 3354 for (size_t i = 0; i < arraysize(test_cases); ++i) {
3355 // Construct the request. 3355 // Construct the request.
3356 scoped_ptr<SpdyFrame> frame_req( 3356 scoped_ptr<SpdyFrame> frame_req(
3357 spdy_util_.ConstructSpdyGet(test_cases[i].extra_headers[0], 3357 spdy_util_.ConstructSpdyGet(test_cases[i].extra_headers[0],
3358 test_cases[i].num_headers[0], 3358 test_cases[i].num_headers[0],
3359 false, 1, LOWEST, true)); 3359 false, 1, LOWEST, true));
3360 3360
3361 MockWrite writes[] = { 3361 MockWrite writes[] = {
3362 CreateMockWrite(*frame_req), 3362 CreateMockWrite(*frame_req),
3363 }; 3363 };
3364 3364
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
3448 { 2, 3448 { 2,
3449 { "status", "200", 3449 { "status", "200",
3450 spdy_util_.GetPathKey(), "/index.php", 3450 spdy_util_.GetPathKey(), "/index.php",
3451 NULL 3451 NULL
3452 }, 3452 },
3453 }, 3453 },
3454 // SYN_REPLY with no headers 3454 // SYN_REPLY with no headers
3455 { 0, { NULL }, }, 3455 { 0, { NULL }, },
3456 }; 3456 };
3457 3457
3458 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 3458 for (size_t i = 0; i < arraysize(test_cases); ++i) {
3459 scoped_ptr<SpdyFrame> req( 3459 scoped_ptr<SpdyFrame> req(
3460 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); 3460 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true));
3461 scoped_ptr<SpdyFrame> rst( 3461 scoped_ptr<SpdyFrame> rst(
3462 spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); 3462 spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR));
3463 MockWrite writes[] = { 3463 MockWrite writes[] = {
3464 CreateMockWrite(*req), 3464 CreateMockWrite(*req),
3465 CreateMockWrite(*rst), 3465 CreateMockWrite(*rst),
3466 }; 3466 };
3467 3467
3468 // Construct the reply. 3468 // Construct the reply.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3504 test::SetFrameLength(syn_reply_wrong_length.get(), 3504 test::SetFrameLength(syn_reply_wrong_length.get(),
3505 wrong_size, 3505 wrong_size,
3506 spdy_util_.spdy_version()); 3506 spdy_util_.spdy_version());
3507 3507
3508 struct SynReplyTests { 3508 struct SynReplyTests {
3509 const SpdyFrame* syn_reply; 3509 const SpdyFrame* syn_reply;
3510 } test_cases[] = { 3510 } test_cases[] = {
3511 { syn_reply_wrong_length.get(), }, 3511 { syn_reply_wrong_length.get(), },
3512 }; 3512 };
3513 3513
3514 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { 3514 for (size_t i = 0; i < arraysize(test_cases); ++i) {
3515 scoped_ptr<SpdyFrame> req( 3515 scoped_ptr<SpdyFrame> req(
3516 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true)); 3516 spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, true));
3517 scoped_ptr<SpdyFrame> rst( 3517 scoped_ptr<SpdyFrame> rst(
3518 spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR)); 3518 spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_PROTOCOL_ERROR));
3519 MockWrite writes[] = { 3519 MockWrite writes[] = {
3520 CreateMockWrite(*req), 3520 CreateMockWrite(*req),
3521 CreateMockWrite(*rst), 3521 CreateMockWrite(*rst),
3522 }; 3522 };
3523 3523
3524 scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true)); 3524 scoped_ptr<SpdyFrame> body(spdy_util_.ConstructSpdyBodyFrame(1, true));
(...skipping 3088 matching lines...) Expand 10 before | Expand all | Expand 10 after
6613 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) { 6613 TEST_P(SpdyNetworkTransactionTLSUsageCheckTest, TLSCipherSuiteSucky) {
6614 scoped_ptr<SSLSocketDataProvider> ssl_provider( 6614 scoped_ptr<SSLSocketDataProvider> ssl_provider(
6615 new SSLSocketDataProvider(ASYNC, OK)); 6615 new SSLSocketDataProvider(ASYNC, OK));
6616 // Set to TLS_RSA_WITH_NULL_MD5 6616 // Set to TLS_RSA_WITH_NULL_MD5
6617 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status); 6617 SSLConnectionStatusSetCipherSuite(0x1, &ssl_provider->connection_status);
6618 6618
6619 RunTLSUsageCheckTest(ssl_provider.Pass()); 6619 RunTLSUsageCheckTest(ssl_provider.Pass());
6620 } 6620 }
6621 6621
6622 } // namespace net 6622 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_pool_unittest.cc ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698