From 5e183ded3525704427b862268f08439543bf6aa5 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Mon, 24 Jan 2011 21:36:12 +0000 Subject: wstring: make net::GetSuggestedFilename return utf-16 We should only use FilePath when working with real paths on disk. Note: I made a minor semantic change to downloads -- we no longer preserve backslashes in server-suggested paths on non-Windows. I think the previous behavior is crazy but from looking at the blame I'm the one who wrote it originally, so I don't feel bad about changing my mind. BUG=69467 TEST=existing test still passes Review URL: http://codereview.chromium.org/6241001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72390 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/net_util_unittest.cc | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'net/base/net_util_unittest.cc') diff --git a/net/base/net_util_unittest.cc b/net/base/net_util_unittest.cc index 77d3a00..bf51f1c 100644 --- a/net/base/net_util_unittest.cc +++ b/net/base/net_util_unittest.cc @@ -1214,21 +1214,12 @@ TEST(NetUtilTest, GetSuggestedFilename) { #endif }; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_cases); ++i) { -#if defined(OS_WIN) - FilePath default_name(test_cases[i].default_filename); -#else - FilePath default_name( - base::SysWideToNativeMB(test_cases[i].default_filename)); -#endif - FilePath filename = net::GetSuggestedFilename( + std::wstring default_name = test_cases[i].default_filename; + string16 filename = net::GetSuggestedFilename( GURL(test_cases[i].url), test_cases[i].content_disp_header, - test_cases[i].referrer_charset, default_name); -#if defined(OS_WIN) - EXPECT_EQ(std::wstring(test_cases[i].expected_filename), filename.value()) -#else - EXPECT_EQ(base::SysWideToNativeMB(test_cases[i].expected_filename), - filename.value()) -#endif + test_cases[i].referrer_charset, WideToUTF16(default_name)); + EXPECT_EQ(std::wstring(test_cases[i].expected_filename), + UTF16ToWide(filename)) << "Iteration " << i << ": " << test_cases[i].url; } } -- cgit v1.1