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

Side by Side Diff: net/socket/ssl_client_socket_pool_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
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 "net/http/http_proxy_client_socket_pool.h" 5 #include "net/http/http_proxy_client_socket_pool.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1272 std::string iplist; 1272 std::string iplist;
1273 SpdySessionKey key; 1273 SpdySessionKey key;
1274 AddressList addresses; 1274 AddressList addresses;
1275 } test_hosts[] = { 1275 } test_hosts[] = {
1276 { "www.webkit.org", "192.0.2.33,192.168.0.1,192.168.0.5" }, 1276 { "www.webkit.org", "192.0.2.33,192.168.0.1,192.168.0.5" },
1277 { "code.google.com", "192.168.0.2,192.168.0.3,192.168.0.5" }, 1277 { "code.google.com", "192.168.0.2,192.168.0.3,192.168.0.5" },
1278 { "js.webkit.org", "192.168.0.4,192.168.0.1,192.0.2.33" }, 1278 { "js.webkit.org", "192.168.0.4,192.168.0.1,192.0.2.33" },
1279 }; 1279 };
1280 1280
1281 host_resolver_.set_synchronous_mode(true); 1281 host_resolver_.set_synchronous_mode(true);
1282 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) { 1282 for (size_t i = 0; i < arraysize(test_hosts); i++) {
1283 host_resolver_.rules()->AddIPLiteralRule( 1283 host_resolver_.rules()->AddIPLiteralRule(
1284 test_hosts[i].name, test_hosts[i].iplist, std::string()); 1284 test_hosts[i].name, test_hosts[i].iplist, std::string());
1285 1285
1286 // This test requires that the HostResolver cache be populated. Normal 1286 // This test requires that the HostResolver cache be populated. Normal
1287 // code would have done this already, but we do it manually. 1287 // code would have done this already, but we do it manually.
1288 HostResolver::RequestInfo info(HostPortPair(test_hosts[i].name, kTestPort)); 1288 HostResolver::RequestInfo info(HostPortPair(test_hosts[i].name, kTestPort));
1289 host_resolver_.Resolve(info, 1289 host_resolver_.Resolve(info,
1290 DEFAULT_PRIORITY, 1290 DEFAULT_PRIORITY,
1291 &test_hosts[i].addresses, 1291 &test_hosts[i].addresses,
1292 CompletionCallback(), 1292 CompletionCallback(),
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 std::string iplist; 1332 std::string iplist;
1333 SpdySessionKey key; 1333 SpdySessionKey key;
1334 AddressList addresses; 1334 AddressList addresses;
1335 } test_hosts[] = { 1335 } test_hosts[] = {
1336 { "www.webkit.org", "192.0.2.33,192.168.0.1,192.168.0.5" }, 1336 { "www.webkit.org", "192.0.2.33,192.168.0.1,192.168.0.5" },
1337 { "js.webkit.com", "192.168.0.4,192.168.0.1,192.0.2.33" }, 1337 { "js.webkit.com", "192.168.0.4,192.168.0.1,192.0.2.33" },
1338 }; 1338 };
1339 1339
1340 TestCompletionCallback callback; 1340 TestCompletionCallback callback;
1341 int rv; 1341 int rv;
1342 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) { 1342 for (size_t i = 0; i < arraysize(test_hosts); i++) {
1343 host_resolver_.rules()->AddIPLiteralRule( 1343 host_resolver_.rules()->AddIPLiteralRule(
1344 test_hosts[i].name, test_hosts[i].iplist, std::string()); 1344 test_hosts[i].name, test_hosts[i].iplist, std::string());
1345 1345
1346 // This test requires that the HostResolver cache be populated. Normal 1346 // This test requires that the HostResolver cache be populated. Normal
1347 // code would have done this already, but we do it manually. 1347 // code would have done this already, but we do it manually.
1348 HostResolver::RequestInfo info(HostPortPair(test_hosts[i].name, kTestPort)); 1348 HostResolver::RequestInfo info(HostPortPair(test_hosts[i].name, kTestPort));
1349 rv = host_resolver_.Resolve(info, 1349 rv = host_resolver_.Resolve(info,
1350 DEFAULT_PRIORITY, 1350 DEFAULT_PRIORITY,
1351 &test_hosts[i].addresses, 1351 &test_hosts[i].addresses,
1352 callback.callback(), 1352 callback.callback(),
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 ssl.channel_id_sent = true; 1396 ssl.channel_id_sent = true;
1397 ssl.SetNextProto(GetParam()); 1397 ssl.SetNextProto(GetParam());
1398 TestIPPoolingDisabled(&ssl); 1398 TestIPPoolingDisabled(&ssl);
1399 } 1399 }
1400 1400
1401 // It would be nice to also test the timeouts in SSLClientSocketPool. 1401 // It would be nice to also test the timeouts in SSLClientSocketPool.
1402 1402
1403 } // namespace 1403 } // namespace
1404 1404
1405 } // namespace net 1405 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socks_client_socket_unittest.cc ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698