summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-28 21:54:32 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-28 21:54:32 +0000
commitf7011fcb7f28651953b1765b241c974e25c8cd40 (patch)
treef3a2c97bb98cc12aaca39bb27791998f026b58b7 /chrome/test
parent4663213354a9c41ab0e5a785d52bf5c9a9692514 (diff)
downloadchromium_src-f7011fcb7f28651953b1765b241c974e25c8cd40.zip
chromium_src-f7011fcb7f28651953b1765b241c974e25c8cd40.tar.gz
chromium_src-f7011fcb7f28651953b1765b241c974e25c8cd40.tar.bz2
Porting profiles to the Mac.
Review URL: http://codereview.chromium.org/19623 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/testing_profile.cc13
-rw-r--r--chrome/test/testing_profile.h4
-rw-r--r--chrome/test/unit/chrome_test_suite.h5
3 files changed, 13 insertions, 9 deletions
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
index 7a368dc..7e46932 100644
--- a/chrome/test/testing_profile.cc
+++ b/chrome/test/testing_profile.cc
@@ -50,7 +50,7 @@ TestingProfile::TestingProfile()
off_the_record_(false),
last_session_exited_cleanly_(true) {
PathService::Get(base::DIR_TEMP, &path_);
- file_util::AppendToPath(&path_, L"TestingProfilePath");
+ path_ = path_.Append(FILE_PATH_LITERAL("TestingProfilePath"));
file_util::Delete(path_, true);
file_util::CreateDirectory(path_);
}
@@ -61,7 +61,8 @@ TestingProfile::TestingProfile(int count)
off_the_record_(false),
last_session_exited_cleanly_(true) {
PathService::Get(base::DIR_TEMP, &path_);
- file_util::AppendToPath(&path_, L"TestingProfilePath" + IntToWString(count));
+ path_ = path_.Append(FILE_PATH_LITERAL("TestingProfilePath"));
+ path_ = path_.AppendASCII(IntToString(count));
file_util::Delete(path_, true);
file_util::CreateDirectory(path_);
}
@@ -78,8 +79,8 @@ void TestingProfile::CreateHistoryService(bool delete_file) {
history_service_ = NULL;
if (delete_file) {
- std::wstring path = GetPath();
- file_util::AppendToPath(&path, chrome::kHistoryFilename);
+ FilePath path = GetPath();
+ path = path.Append(chrome::kHistoryFilename);
file_util::Delete(path, false);
}
history_service_ = new HistoryService(this);
@@ -112,8 +113,8 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) {
bookmark_bar_model_.reset(NULL);
if (delete_file) {
- std::wstring path = GetPath();
- file_util::AppendToPath(&path, chrome::kBookmarksFileName);
+ FilePath path = GetPath();
+ path = path.Append(chrome::kBookmarksFileName);
file_util::Delete(path, false);
}
bookmark_bar_model_.reset(new BookmarkModel(this));
diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h
index adc6626..83f9167 100644
--- a/chrome/test/testing_profile.h
+++ b/chrome/test/testing_profile.h
@@ -48,7 +48,7 @@ class TestingProfile : public Profile {
// Creates a TemplateURLModel. If not invoked the TemplateURLModel is NULL.
void CreateTemplateURLModel();
- virtual std::wstring GetPath() {
+ virtual FilePath GetPath() {
return path_;
}
// Sets whether we're off the record. Default is false.
@@ -176,7 +176,7 @@ class TestingProfile : public Profile {
protected:
// The path of the profile; the various database and other files are relative
// to this.
- std::wstring path_;
+ FilePath path_;
base::Time start_time_;
scoped_ptr<PrefService> prefs_;
diff --git a/chrome/test/unit/chrome_test_suite.h b/chrome/test/unit/chrome_test_suite.h
index b2c196b..705960b 100644
--- a/chrome/test/unit/chrome_test_suite.h
+++ b/chrome/test/unit/chrome_test_suite.h
@@ -59,7 +59,10 @@ protected:
#endif
// initialize the global StatsTable for unit_tests
- stats_table_ = new StatsTable("unit_tests", 20, 200);
+ std::string statsfile = "unit_tests";
+ std::string pid_string = StringPrintf("-%d", base::GetCurrentProcId());
+ statsfile += pid_string;
+ stats_table_ = new StatsTable(statsfile, 20, 200);
StatsTable::set_current(stats_table_);
}