From b9636005dd6f235dfb4fa4ea3a83df284341667d Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Wed, 4 Mar 2009 00:05:25 +0000 Subject: Add FilePath setter/getter to pref service. Change callers to use it rather than the string methods. Update the pref service unit test and enable it on linux. Also switch over some wstrings to filepaths where appropriate. BUG=8154 Review URL: http://codereview.chromium.org/27354 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10844 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/test/data/pref_service/read.json | 3 ++- chrome/test/data/pref_service/write.golden.json | 1 + chrome/test/reliability/page_load_test.cc | 4 ++-- chrome/test/testing_profile.h | 2 +- chrome/test/unit/unit_tests.scons | 1 - 5 files changed, 6 insertions(+), 5 deletions(-) (limited to 'chrome/test') diff --git a/chrome/test/data/pref_service/read.json b/chrome/test/data/pref_service/read.json index 0225f17..ea578a4 100644 --- a/chrome/test/data/pref_service/read.json +++ b/chrome/test/data/pref_service/read.json @@ -1,7 +1,8 @@ { "homepage": "http://www.cnn.com", + "some_directory": "/usr/local/", "tabs": { "new_windows_in_tabs": true, "max_tabs": 20 } -} \ No newline at end of file +} diff --git a/chrome/test/data/pref_service/write.golden.json b/chrome/test/data/pref_service/write.golden.json index 116775b..362e32d 100644 --- a/chrome/test/data/pref_service/write.golden.json +++ b/chrome/test/data/pref_service/write.golden.json @@ -1,5 +1,6 @@ { "homepage": "http://www.cnn.com", + "some_directory": "/usr/sbin/", "tabs": { "max_tabs": 10, "new_windows_in_tabs": false diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index 2ee9470..32a234c 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -479,8 +479,8 @@ class PageLoadTest : public UITest { // that was saved by the app as it closed. The caller takes ownership of the // returned PrefService object. PrefService* GetLocalState() { - std::wstring local_state_path = user_data_dir(); - file_util::AppendToPath(&local_state_path, chrome::kLocalStateFilename); + FilePath local_state_path = FilePath::FromWStringHack(user_data_dir()) + .Append(chrome::kLocalStateFilename); PrefService* local_state(new PrefService(local_state_path)); return local_state; diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h index 4601173..ea78459 100644 --- a/chrome/test/testing_profile.h +++ b/chrome/test/testing_profile.h @@ -102,7 +102,7 @@ class TestingProfile : public Profile { prefs_filename = prefs_filename.Append(FILE_PATH_LITERAL("TestPreferences")); if (!prefs_.get()) { - prefs_.reset(new PrefService(prefs_filename.ToWStringHack())); + prefs_.reset(new PrefService(prefs_filename)); Profile::RegisterUserPrefs(prefs_.get()); browser::RegisterAllPrefs(prefs_.get(), prefs_.get()); } diff --git a/chrome/test/unit/unit_tests.scons b/chrome/test/unit/unit_tests.scons index 7da5419..ab490fd 100644 --- a/chrome/test/unit/unit_tests.scons +++ b/chrome/test/unit/unit_tests.scons @@ -429,7 +429,6 @@ if not env.Bit('windows'): '$CHROME_DIR/common/gfx/emf_unittest.cc', '$CHROME_DIR/common/gfx/icon_util_unittest.cc', '$CHROME_DIR/common/os_exchange_data_unittest.cc', - '$CHROME_DIR/common/pref_service_unittest.cc', '$CHROME_DIR/common/time_format_unittest.cc', '$CHROME_DIR/common/win_util_unittest.cc', '$CHROME_DIR/test/browser_with_test_window_test.cc', -- cgit v1.1