summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-05 07:51:38 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-05 07:51:38 +0000
commitabe4d456e2f591b95e04a20ab86309e1e6d29b34 (patch)
treecb01dab33b874d83d89dcf5f97f4259881883406
parent561f0347efd8f20de477276122234165ce85d55c (diff)
downloadchromium_src-abe4d456e2f591b95e04a20ab86309e1e6d29b34.zip
chromium_src-abe4d456e2f591b95e04a20ab86309e1e6d29b34.tar.gz
chromium_src-abe4d456e2f591b95e04a20ab86309e1e6d29b34.tar.bz2
Add extensions_unittests target for unit tests in //extensions.
This introduces a minimal test target, "extensions_unittests", for building unit tests in //extensions. It starts with files from extensions/common first, so it is easier to get the dependencies right. This also list the all the entries that would not introduce more "chrome" dependencies on any extensions targets. When running this target you will see that it does not PASS everything yet: 8 tests failed: ExtensionURLPatternTest.ConvertToExplicitSchemes ExtensionURLPatternTest.GetAsString ExtensionURLPatternTest.Match13 ExtensionURLPatternTest.Match19 ExtensionURLPatternTest.Match9 FileUtilTest.ExtensionResourceURLToFilePath FileUtilTest.ExtensionURLToRelativeFilePath 9 tests crashed: APIPermissionSetTest.CreateDifference APIPermissionSetTest.CreateIntersection APIPermissionSetTest.CreateUnion APIPermissionSetTest.General APIPermissionSetTest.IPC APIPermissionSetTest.ImplicitPermissions ManifestHandlerTest.DependentHandlers ManifestHandlerTest.FailingHandlers ManifestHandlerTest.Validate Since we are not running this target on the bots yet, it should be fine, and we can iterate from this point and fix these failures and crashes later. BUG=348066 TEST=extensions_unittests R=yoz@chromium.org,jamescook@chromium.org,jam@chromium.org Review URL: https://codereview.chromium.org/224993004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261989 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/chrome_tests_unit.gypi5
-rw-r--r--content/content_app.gypi7
-rw-r--r--extensions/extensions.gyp50
3 files changed, 57 insertions, 5 deletions
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index bac3bef..4d2b718 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -542,7 +542,10 @@
'../components/autofill/content/renderer/test_password_autofill_agent.h',
'../components/autofill/content/renderer/test_password_generation_agent.cc',
'../components/autofill/content/renderer/test_password_generation_agent.h',
- # TODO: Create an extensions_unittests target. http://crbug.com/348066
+ # TODO(tfarina): Move these entries over to extensions_unittests target.
+ # http://crbug.com/348066. They are duplicated here because we haven't
+ # extensions_unittests running in the bots yet. Until that happens,
+ # they should be kept here.
'../extensions/browser/admin_policy_unittest.cc',
'../extensions/browser/api/storage/settings_quota_unittest.cc',
'../extensions/browser/api/storage/settings_test_util.cc',
diff --git a/content/content_app.gypi b/content/content_app.gypi
index 6187bce..a66a12d 100644
--- a/content/content_app.gypi
+++ b/content/content_app.gypi
@@ -35,6 +35,13 @@
'public/app/startup_helper_win.h',
],
'conditions': [
+ # TODO(dmikurube): Kill {linux|android}_use_tcmalloc. http://crbug.com/345554
+ ['(use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and ((OS=="linux" and os_posix==1 and use_aura==1 and linux_use_tcmalloc==1) or (OS=="android" and android_use_tcmalloc==1)))', {
+ 'dependencies': [
+ # This is needed by app/content_main_runner.cc
+ '../base/allocator/allocator.gyp:allocator',
+ ],
+ }],
['OS=="win"', {
'dependencies': [
'../sandbox/sandbox.gyp:sandbox',
diff --git a/extensions/extensions.gyp b/extensions/extensions.gyp
index 89095b2..f941aef 100644
--- a/extensions/extensions.gyp
+++ b/extensions/extensions.gyp
@@ -12,15 +12,24 @@
'type': 'static_library',
'dependencies': [
'common/api/api.gyp:extensions_api',
- '../third_party/re2/re2.gyp:re2',
# TODO(benwells): figure out what to do with the api target and
# api resources compiled into the chrome resource bundle.
# http://crbug.com/162530
'../chrome/chrome_resources.gyp:chrome_resources',
# TODO(jamescook|derat): Pull strings into extensions module.
'../chrome/chrome_resources.gyp:chrome_strings',
+ # TODO(tfarina): This dep here is for extensions/common/constants.*
+ # We should find a way to compile this module within extensions_common.
+ '../chrome/common_constants.gyp:common_constants',
'../components/components.gyp:url_matcher',
'../content/content.gyp:content_common',
+ '../crypto/crypto.gyp:crypto',
+ '../ipc/ipc.gyp:ipc',
+ '../net/net.gyp:net',
+ '../third_party/re2/re2.gyp:re2',
+ '../ui/base/ui_base.gyp:ui_base',
+ '../ui/gfx/gfx.gyp:gfx_geometry',
+ '../url/url.gyp:url_lib',
],
'include_dirs': [
'..',
@@ -28,10 +37,10 @@
],
'sources': [
'common/api/messaging/message.h',
- 'common/api/sockets/sockets_manifest_handler.cc',
- 'common/api/sockets/sockets_manifest_handler.h',
'common/api/sockets/sockets_manifest_data.cc',
'common/api/sockets/sockets_manifest_data.h',
+ 'common/api/sockets/sockets_manifest_handler.cc',
+ 'common/api/sockets/sockets_manifest_handler.h',
'common/api/sockets/sockets_manifest_permission.cc',
'common/api/sockets/sockets_manifest_permission.h',
'common/common_manifest_handlers.cc',
@@ -111,8 +120,8 @@
'common/manifest_handlers/kiosk_mode_info.h',
'common/manifest_handlers/offline_enabled_info.cc',
'common/manifest_handlers/offline_enabled_info.h',
- 'common/manifest_handlers/requirements_info.h',
'common/manifest_handlers/requirements_info.cc',
+ 'common/manifest_handlers/requirements_info.h',
'common/manifest_handlers/sandboxed_page_info.cc',
'common/manifest_handlers/sandboxed_page_info.h',
'common/manifest_handlers/shared_module_info.cc',
@@ -427,5 +436,38 @@
# Disable c4267 warnings until we fix size_t to int truncations.
'msvs_disabled_warnings': [ 4267, ],
},
+ {
+ # TODO(tfarina): Our plan is to build and run this target on Chromium bots
+ # (TS, CQ, Waterfall). First we will get this target passing all tests,
+ # after that we will start the work on buildbot to get this running there.
+ # When we consider this stable in the bots, we can go to unit_tests target
+ # and remove the duplicated entries from there, otherwise if we just
+ # remove them right now we would be losing coverage.
+ # http://crbug.com/348066
+ 'target_name': 'extensions_unittests',
+ 'type': 'executable',
+ 'dependencies': [
+ '../base/base.gyp:base',
+ '../base/base.gyp:run_all_unittests',
+ '../base/base.gyp:test_support_base',
+ '../testing/gtest.gyp:gtest',
+ 'extensions_common',
+ 'extensions_test_support',
+ ],
+ 'sources': [
+ 'common/api/sockets/sockets_manifest_permission_unittest.cc',
+ 'common/csp_validator_unittest.cc',
+ 'common/event_filter_unittest.cc',
+ 'common/file_util_unittest.cc',
+ 'common/id_util_unittest.cc',
+ 'common/manifest_handler_unittest.cc',
+ 'common/one_shot_event_unittest.cc',
+ 'common/permissions/api_permission_set_unittest.cc',
+ 'common/permissions/manifest_permission_set_unittest.cc',
+ 'common/url_pattern_set_unittest.cc',
+ 'common/url_pattern_unittest.cc',
+ 'common/user_script_unittest.cc',
+ ],
+ },
]
}