From 047a03f4cefa75a67070f08b3f6b727f7ea702d5 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Wed, 7 Oct 2009 02:10:20 +0000 Subject: Copy the relevant parts of ICU to a new file base/third_party/icu/icu_utf.* so we can do basic UTF8/16/32 conversions without linking all of ICU. Change callers who used to call SysUTF8ToWide/SysWideToUTF8 in base to using these new functions. I will remove the Sys versions of these functions in a later patch. TEST=none BUG=none Review URL: http://codereview.chromium.org/243102 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28219 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/download/download_manager_unittest.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'chrome/browser/download') diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc index 164c92b..a5058cf 100644 --- a/chrome/browser/download/download_manager_unittest.cc +++ b/chrome/browser/download/download_manager_unittest.cc @@ -1,13 +1,19 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include +#include "base/string_util.h" +#include "build/build_config.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_util.h" #include "testing/gtest/include/gtest/gtest.h" +#if defined(OS_LINUX) +#include +#endif + class DownloadManagerTest : public testing::Test { public: DownloadManagerTest() { @@ -455,6 +461,16 @@ const struct { // Tests to ensure that the file names we generate from hints from the server // (content-disposition, URL name, etc) don't cause security holes. TEST_F(DownloadManagerTest, TestDownloadFilename) { +#if defined(OS_LINUX) + // This test doesn't run when the locale is not UTF-8 becuase some of the + // string conversions fail. This is OK (we have the default value) but they + // don't match our expectations. + std::string locale = setlocale(LC_CTYPE, NULL); + StringToLowerASCII(&locale); + ASSERT_NE(std::string::npos, locale.find("utf-8")) + << "Your locale must be set to UTF-8 for this test to pass!"; +#endif + std::wstring file_name; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(kGeneratedFiles); ++i) { GetGeneratedFilename(kGeneratedFiles[i].disposition, -- cgit v1.1