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

Side by Side Diff: net/base/address_list_unittest.cc

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 10 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/BUILD.gn ('k') | net/base/bandwidth_metrics.h » ('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 "net/base/address_list.h" 5 #include "net/base/address_list.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/sys_byteorder.h" 8 #include "base/sys_byteorder.h"
9 #include "net/base/net_util.h" 9 #include "net/base/net_util.h"
10 #include "net/base/sys_addrinfo.h" 10 #include "net/base/sys_addrinfo.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 namespace net { 13 namespace net {
14 namespace { 14 namespace {
15 15
16 static const char* kCanonicalHostname = "canonical.bar.com"; 16 const char kCanonicalHostname[] = "canonical.bar.com";
17 17
18 TEST(AddressListTest, Canonical) { 18 TEST(AddressListTest, Canonical) {
19 // Create an addrinfo with a canonical name. 19 // Create an addrinfo with a canonical name.
20 struct sockaddr_in address; 20 struct sockaddr_in address;
21 // The contents of address do not matter for this test, 21 // The contents of address do not matter for this test,
22 // so just zero-ing them out for consistency. 22 // so just zero-ing them out for consistency.
23 memset(&address, 0x0, sizeof(address)); 23 memset(&address, 0x0, sizeof(address));
24 // But we need to set the family. 24 // But we need to set the family.
25 address.sin_family = AF_INET; 25 address.sin_family = AF_INET;
26 struct addrinfo ai; 26 struct addrinfo ai;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 AddressList test_list = AddressList::CreateFromIPAddressList(ip_list, 130 AddressList test_list = AddressList::CreateFromIPAddressList(ip_list,
131 kCanonicalName); 131 kCanonicalName);
132 std::string canonical_name; 132 std::string canonical_name;
133 EXPECT_EQ(kCanonicalName, test_list.canonical_name()); 133 EXPECT_EQ(kCanonicalName, test_list.canonical_name());
134 EXPECT_EQ(arraysize(tests), test_list.size()); 134 EXPECT_EQ(arraysize(tests), test_list.size());
135 } 135 }
136 136
137 } // namespace 137 } // namespace
138 } // namespace net 138 } // namespace net
OLDNEW
« no previous file with comments | « net/BUILD.gn ('k') | net/base/bandwidth_metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698