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

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

Issue 8429034: Upstream: Build net_unittests for Android. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: split out unreviewed files Created 9 years, 1 month 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/host_resolver_impl.cc ('k') | net/base/platform_mime_util_linux.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/net_util.h" 5 #include "net/base/net_util.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 1208
1209 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(safe_tests); ++i) { 1209 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(safe_tests); ++i) {
1210 FilePath file_path(safe_tests[i].filename); 1210 FilePath file_path(safe_tests[i].filename);
1211 GenerateSafeFileName(safe_tests[i].mime_type, false, &file_path); 1211 GenerateSafeFileName(safe_tests[i].mime_type, false, &file_path);
1212 EXPECT_EQ(safe_tests[i].expected_filename, file_path.value()) 1212 EXPECT_EQ(safe_tests[i].expected_filename, file_path.value())
1213 << "Iteration " << i; 1213 << "Iteration " << i;
1214 } 1214 }
1215 } 1215 }
1216 1216
1217 TEST(NetUtilTest, GenerateFileName) { 1217 TEST(NetUtilTest, GenerateFileName) {
1218 #if defined(OS_POSIX) && !defined(OS_MACOSX) 1218 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
1219 // This test doesn't run when the locale is not UTF-8 because some of the 1219 // This test doesn't run when the locale is not UTF-8 because some of the
1220 // string conversions fail. This is OK (we have the default value) but they 1220 // string conversions fail. This is OK (we have the default value) but they
1221 // don't match our expectations. 1221 // don't match our expectations.
1222 std::string locale = setlocale(LC_CTYPE, NULL); 1222 std::string locale = setlocale(LC_CTYPE, NULL);
1223 StringToLowerASCII(&locale); 1223 StringToLowerASCII(&locale);
1224 EXPECT_TRUE(locale.find("utf-8") != std::string::npos || 1224 EXPECT_TRUE(locale.find("utf-8") != std::string::npos ||
1225 locale.find("utf8") != std::string::npos) 1225 locale.find("utf8") != std::string::npos)
1226 << "Your locale (" << locale << ") must be set to UTF-8 " 1226 << "Your locale (" << locale << ") must be set to UTF-8 "
1227 << "for this test to pass!"; 1227 << "for this test to pass!";
1228 #endif 1228 #endif
(...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after
3435 if (it->address[i] != 0) { 3435 if (it->address[i] != 0) {
3436 all_zeroes = false; 3436 all_zeroes = false;
3437 break; 3437 break;
3438 } 3438 }
3439 } 3439 }
3440 EXPECT_FALSE(all_zeroes); 3440 EXPECT_FALSE(all_zeroes);
3441 } 3441 }
3442 } 3442 }
3443 3443
3444 } // namespace net 3444 } // namespace net
OLDNEW
« no previous file with comments | « net/base/host_resolver_impl.cc ('k') | net/base/platform_mime_util_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698