diff options
-rw-r--r-- | net/base/bzip2_filter_unittest.cc | 10 | ||||
-rw-r--r-- | net/base/gzip_filter_unittest.cc | 10 | ||||
-rw-r--r-- | net/disk_cache/backend_unittest.cc | 12 | ||||
-rw-r--r-- | net/disk_cache/disk_cache_test_util.cc | 6 | ||||
-rw-r--r-- | net/disk_cache/stress_cache.cc | 5 | ||||
-rw-r--r-- | net/http/http_auth_handler_ntlm.cc | 3 | ||||
-rw-r--r-- | net/tools/crash_cache/crash_cache.cc | 16 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.cc | 39 |
8 files changed, 52 insertions, 49 deletions
diff --git a/net/base/bzip2_filter_unittest.cc b/net/base/bzip2_filter_unittest.cc index fdc56e9..a7023c1 100644 --- a/net/base/bzip2_filter_unittest.cc +++ b/net/base/bzip2_filter_unittest.cc @@ -34,12 +34,12 @@ class BZip2FilterUnitTest : public PlatformTest { bzip2_encode_buffer_ = NULL; // Get the path of source data file. - std::wstring file_path; + FilePath file_path; PathService::Get(base::DIR_SOURCE_ROOT, &file_path); - file_util::AppendToPath(&file_path, L"net"); - file_util::AppendToPath(&file_path, L"data"); - file_util::AppendToPath(&file_path, L"filter_unittests"); - file_util::AppendToPath(&file_path, L"google.txt"); + file_path = file_path.AppendASCII("net"); + file_path = file_path.AppendASCII("data"); + file_path = file_path.AppendASCII("filter_unittests"); + file_path = file_path.AppendASCII("google.txt"); // Read data from the file into buffer. file_util::ReadFileToString(file_path, &source_buffer_); diff --git a/net/base/gzip_filter_unittest.cc b/net/base/gzip_filter_unittest.cc index 3501a96..74fbc2b 100644 --- a/net/base/gzip_filter_unittest.cc +++ b/net/base/gzip_filter_unittest.cc @@ -57,12 +57,12 @@ class GZipUnitTest : public PlatformTest { gzip_encode_buffer_ = NULL; // Get the path of source data file. - std::wstring file_path; + FilePath file_path; PathService::Get(base::DIR_SOURCE_ROOT, &file_path); - file_util::AppendToPath(&file_path, L"net"); - file_util::AppendToPath(&file_path, L"data"); - file_util::AppendToPath(&file_path, L"filter_unittests"); - file_util::AppendToPath(&file_path, L"google.txt"); + file_path = file_path.AppendASCII("net"); + file_path = file_path.AppendASCII("data"); + file_path = file_path.AppendASCII("filter_unittests"); + file_path = file_path.AppendASCII("google.txt"); // Read data from the file into buffer. file_util::ReadFileToString(file_path, &source_buffer_); diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc index 1722ad5..dd33d28 100644 --- a/net/disk_cache/backend_unittest.cc +++ b/net/disk_cache/backend_unittest.cc @@ -21,17 +21,17 @@ namespace { // Copies a set of cache files from the data folder to the test folder. bool CopyTestCache(const std::wstring& name) { - std::wstring path; + FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); - file_util::AppendToPath(&path, L"net"); - file_util::AppendToPath(&path, L"data"); - file_util::AppendToPath(&path, L"cache_tests"); - file_util::AppendToPath(&path, name); + path = path.AppendASCII("net"); + path = path.AppendASCII("data"); + path = path.AppendASCII("cache_tests"); + path = path.Append(FilePath::FromWStringHack(name)); std::wstring dest = GetCachePath(); if (!DeleteCache(dest.c_str())) return false; - return file_util::CopyDirectory(path, dest, false); + return file_util::CopyDirectory(path, FilePath::FromWStringHack(dest), false); } } // namespace diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc index 013c27a..99c4500 100644 --- a/net/disk_cache/disk_cache_test_util.cc +++ b/net/disk_cache/disk_cache_test_util.cc @@ -17,13 +17,13 @@ using base::TimeDelta; namespace { std::wstring BuildCachePath(const std::wstring& name) { - std::wstring path; + FilePath path; PathService::Get(base::DIR_TEMP, &path); - file_util::AppendToPath(&path, name); + path = path.Append(FilePath::FromWStringHack(name)); if (!file_util::PathExists(path)) file_util::CreateDirectory(path); - return path; + return path.ToWStringHack(); } } // namespace. diff --git a/net/disk_cache/stress_cache.cc b/net/disk_cache/stress_cache.cc index bf12d30..b2b60e4 100644 --- a/net/disk_cache/stress_cache.cc +++ b/net/disk_cache/stress_cache.cc @@ -16,6 +16,7 @@ #include "base/at_exit.h" #include "base/command_line.h" #include "base/debug_util.h" +#include "base/file_path.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/path_service.h" @@ -34,10 +35,10 @@ const int kExpectedCrash = 100; // Starts a new process. int RunSlave(int iteration) { - std::wstring exe; + FilePath exe; PathService::Get(base::FILE_EXE, &exe); - CommandLine cmdline(exe); + CommandLine cmdline(exe.ToWStringHack()); cmdline.AppendLooseValue(ASCIIToWide(IntToString(iteration))); base::ProcessHandle handle; diff --git a/net/http/http_auth_handler_ntlm.cc b/net/http/http_auth_handler_ntlm.cc index 1554534..951a5a5 100644 --- a/net/http/http_auth_handler_ntlm.cc +++ b/net/http/http_auth_handler_ntlm.cc @@ -70,7 +70,8 @@ namespace net { * ***** END LICENSE BLOCK ***** */ // Discover the endianness by testing processor architecture. -#if defined(ARCH_CPU_X86) || defined(ARCH_CPU_X86_64) +#if defined(ARCH_CPU_X86) || defined(ARCH_CPU_X86_64) || \ + defined(ARCH_CPU_ARM_FAMILY) #define IS_LITTLE_ENDIAN 1 #undef IS_BIG_ENDIAN #else diff --git a/net/tools/crash_cache/crash_cache.cc b/net/tools/crash_cache/crash_cache.cc index 34cff08..5272e17 100644 --- a/net/tools/crash_cache/crash_cache.cc +++ b/net/tools/crash_cache/crash_cache.cc @@ -37,10 +37,10 @@ using disk_cache::RankCrashes; // Starts a new process, to generate the files. int RunSlave(RankCrashes action) { - std::wstring exe; + FilePath exe; PathService::Get(base::FILE_EXE, &exe); - CommandLine cmdline(exe); + CommandLine cmdline(exe.ToWStringHack()); cmdline.AppendLooseValue(ASCIIToWide(IntToString(action))); base::ProcessHandle handle; @@ -300,12 +300,12 @@ int main(int argc, const char* argv[]) { return INVALID_ARGUMENT; } - std::wstring path; + FilePath path; PathService::Get(base::DIR_SOURCE_ROOT, &path); - file_util::AppendToPath(&path, L"net"); - file_util::AppendToPath(&path, L"data"); - file_util::AppendToPath(&path, L"cache_tests"); - file_util::AppendToPath(&path, L"new_crashes"); + path = path.AppendASCII("net"); + path = path.AppendASCII("data"); + path = path.AppendASCII("cache_tests"); + path = path.AppendASCII("new_crashes"); - return SlaveCode(path, action); + return SlaveCode(path.ToWStringHack(), action); } diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index eb67a94..6551df1 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -16,7 +16,7 @@ #include <algorithm> #include <string> -#include "base/file_path.h" +#include "base/file_util.h" #include "base/message_loop.h" #include "base/path_service.h" #include "base/process_util.h" @@ -539,7 +539,7 @@ TEST_F(URLRequestTest, PostFileTest) { TestURLRequest r(server->TestServerPage("echo"), &d); r.set_method("POST"); - std::wstring dir; + FilePath dir; PathService::Get(base::DIR_EXE, &dir); file_util::SetCurrentDirectory(dir); @@ -861,14 +861,14 @@ TEST_F(URLRequestTest, BZip2ContentTest_IncrementalHeader) { #if defined(OS_WIN) TEST_F(URLRequestTest, ResolveShortcutTest) { - std::wstring app_path; + FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); - file_util::AppendToPath(&app_path, L"net"); - file_util::AppendToPath(&app_path, L"data"); - file_util::AppendToPath(&app_path, L"url_request_unittest"); - file_util::AppendToPath(&app_path, L"with-headers.html"); + app_path = app_path.AppendASCII("net"); + app_path = app_path.AppendASCII("data"); + app_path = app_path.AppendASCII("url_request_unittest"); + app_path = app_path.AppendASCII("with-headers.html"); - std::wstring lnk_path = app_path + L".lnk"; + std::wstring lnk_path = app_path.value() + L".lnk"; HRESULT result; IShellLink *shell = NULL; @@ -883,7 +883,7 @@ TEST_F(URLRequestTest, ResolveShortcutTest) { result = shell->QueryInterface(IID_IPersistFile, reinterpret_cast<LPVOID*>(&persist)); EXPECT_TRUE(SUCCEEDED(result)); - result = shell->SetPath(app_path.c_str()); + result = shell->SetPath(app_path.value().c_str()); EXPECT_TRUE(SUCCEEDED(result)); result = shell->SetDescription(L"ResolveShortcutTest"); EXPECT_TRUE(SUCCEEDED(result)); @@ -904,8 +904,9 @@ TEST_F(URLRequestTest, ResolveShortcutTest) { MessageLoop::current()->Run(); WIN32_FILE_ATTRIBUTE_DATA data; - GetFileAttributesEx(app_path.c_str(), GetFileExInfoStandard, &data); - HANDLE file = CreateFile(app_path.c_str(), GENERIC_READ, + GetFileAttributesEx(app_path.value().c_str(), + GetFileExInfoStandard, &data); + HANDLE file = CreateFile(app_path.value().c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); EXPECT_NE(INVALID_HANDLE_VALUE, file); @@ -1707,9 +1708,9 @@ TEST_F(URLRequestTest, InterceptRespectsCancelInRestart) { TEST_F(URLRequestTest, MAYBE_FTPGetTestAnonymous) { scoped_refptr<FTPTestServer> server = FTPTestServer::CreateServer(L""); ASSERT_TRUE(NULL != server.get()); - std::wstring app_path; + FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); - app_path.append(L"\\LICENSE"); + app_path = app_path.AppendASCII("LICENSE"); TestDelegate d; { TestURLRequest r(server->TestServerPage("/LICENSE"), &d); @@ -1732,9 +1733,9 @@ TEST_F(URLRequestTest, MAYBE_FTPGetTest) { scoped_refptr<FTPTestServer> server = FTPTestServer::CreateServer(L"", "chrome", "chrome"); ASSERT_TRUE(NULL != server.get()); - std::wstring app_path; + FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); - app_path.append(L"\\LICENSE"); + app_path = app_path.AppendASCII("LICENSE"); TestDelegate d; { TestURLRequest r(server->TestServerPage("/LICENSE"), &d); @@ -1757,9 +1758,9 @@ TEST_F(URLRequestTest, MAYBE_FTPCheckWrongPassword) { scoped_refptr<FTPTestServer> server = FTPTestServer::CreateServer(L"", "chrome", "wrong_password"); ASSERT_TRUE(NULL != server.get()); - std::wstring app_path; + FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); - app_path.append(L"\\LICENSE"); + app_path = app_path.AppendASCII("LICENSE"); TestDelegate d; { TestURLRequest r(server->TestServerPage("/LICENSE"), &d); @@ -1782,9 +1783,9 @@ TEST_F(URLRequestTest, MAYBE_FTPCheckWrongUser) { scoped_refptr<FTPTestServer> server = FTPTestServer::CreateServer(L"", "wrong_user", "chrome"); ASSERT_TRUE(NULL != server.get()); - std::wstring app_path; + FilePath app_path; PathService::Get(base::DIR_SOURCE_ROOT, &app_path); - app_path.append(L"\\LICENSE"); + app_path = app_path.AppendASCII("LICENSE"); TestDelegate d; { TestURLRequest r(server->TestServerPage("/LICENSE"), &d); |