diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-15 16:39:31 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-15 16:39:31 +0000 |
commit | 6e66e46982f98d7351b2e2a804e71d76fbaa1053 (patch) | |
tree | e964afef5cb4118112d7db60e5275aa8f86dad02 /chrome | |
parent | 3f96abd259a9b719df4122ced56cd276501417ee (diff) | |
download | chromium_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')
-rw-r--r-- | chrome/common/common.scons | 4 | ||||
-rw-r--r-- | chrome/common/pref_service_unittest.cc | 34 | ||||
-rw-r--r-- | chrome/plugin/npobject_util.h | 6 | ||||
-rw-r--r-- | chrome/test/unit/unit_tests.scons | 8 |
4 files changed, 20 insertions, 32 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")); diff --git a/chrome/plugin/npobject_util.h b/chrome/plugin/npobject_util.h index 6de7ccc..cc9347e 100644 --- a/chrome/plugin/npobject_util.h +++ b/chrome/plugin/npobject_util.h @@ -7,7 +7,11 @@ #ifndef CHROME_PLUGIN_NPOBJECT_UTIL_H__ #define CHROME_PLUGIN_NPOBJECT_UTIL_H__ +#include "build/build_config.h" + +#if defined(OS_WIN) #include <windows.h> +#endif #include "chrome/plugin/npobject_stub.h" struct _NPVariant; @@ -43,6 +47,7 @@ void CreateNPVariantParam(const NPVariant& variant, NPVariant_Param* param, bool release); +#if defined(OS_WIN) // Creates an NPVariant from the marshalled object. void CreateNPVariant(const NPVariant_Param& param, PluginChannelBase* channel, @@ -55,6 +60,7 @@ void CreateNPVariant(const NPVariant_Param& param, // in-process). This avoids deadlocks when a plugin invokes javascript that // causes a message box to come up. HANDLE GetMessageBoxEvent(HWND hwnd); +#endif // defined(OS_WIN) #endif // CHROME_PLUGIN_NPOBJECT_UTIL_H__ diff --git a/chrome/test/unit/unit_tests.scons b/chrome/test/unit/unit_tests.scons index 6d53901..bac856b 100644 --- a/chrome/test/unit/unit_tests.scons +++ b/chrome/test/unit/unit_tests.scons @@ -134,8 +134,12 @@ if env['PLATFORM'] in ('posix', 'win32'): '$CHROME_DIR/common/animation_unittest.cc', '$CHROME_DIR/common/bzip2_unittest.cc', '$CHROME_DIR/common/gfx/chrome_font_unittest.cc', + '$CHROME_DIR/common/ipc_message_unittest.cc', '$CHROME_DIR/common/jpeg_codec_unittest.cc', '$CHROME_DIR/common/json_value_serializer_unittest.cc', + '$CHROME_DIR/common/mru_cache_unittest.cc', + '$CHROME_DIR/common/notification_service_unittest.cc', + '$CHROME_DIR/common/property_bag_unittest.cc', ]) if env['PLATFORM'] == 'win32': @@ -209,13 +213,9 @@ if env['PLATFORM'] == 'win32': '$CHROME_DIR/common/gfx/emf_unittest.cc', '$CHROME_DIR/common/gfx/icon_util_unittest.cc', '$CHROME_DIR/common/gfx/text_elider_unittest.cc', - '$CHROME_DIR/common/ipc_message_unittest.cc', '$CHROME_DIR/common/ipc_sync_channel_unittest.cc', '$CHROME_DIR/common/ipc_sync_message_unittest.cc', '$CHROME_DIR/common/l10n_util_unittest.cc', - '$CHROME_DIR/common/mru_cache_unittest.cc', - '$CHROME_DIR/common/notification_service_unittest.cc', - '$CHROME_DIR/common/property_bag_unittest.cc', '$CHROME_DIR/common/os_exchange_data_unittest.cc', '$CHROME_DIR/common/pref_member_unittest.cc', '$CHROME_DIR/common/pref_service_unittest.cc', |