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

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

Issue 38001: Implement the PAC js-binding for "myIpAddress()". (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: update unittest for DnsResolve based on new empty string Created 11 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_util.cc ('k') | net/proxy/proxy_resolver_v8.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/time.h" 8 #include "base/time.h"
9 #include "googleurl/src/gurl.h" 9 #include "googleurl/src/gurl.h"
10 #include "net/base/net_util.h" 10 #include "net/base/net_util.h"
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 0x98, 0x76, 0x54, 0x32, 0x10}, 862 0x98, 0x76, 0x54, 0x32, 0x10},
863 "fedc:ba98:7654:3210:fedc:ba98:7654:3210"}, 863 "fedc:ba98:7654:3210:fedc:ba98:7654:3210"},
864 }; 864 };
865 865
866 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { 866 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
867 const addrinfo* ai = GetIPv6Address(tests[i].addr); 867 const addrinfo* ai = GetIPv6Address(tests[i].addr);
868 std::string result = net::NetAddressToString(ai); 868 std::string result = net::NetAddressToString(ai);
869 EXPECT_EQ(std::string(tests[i].result), result); 869 EXPECT_EQ(std::string(tests[i].result), result);
870 } 870 }
871 } 871 }
872
873 TEST(NetUtilTest, GetMyHostName) {
874 // We can't check the result of GetMyHostName() directly, since the result
875 // will differ across machines. Our goal here is to simply exercise the
876 // code path, and check that things "look about right".
877 std::string my_hostname = net::GetMyHostName();
878 EXPECT_FALSE(my_hostname.empty());
879 }
OLDNEW
« no previous file with comments | « net/base/net_util.cc ('k') | net/proxy/proxy_resolver_v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698