summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-15 16:39:31 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-15 16:39:31 +0000
commit6e66e46982f98d7351b2e2a804e71d76fbaa1053 (patch)
treee964afef5cb4118112d7db60e5275aa8f86dad02 /chrome/common
parent3f96abd259a9b719df4122ced56cd276501417ee (diff)
downloadchromium_src-6e66e46982f98d7351b2e2a804e71d76fbaa1053.zip
chromium_src-6e66e46982f98d7351b2e2a804e71d76fbaa1053.tar.gz
chromium_src-6e66e46982f98d7351b2e2a804e71d76fbaa1053.tar.bz2
Platform cleanup in common/ and even porting few files and unit tests.
Review URL: http://codereview.chromium.org/14420 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/common.scons4
-rw-r--r--chrome/common/pref_service_unittest.cc34
2 files changed, 10 insertions, 28 deletions
diff --git a/chrome/common/common.scons b/chrome/common/common.scons
index c7fc7f6..371d2df4 100644
--- a/chrome/common/common.scons
+++ b/chrome/common/common.scons
@@ -49,11 +49,13 @@ if env['PLATFORM'] in ('posix', 'win32'):
'chrome_counters.cc',
'chrome_paths.cc',
'chrome_switches.cc',
+ 'common_glue.cc',
'debug_flags.cc',
'env_vars.cc',
'gfx/chrome_canvas.cc',
'gfx/color_utils.cc',
'ipc_message.cc',
+ 'ipc_message_utils.cc',
'jpeg_codec.cc',
'json_value_serializer.cc',
'libxml_utils.cc',
@@ -83,7 +85,6 @@ if env['PLATFORM'] == 'win32':
'chrome_plugin_util.cc',
'chrome_process_filter.cc',
'classfactory.cc',
- 'common_glue.cc',
'drag_drop_types.cc',
'gfx/chrome_canvas_win.cc',
'gfx/emf.cc',
@@ -92,7 +93,6 @@ if env['PLATFORM'] == 'win32':
'gfx/text_elider.cc',
'ipc_channel_proxy.cc',
'ipc_logging.cc',
- 'ipc_message_utils.cc',
'ipc_sync_channel.cc',
'ipc_sync_message.cc',
'jstemplate_builder.cc',
diff --git a/chrome/common/pref_service_unittest.cc b/chrome/common/pref_service_unittest.cc
index 6c63756..2baa908 100644
--- a/chrome/common/pref_service_unittest.cc
+++ b/chrome/common/pref_service_unittest.cc
@@ -24,7 +24,7 @@ protected:
// Create a fresh, empty copy of this directory.
file_util::Delete(test_dir_, true);
- CreateDirectory(test_dir_.c_str(), NULL);
+ file_util::CreateDirectory(test_dir_);
ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &data_dir_));
file_util::AppendToPath(&data_dir_, L"pref_service");
@@ -167,33 +167,15 @@ TEST_F(PrefServiceTest, Overlay) {
prefs.transient()->Set(L"both", both_transient_value);
// Register test prefs
- const wchar_t* kTypes[] =
+ static const std::wstring kTypes[] =
{ L"neither.", L"persistent.", L"transient.", L"both." };
for (size_t i = 0; i < arraysize(kTypes); ++i) {
- wchar_t temp[1024];
- wcscpy_s(temp, kTypes[i]);
- wcscat_s(temp, L"bool");
- prefs.RegisterBooleanPref(temp, false);
-
- wcscpy_s(temp, kTypes[i]);
- wcscat_s(temp, L"int");
- prefs.RegisterIntegerPref(temp, 0);
-
- wcscpy_s(temp, kTypes[i]);
- wcscat_s(temp, L"real");
- prefs.RegisterRealPref(temp, 0.0);
-
- wcscpy_s(temp, kTypes[i]);
- wcscat_s(temp, L"string");
- prefs.RegisterStringPref(temp, L"");
-
- wcscpy_s(temp, kTypes[i]);
- wcscat_s(temp, L"list");
- prefs.RegisterListPref(temp);
-
- wcscpy_s(temp, kTypes[i]);
- wcscat_s(temp, L"dictionary");
- prefs.RegisterDictionaryPref(temp);
+ prefs.RegisterBooleanPref((kTypes[i] + L"bool").c_str(), false);
+ prefs.RegisterIntegerPref((kTypes[i] + L"int").c_str(), 0);
+ prefs.RegisterRealPref((kTypes[i] + L"real").c_str(), 0.0);
+ prefs.RegisterStringPref((kTypes[i] + L"string").c_str(), L"");
+ prefs.RegisterListPref((kTypes[i] + L"list").c_str());
+ prefs.RegisterDictionaryPref((kTypes[i] + L"dictionary").c_str());
}
ASSERT_FALSE(prefs.GetBoolean(L"neither.bool"));