diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 20:00:34 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-03 20:00:34 +0000 |
commit | d338629d11ebad49ce3dc1d4715a1c12ffe5d9f9 (patch) | |
tree | 44fd8418854be1b78156c6d7c1878cb68d91b147 | |
parent | 1201b3a167a9cb73fcf43d0a3daa444e45a5278b (diff) | |
download | chromium_src-d338629d11ebad49ce3dc1d4715a1c12ffe5d9f9.zip chromium_src-d338629d11ebad49ce3dc1d4715a1c12ffe5d9f9.tar.gz chromium_src-d338629d11ebad49ce3dc1d4715a1c12ffe5d9f9.tar.bz2 |
linux: fix and build test plugins on 64-bit builds
We set -fPIC just on the layout test plugins and only in 64-bit mode.
This fixes 44 plugin layout tests on 64-bit.
BUG=18337,24271
Review URL: http://codereview.chromium.org/353022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30851 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/tools/npapi_layout_test_plugin/PluginObject.cpp | 10 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.gyp | 322 |
2 files changed, 162 insertions, 170 deletions
diff --git a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp index 2e671e6..f06e099 100644 --- a/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp +++ b/webkit/tools/npapi_layout_test_plugin/PluginObject.cpp @@ -501,14 +501,14 @@ static bool testGetIntIdentifier(PluginObject*, const NPVariant* args, uint32_t if (NPVARIANT_IS_DOUBLE(args[0])) { identifier = browser->getintidentifier((int)NPVARIANT_TO_DOUBLE(args[0])); - INT32_TO_NPVARIANT((int32)identifier, *result); - return true; } else if (NPVARIANT_IS_INT32(args[0])) { identifier = browser->getintidentifier((int)NPVARIANT_TO_INT32(args[0])); - INT32_TO_NPVARIANT((int32)identifier, *result); - return true; + } else { + return false; } - return false; + + INT32_TO_NPVARIANT(static_cast<int32>(reinterpret_cast<intptr_t>(identifier)), *result); + return true; } static bool testGetProperty(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result) diff --git a/webkit/tools/test_shell/test_shell.gyp b/webkit/tools/test_shell/test_shell.gyp index 3ce7b22..ec758cf 100644 --- a/webkit/tools/test_shell/test_shell.gyp +++ b/webkit/tools/test_shell/test_shell.gyp @@ -119,13 +119,6 @@ '../../api/WebKit.gyp:webkit', ], 'conditions': [ - # http://code.google.com/p/chromium/issues/detail?id=18337 - ['target_arch!="x64"', { - 'dependencies': [ - 'npapi_layout_test_plugin', - 'npapi_test_plugin', - ], - }], ['OS=="linux"', { 'dependencies': [ 'test_shell_resources', @@ -140,7 +133,7 @@ ['exclude', '_x11\\.cc$'], ], }], - ['OS=="linux" and target_arch!="x64"', { + ['OS=="linux"', { # See below TODO in the Windows branch. 'copies': [ { @@ -468,173 +461,172 @@ }], ], }, - ], - 'conditions': [ - # http://code.google.com/p/chromium/issues/detail?id=18337 - ['target_arch!="x64"', { - 'targets': [ - { - 'target_name': 'npapi_layout_test_plugin', - 'type': 'loadable_module', - 'mac_bundle': 1, - 'msvs_guid': 'BE6D5659-A8D5-4890-A42C-090DD10EF62C', - 'sources': [ - '../npapi_layout_test_plugin/PluginObject.cpp', - '../npapi_layout_test_plugin/TestObject.cpp', - '../npapi_layout_test_plugin/main.cpp', + { + 'target_name': 'npapi_layout_test_plugin', + 'type': 'loadable_module', + 'mac_bundle': 1, + 'msvs_guid': 'BE6D5659-A8D5-4890-A42C-090DD10EF62C', + 'sources': [ + '../npapi_layout_test_plugin/PluginObject.cpp', + '../npapi_layout_test_plugin/TestObject.cpp', + '../npapi_layout_test_plugin/main.cpp', + '../npapi_layout_test_plugin/npapi_layout_test_plugin.def', + '../npapi_layout_test_plugin/npapi_layout_test_plugin.rc', + ], + 'include_dirs': [ + '../../..', + ], + 'dependencies': [ + '../../../third_party/npapi/npapi.gyp:npapi', + '../../../third_party/WebKit/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf', + ], + 'msvs_disabled_warnings': [ 4996 ], + 'mac_bundle_resources': [ + '../npapi_layout_test_plugin/Info.r', + ], + 'xcode_settings': { + 'INFOPLIST_FILE': '../npapi_layout_test_plugin/Info.plist', + }, + 'conditions': [ + ['OS!="win"', { + 'sources!': [ '../npapi_layout_test_plugin/npapi_layout_test_plugin.def', '../npapi_layout_test_plugin/npapi_layout_test_plugin.rc', ], - 'include_dirs': [ - '../../..', - ], - 'dependencies': [ - '../../../third_party/npapi/npapi.gyp:npapi', - '../../../third_party/WebKit/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf', - ], - 'msvs_disabled_warnings': [ 4996 ], - 'mac_bundle_resources': [ - '../npapi_layout_test_plugin/Info.r', - ], - 'xcode_settings': { - 'INFOPLIST_FILE': '../npapi_layout_test_plugin/Info.plist', + # TODO(bradnelson): + # This copy should really live here, as a post-build step, + # but it's currently being implemented via + # AdditionalDependencies, which tries to do the copy before + # the file is built... + # + }, { # OS == "win" + # # The old VS build would explicitly copy the .dll into the + # # plugins subdirectory like this. It might be possible to + # # use the 'product_dir' setting to build directly into + # # plugins/ (as is done on Linux), but we'd need to verify + # # that nothing breaks first. + # 'copies': [ + # { + # 'destination': '<(PRODUCT_DIR)/plugins', + # 'files': ['<(PRODUCT_DIR)/npapi_layout_test_plugin.dll'], + # }, + # ], + 'link_settings': { + 'libraries': [ + "winmm.lib", + ], }, - 'conditions': [ - ['OS!="win"', { - 'sources!': [ - '../npapi_layout_test_plugin/npapi_layout_test_plugin.def', - '../npapi_layout_test_plugin/npapi_layout_test_plugin.rc', - ], - # TODO(bradnelson): - # This copy should really live here, as a post-build step, - # but it's currently being implemented via - # AdditionalDependencies, which tries to do the copy before - # the file is built... - # - }, { # OS == "win" - # # The old VS build would explicitly copy the .dll into the - # # plugins subdirectory like this. It might be possible to - # # use the 'product_dir' setting to build directly into - # # plugins/ (as is done on Linux), but we'd need to verify - # # that nothing breaks first. - # 'copies': [ - # { - # 'destination': '<(PRODUCT_DIR)/plugins', - # 'files': ['<(PRODUCT_DIR)/npapi_layout_test_plugin.dll'], - # }, - # ], - 'link_settings': { - 'libraries': [ - "winmm.lib", - ], - }, - }], - ['OS=="mac"', { - 'product_name': 'TestNetscapePlugIn', - 'product_extension': 'plugin', - 'link_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', - ], - }, - }], - ], - }, - { - 'target_name': 'npapi_test_plugin', - 'type': 'loadable_module', - 'mac_bundle': 1, - 'msvs_guid': '0D04AEC1-6B68-492C-BCCF-808DFD69ABC6', - 'dependencies': [ - '../../../base/base.gyp:base', - '../../../third_party/icu/icu.gyp:icuuc', - '../../../third_party/npapi/npapi.gyp:npapi', - ], - 'sources': [ - '../../glue/plugins/test/npapi_constants.cc', - '../../glue/plugins/test/npapi_constants.h', - '../../glue/plugins/test/npapi_test.cc', - '../../glue/plugins/test/npapi_test.def', - '../../glue/plugins/test/npapi_test.rc', - '../../glue/plugins/test/plugin_arguments_test.cc', - '../../glue/plugins/test/plugin_arguments_test.h', - '../../glue/plugins/test/plugin_client.cc', - '../../glue/plugins/test/plugin_client.h', - '../../glue/plugins/test/plugin_create_instance_in_paint.cc', - '../../glue/plugins/test/plugin_create_instance_in_paint.h', - '../../glue/plugins/test/plugin_delete_plugin_in_stream_test.cc', - '../../glue/plugins/test/plugin_delete_plugin_in_stream_test.h', - '../../glue/plugins/test/plugin_get_javascript_url_test.cc', - '../../glue/plugins/test/plugin_get_javascript_url_test.h', - '../../glue/plugins/test/plugin_get_javascript_url2_test.cc', - '../../glue/plugins/test/plugin_get_javascript_url2_test.h', - '../../glue/plugins/test/plugin_geturl_test.cc', - '../../glue/plugins/test/plugin_geturl_test.h', - '../../glue/plugins/test/plugin_javascript_open_popup.cc', - '../../glue/plugins/test/plugin_javascript_open_popup.h', - '../../glue/plugins/test/plugin_new_fails_test.cc', - '../../glue/plugins/test/plugin_new_fails_test.h', + }], + ['OS=="mac"', { + 'product_name': 'TestNetscapePlugIn', + 'product_extension': 'plugin', + 'link_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', + ], + }, + }], + ['OS=="linux" and target_arch=="x64"', { + # Shared libraries need -fPIC on x86-64 + 'cflags': ['-fPIC'] + }], + ], + }, + { + 'target_name': 'npapi_test_plugin', + 'type': 'loadable_module', + 'mac_bundle': 1, + 'msvs_guid': '0D04AEC1-6B68-492C-BCCF-808DFD69ABC6', + 'dependencies': [ + '../../../base/base.gyp:base', + '../../../third_party/icu/icu.gyp:icuuc', + '../../../third_party/npapi/npapi.gyp:npapi', + ], + 'sources': [ + '../../glue/plugins/test/npapi_constants.cc', + '../../glue/plugins/test/npapi_constants.h', + '../../glue/plugins/test/npapi_test.cc', + '../../glue/plugins/test/npapi_test.def', + '../../glue/plugins/test/npapi_test.rc', + '../../glue/plugins/test/plugin_arguments_test.cc', + '../../glue/plugins/test/plugin_arguments_test.h', + '../../glue/plugins/test/plugin_client.cc', + '../../glue/plugins/test/plugin_client.h', + '../../glue/plugins/test/plugin_create_instance_in_paint.cc', + '../../glue/plugins/test/plugin_create_instance_in_paint.h', + '../../glue/plugins/test/plugin_delete_plugin_in_stream_test.cc', + '../../glue/plugins/test/plugin_delete_plugin_in_stream_test.h', + '../../glue/plugins/test/plugin_get_javascript_url_test.cc', + '../../glue/plugins/test/plugin_get_javascript_url_test.h', + '../../glue/plugins/test/plugin_get_javascript_url2_test.cc', + '../../glue/plugins/test/plugin_get_javascript_url2_test.h', + '../../glue/plugins/test/plugin_geturl_test.cc', + '../../glue/plugins/test/plugin_geturl_test.h', + '../../glue/plugins/test/plugin_javascript_open_popup.cc', + '../../glue/plugins/test/plugin_javascript_open_popup.h', + '../../glue/plugins/test/plugin_new_fails_test.cc', + '../../glue/plugins/test/plugin_new_fails_test.h', + '../../glue/plugins/test/plugin_npobject_lifetime_test.cc', + '../../glue/plugins/test/plugin_npobject_lifetime_test.h', + '../../glue/plugins/test/plugin_npobject_proxy_test.cc', + '../../glue/plugins/test/plugin_npobject_proxy_test.h', + '../../glue/plugins/test/plugin_schedule_timer_test.cc', + '../../glue/plugins/test/plugin_schedule_timer_test.h', + '../../glue/plugins/test/plugin_thread_async_call_test.cc', + '../../glue/plugins/test/plugin_thread_async_call_test.h', + '../../glue/plugins/test/plugin_windowed_test.cc', + '../../glue/plugins/test/plugin_windowed_test.h', + '../../glue/plugins/test/plugin_private_test.cc', + '../../glue/plugins/test/plugin_private_test.h', + '../../glue/plugins/test/plugin_test.cc', + '../../glue/plugins/test/plugin_test.h', + '../../glue/plugins/test/plugin_window_size_test.cc', + '../../glue/plugins/test/plugin_window_size_test.h', + '../../glue/plugins/test/plugin_windowless_test.cc', + '../../glue/plugins/test/plugin_windowless_test.h', + '../../glue/plugins/test/resource.h', + ], + 'include_dirs': [ + '../../..', + ], + 'xcode_settings': { + 'INFOPLIST_FILE': '../../glue/plugins/test/Info.plist', + }, + 'conditions': [ + ['OS!="win"', { + 'sources!': [ + # TODO(port): Port these. + # plugin_npobject_lifetime_test.cc has win32-isms + # (HWND, CALLBACK). '../../glue/plugins/test/plugin_npobject_lifetime_test.cc', - '../../glue/plugins/test/plugin_npobject_lifetime_test.h', - '../../glue/plugins/test/plugin_npobject_proxy_test.cc', - '../../glue/plugins/test/plugin_npobject_proxy_test.h', - '../../glue/plugins/test/plugin_schedule_timer_test.cc', - '../../glue/plugins/test/plugin_schedule_timer_test.h', - '../../glue/plugins/test/plugin_thread_async_call_test.cc', - '../../glue/plugins/test/plugin_thread_async_call_test.h', - '../../glue/plugins/test/plugin_windowed_test.cc', - '../../glue/plugins/test/plugin_windowed_test.h', - '../../glue/plugins/test/plugin_private_test.cc', - '../../glue/plugins/test/plugin_private_test.h', - '../../glue/plugins/test/plugin_test.cc', - '../../glue/plugins/test/plugin_test.h', + # The windowed/windowless APIs are necessarily + # platform-specific. '../../glue/plugins/test/plugin_window_size_test.cc', - '../../glue/plugins/test/plugin_window_size_test.h', + '../../glue/plugins/test/plugin_windowed_test.cc', '../../glue/plugins/test/plugin_windowless_test.cc', - '../../glue/plugins/test/plugin_windowless_test.h', - '../../glue/plugins/test/resource.h', - ], - 'include_dirs': [ - '../../..', + # Seems windows specific. + '../../glue/plugins/test/plugin_create_instance_in_paint.cc', + '../../glue/plugins/test/plugin_create_instance_in_paint.h', + # windows-specific resources + '../../glue/plugins/test/npapi_test.def', + '../../glue/plugins/test/npapi_test.rc', ], - 'xcode_settings': { - 'INFOPLIST_FILE': '../../glue/plugins/test/Info.plist', + }], + ['OS=="mac"', { + 'link_settings': { + 'libraries': [ + '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', + ], }, - 'conditions': [ - ['OS!="win"', { - 'sources!': [ - # TODO(port): Port these. - - # plugin_npobject_lifetime_test.cc has win32-isms - # (HWND, CALLBACK). - '../../glue/plugins/test/plugin_npobject_lifetime_test.cc', - - # The windowed/windowless APIs are necessarily - # platform-specific. - '../../glue/plugins/test/plugin_window_size_test.cc', - '../../glue/plugins/test/plugin_windowed_test.cc', - '../../glue/plugins/test/plugin_windowless_test.cc', - - # Seems windows specific. - '../../glue/plugins/test/plugin_create_instance_in_paint.cc', - '../../glue/plugins/test/plugin_create_instance_in_paint.h', - - # windows-specific resources - '../../glue/plugins/test/npapi_test.def', - '../../glue/plugins/test/npapi_test.rc', - ], - }], - ['OS=="mac"', { - 'link_settings': { - 'libraries': [ - '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', - ], - }, - }], - ], - }, + }], + ['OS=="linux" and target_arch=="x64"', { + # Shared libraries need -fPIC on x86-64 + 'cflags': ['-fPIC'] + }], ], - }], + }, + ], + 'conditions': [ ['OS=="linux"', { 'targets': [ { |