diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 17:50:31 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-04 17:50:31 +0000 |
commit | b647e0b22430373766687242da51ee1453a19558 (patch) | |
tree | f6f67aa96441563d779d3bea9b84ceede26812c5 /chrome/browser/search_engines | |
parent | 4c70b7a559f7188a2820b38e6dad2758a310b55c (diff) | |
download | chromium_src-b647e0b22430373766687242da51ee1453a19558.zip chromium_src-b647e0b22430373766687242da51ee1453a19558.tar.gz chromium_src-b647e0b22430373766687242da51ee1453a19558.tar.bz2 |
Deprecate wstring version of PathService::Get() in unit tests.
Review URL: http://codereview.chromium.org/100292
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15221 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r-- | chrome/browser/search_engines/template_url_model_unittest.cc | 9 | ||||
-rw-r--r-- | chrome/browser/search_engines/template_url_parser_unittest.cc | 13 |
2 files changed, 10 insertions, 12 deletions
diff --git a/chrome/browser/search_engines/template_url_model_unittest.cc b/chrome/browser/search_engines/template_url_model_unittest.cc index 8c0ea36..4a4bace 100644 --- a/chrome/browser/search_engines/template_url_model_unittest.cc +++ b/chrome/browser/search_engines/template_url_model_unittest.cc @@ -39,16 +39,15 @@ class TemplateURLModelTestingProfile : public TestingProfile { void SetUp() { // Name a subdirectory of the temp directory. ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &test_dir_)); - file_util::AppendToPath(&test_dir_, L"TemplateURLModelTest"); + test_dir_ = test_dir_.AppendASCII("TemplateURLModelTest"); // Create a fresh, empty copy of this directory. file_util::Delete(test_dir_, true); file_util::CreateDirectory(test_dir_); - std::wstring path = test_dir_; - file_util::AppendToPath(&path, L"TestDataService.db"); + FilePath path = test_dir_.AppendASCII("TestDataService.db"); service_ = new WebDataService; - EXPECT_TRUE(service_->InitWithPath(FilePath::FromWStringHack(path))); + EXPECT_TRUE(service_->InitWithPath(path)); } void TearDown() { @@ -64,7 +63,7 @@ class TemplateURLModelTestingProfile : public TestingProfile { private: scoped_refptr<WebDataService> service_; - std::wstring test_dir_; + FilePath test_dir_; }; // Trivial subclass of TemplateURLModel that records the last invocation of diff --git a/chrome/browser/search_engines/template_url_parser_unittest.cc b/chrome/browser/search_engines/template_url_parser_unittest.cc index bac35c4..77c794c 100644 --- a/chrome/browser/search_engines/template_url_parser_unittest.cc +++ b/chrome/browser/search_engines/template_url_parser_unittest.cc @@ -17,11 +17,11 @@ class TemplateURLParserTest : public testing::Test { virtual void SetUp() { ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &full_path_)); - file_util::AppendToPath(&full_path_, L"osdd"); + full_path_ = full_path_.AppendASCII("osdd"); if (!file_util::PathExists(full_path_)) { LOG(ERROR) << L"This test can't be run without some non-redistributable data"; - full_path_.clear(); + full_path_ = FilePath(); } } @@ -35,12 +35,11 @@ class TemplateURLParserTest : public testing::Test { // use a return value due to internally using ASSERT_). void ParseFile(const std::wstring& file_name, TemplateURLParser::ParameterFilter* filter) { - std::wstring full_path(full_path_); - file_util::AppendToPath(&full_path, file_name); + FilePath full_path; parse_result_ = false; ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &full_path)); - file_util::AppendToPath(&full_path, L"osdd"); - file_util::AppendToPath(&full_path, file_name); + full_path = full_path.AppendASCII("osdd"); + full_path = full_path.Append(FilePath::FromWStringHack(file_name)); ASSERT_TRUE(file_util::PathExists(full_path)); std::string contents; @@ -53,7 +52,7 @@ class TemplateURLParserTest : public testing::Test { // ParseFile parses the results into this template_url. TemplateURL template_url_; - std::wstring full_path_; + FilePath full_path_; // Result of the parse. bool parse_result_; |