diff options
author | brettw <brettw@chromium.org> | 2014-11-19 14:22:51 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-19 22:23:11 +0000 |
commit | d60468061789084ebd98458b9743726cc1541786 (patch) | |
tree | e0ca59cfbca55ee1869d72e376fef7cbe7692a54 | |
parent | 0929be2a6d3e1880cfb047a7adc1c3e8e6dd5285 (diff) | |
download | chromium_src-d60468061789084ebd98458b9743726cc1541786.zip chromium_src-d60468061789084ebd98458b9743726cc1541786.tar.gz chromium_src-d60468061789084ebd98458b9743726cc1541786.tar.bz2 |
Add chrome sync tests to the GN build.
This adds sync_integration_tests, sync_performance_tests, and the sync test support targets.
I removed some files that were duplicated between the sync integration tests and the test support. In GYP the fact that test support was a static library hid the duplicate symbols.
Add a dependency on sessions_core from sessions test support since it's required to link. Made test support target be a source set (linking source sets into static libraries will often duplicate symbols).
Review URL: https://codereview.chromium.org/717923006
Cr-Commit-Position: refs/heads/master@{#304904}
-rw-r--r-- | chrome/chrome_tests.gypi | 15 | ||||
-rw-r--r-- | chrome/chrome_tests_unit.gypi | 2 | ||||
-rw-r--r-- | chrome/test/BUILD.gn | 173 | ||||
-rw-r--r-- | components/sessions/BUILD.gn | 3 |
4 files changed, 183 insertions, 10 deletions
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index a32f26c..ea34878 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1235,14 +1235,6 @@ 'browser/sync/test/integration/multiple_client_preferences_sync_test.cc', 'browser/sync/test/integration/multiple_client_sessions_sync_test.cc', 'browser/sync/test/integration/multiple_client_typed_urls_sync_test.cc', - 'browser/sync/test/integration/passwords_helper.cc', - 'browser/sync/test/integration/passwords_helper.h', - 'browser/sync/test/integration/preferences_helper.cc', - 'browser/sync/test/integration/preferences_helper.h', - 'browser/sync/test/integration/search_engines_helper.cc', - 'browser/sync/test/integration/search_engines_helper.h', - 'browser/sync/test/integration/sessions_helper.cc', - 'browser/sync/test/integration/sessions_helper.h', 'browser/sync/test/integration/single_client_app_list_sync_test.cc', 'browser/sync/test/integration/single_client_apps_sync_test.cc', 'browser/sync/test/integration/single_client_backup_rollback_test.cc', @@ -2593,11 +2585,11 @@ ], # conditions }, # target performance_browser_tests { + # GN version: //chrome/test:sync_integration_test_support 'target_name': 'test_support_sync_integration', 'type': 'static_library', 'dependencies': [ 'browser', - 'chrome', 'test_support_common', '../base/base.gyp:base', '../components/components.gyp:invalidation', @@ -2630,6 +2622,7 @@ 'conditions': [ ['OS=="mac"', { # Dictionary sync is disabled on Mac. + # Note: this list is duplicated in the GN build. 'sources!': [ 'browser/sync/test/integration/dictionary_helper.cc', 'browser/sync/test/integration/dictionary_helper.h', @@ -2638,6 +2631,7 @@ ], }], ['enable_app_list==0', { + # Note: this list is duplicated in the GN build. 'sources!': [ 'browser/sync/test/integration/sync_app_list_helper.cc', 'browser/sync/test/integration/sync_app_list_helper.h', @@ -2646,6 +2640,7 @@ ] }, { + # GN version: //chrome/test:sync_integration_tests 'target_name': 'sync_integration_tests', 'type': 'executable', 'dependencies': [ @@ -2696,6 +2691,7 @@ # Search for comments about "xcode_settings" elsewhere in this file. 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']}, # Dictionary sync is disabled on Mac. + # Note: list duplicated in GN build. 'sources!': [ 'browser/sync/test/integration/multiple_client_dictionary_sync_test.cc', 'browser/sync/test/integration/single_client_dictionary_sync_test.cc', @@ -2760,6 +2756,7 @@ ], }, { + # GN version: //chrome/test:sync_performance_tests 'target_name': 'sync_performance_tests', 'type': 'executable', 'dependencies': [ diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index 099ccac..c5e81d5 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -1451,6 +1451,8 @@ { # This target contains mocks and test utilities that don't belong in # production libraries but are used by more than one test executable. + # + # GN version: //chrome/test:test_support 'target_name': 'test_support_common', 'type': 'static_library', 'dependencies': [ diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index c64cf59..65792a1 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn @@ -5,6 +5,12 @@ import("//build/config/features.gni") import("//build/config/ui.gni") +gypi_values = exec_script( + "//build/gypi_to_gn.py", + [ rebase_path("../chrome_tests.gypi") ], + "scope", + [ "../chrome_tests.gypi" ]) + # This target exists to reference other test executables to bring these files # into the build. group("test") { @@ -211,3 +217,170 @@ source_set("test_support_unit") { "//mojo/environment:chromium", ] } + +source_set("sync_integration_test_support") { + testonly = true + + sources = rebase_path(gypi_values.test_support_sync_integration_sources, + ".", "//chrome") + deps = [ + ":test_support", + "//base", + "//chrome", + "//chrome/browser", + "//components/invalidation", + "//components/invalidation:test_support", + "//net", + "//skia", + "//sync", + "//sync:test_support_sync_testserver", + "//sync:test_support_sync_fake_server", + "//ui/app_list:test_support", + ] + + if (is_mac) { + sources -= [ + "../browser/sync/test/integration/dictionary_helper.cc", + "../browser/sync/test/integration/dictionary_helper.h", + "../browser/sync/test/integration/dictionary_load_observer.cc", + "../browser/sync/test/integration/dictionary_load_observer.h", + ] + } + if (!enable_app_list) { + sources -= [ + "../browser/sync/test/integration/sync_app_list_helper.cc", + "../browser/sync/test/integration/sync_app_list_helper.h", + ] + } +} + +test("sync_integration_tests") { + sources = rebase_path(gypi_values.sync_integration_tests_sources, + ".", "//chrome") + + # TODO(phajdan.jr): Only temporary, to make transition easier. + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + deps = [ + ":sync_integration_test_support", + ":test_support", + "//base/allocator", + "//chrome:packed_extra_resources", + "//chrome:packed_resources", + "//chrome:resources", + "//chrome:strings", + "//chrome/common", + "//chrome/renderer", + "//crypto:platform", + "//sync", + "//testing/gmock", + "//testing/gtest", + "//third_party/icu", + "//third_party/leveldatabase", + "//third_party/npapi", + "//third_party/WebKit/public:blink", + ] + + if (cld_version == 0 || cld_version == 2) { + # Language detection is irrelevant to sync, so it can depend on any + # implementation for CLD2. Dynamic is smaller, so go with dynamic. + deps += [ "//third_party/cld_2:cld2_dynamic" ] + } + if (is_mac) { + # Dictionary sync is disabled on Mac. + sources -= [ + "../browser/sync/test/integration/multiple_client_dictionary_sync_test.cc", + "../browser/sync/test/integration/single_client_dictionary_sync_test.cc", + "../browser/sync/test/integration/two_client_dictionary_sync_test.cc", + ] + + # The sync_integration_tests do not run on mac without this flag. + # Search for comments about "xcode_settings" elsewhere in this file. + ldflags = [ "-Wl,-ObjC" ] + } + if (is_win) { + # TODO(GYP) figure out what these should map to. + #sources += [ + # '<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc', + # '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc', + #] + deps += [ + "//third_party/wtl", + #'chrome_version_resources', TODO(GYP) + ] + } else { + sources -= [ + "../app/chrome_version.rc.version", + ] + } + + if (toolkit_views) { + deps += [ "//ui/views" ] + } + if (enable_basic_printing || enable_print_preview) { + deps += [ "//printing" ] + } + if (!enable_app_list) { + sources -= [ + "../browser/sync/test/integration/single_client_app_list_sync_test.cc", + "../browser/sync/test/integration/two_client_app_list_sync_test.cc", + ] + } + if (!enable_managed_users) { + sources -= [ + "../browser/sync/test/integration/single_client_supervised_user_settings_sync_test.cc", + ] + } +} + +test("sync_performance_tests") { + sources = rebase_path(gypi_values.sync_performance_tests_sources, + ".", "//chrome") + + defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] + + deps = [ + ":sync_integration_test_support", + "//base/allocator", + "//crypto:platform", + "//sync", + "//testing/gmock", + "//testing/gtest", + ] + + if (cld_version == 0 || cld_version == 2) { + # Language detection is irrelevant to sync, so it can depend on any + # implementation for CLD2. Dynamic is smaller, so go with dynamic. + deps += [ "//third_party/cld_2:cld2_dynamic" ] + } + + if (is_mac) { + # Dictionary sync is disabled on Mac. + sources -= [ + "../browser/sync/test/integration/performance/dictionary_sync_perf_test.cc", + ] + + # The sync_performance_tests do not run on mac without this flag. + # Search for comments about "xcode_settings" elsewhere in this file. + ldflags = [ "-Wl,-ObjC" ] + } + if (is_win) { + # TODO(GYP) figure out what these should map to. + #sources += [ + # '<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc', + # '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc', + #] + deps += [ + "//third_party/wtl", + #'chrome_version_resources', TODO(GYP) + ] + } else { + sources -= [ + "../app/chrome_version.rc.version", + ] + } + + if (toolkit_views) { + deps += [ "//ui/views" ] + } +} diff --git a/components/sessions/BUILD.gn b/components/sessions/BUILD.gn index be2aec2..d5ecde2 100644 --- a/components/sessions/BUILD.gn +++ b/components/sessions/BUILD.gn @@ -48,7 +48,7 @@ source_set("sessions_core") { } } -static_library("test_support") { +source_set("test_support") { testonly = true sources = [ "serialized_navigation_entry_test_helper.cc", @@ -56,6 +56,7 @@ static_library("test_support") { ] deps = [ + ":sessions_core", "//skia", "//testing/gtest", ] |