summaryrefslogtreecommitdiffstats
path: root/net/url_request
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-27 04:03:57 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-27 04:03:57 +0000
commitb9e04f0654a99b6bb0b626df14e15ec4f9a8bf9d (patch)
tree3b738efc6107e6ea501790f0a8ba26c7d041ed3d /net/url_request
parentf6c1f2470b243628a36981efae7c3a6ce3914a92 (diff)
downloadchromium_src-b9e04f0654a99b6bb0b626df14e15ec4f9a8bf9d.zip
chromium_src-b9e04f0654a99b6bb0b626df14e15ec4f9a8bf9d.tar.gz
chromium_src-b9e04f0654a99b6bb0b626df14e15ec4f9a8bf9d.tar.bz2
Remove file_util::kPathSeparator from posix.
Review URL: http://codereview.chromium.org/12489 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r--net/url_request/url_request_unittest.cc10
-rw-r--r--net/url_request/url_request_unittest.h4
2 files changed, 6 insertions, 8 deletions
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 05686e6..8de9dce 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -395,17 +395,13 @@ TEST_F(URLRequestTest, AboutBlankTest) {
}
TEST_F(URLRequestTest, FileTest) {
- std::wstring app_path;
+ FilePath app_path;
PathService::Get(base::FILE_EXE, &app_path);
-
- std::string app_url = WideToUTF8(app_path);
- std::replace(app_url.begin(), app_url.end(),
- file_util::kPathSeparator, L'/');
- app_url.insert(0, "file:///");
+ GURL app_url = net::FilePathToFileURL(app_path.ToWStringHack());
TestDelegate d;
{
- TestURLRequest r(GURL(app_url), &d);
+ TestURLRequest r(app_url, &d);
r.Start();
EXPECT_TRUE(r.is_pending());
diff --git a/net/url_request/url_request_unittest.h b/net/url_request/url_request_unittest.h
index 624fb6f..c0c62a3 100644
--- a/net/url_request/url_request_unittest.h
+++ b/net/url_request/url_request_unittest.h
@@ -279,9 +279,11 @@ class TestServer : public base::ProcessFilter {
std::wstring test_data_directory;
PathService::Get(base::DIR_SOURCE_ROOT, &test_data_directory);
std::wstring normalized_document_root = document_root;
+#if defined(OS_WIN)
std::replace(normalized_document_root.begin(),
normalized_document_root.end(),
- L'/', file_util::kPathSeparator);
+ L'/', FilePath::kSeparators[0]);
+#endif
file_util::AppendToPath(&test_data_directory, normalized_document_root);
#if defined(OS_WIN)