diff --git a/.gn b/.gn index c3b26775d1..882d220fdb 100644 --- a/.gn +++ b/.gn @@ -67,8 +67,4 @@ default_args = { # WebRTC relies on Chromium's Android test infrastructure. use_cxx11_on_android = false - - # WebRTC does not provide the gflags dependency. Because libyuv uses it only - # for unittests, it can be disabled (see third_party/libyuv/BUILD.gn) - libyuv_use_gflags = false } diff --git a/DEPS b/DEPS index ce7410ecdb..2d02239db6 100644 --- a/DEPS +++ b/DEPS @@ -83,6 +83,10 @@ deps = { 'src/tools/swarming_client': Var('chromium_git') + '/infra/luci/client-py.git' + '@' + Var('swarming_revision'), # WebRTC-only dependencies (not present in Chromium). + 'src/third_party/gflags': + Var('webrtc_git') + '/deps/third_party/gflags' + '@' + '892576179b45861b53e04a112996a738309cf364', + 'src/third_party/gflags/src': + Var('chromium_git') + '/external/github.com/gflags/gflags' + '@' + '03bebcb065c83beff83d50ae025a55a4bf94dfca', 'src/third_party/gtest-parallel': Var('chromium_git') + '/external/github.com/google/gtest-parallel' + '@' + 'ee2027381105650fb1c66b2b121ba00b79e84d5c', } @@ -546,6 +550,7 @@ include_rules = [ "-base", "-chromium", "+external/webrtc/webrtc", # Android platform build. + "+gflags", "+libyuv", # Individual headers that will be moved out of here, see webrtc:4243. "+call/rtp_config.h", diff --git a/rtc_tools/BUILD.gn b/rtc_tools/BUILD.gn index b368a0e7d1..5dca268967 100644 --- a/rtc_tools/BUILD.gn +++ b/rtc_tools/BUILD.gn @@ -234,6 +234,7 @@ if (!build_with_chromium) { } } +# Exclude tools depending on gflags since that's not available in Chromium. if (rtc_include_tests) { if (rtc_enable_protobuf) { rtc_executable("event_log_visualizer") { diff --git a/test/BUILD.gn b/test/BUILD.gn index 55b25c8939..36f3539307 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -175,176 +175,180 @@ rtc_source_set("test_support") { } } -rtc_source_set("test_main") { - testonly = true - sources = [ - "test_main.cc", - ] - - public_deps = [ - ":test_support", - ] - deps = [ - ":field_trial", - "../rtc_base:rtc_base_approved", - "../system_wrappers:metrics_default", - "//testing/gmock", - "//testing/gtest", - ] -} - -rtc_source_set("video_test_support") { - testonly = true - - sources = [ - "testsupport/frame_reader.h", - "testsupport/frame_writer.h", - "testsupport/metrics/video_metrics.cc", - "testsupport/metrics/video_metrics.h", - "testsupport/mock/mock_frame_reader.h", - "testsupport/mock/mock_frame_writer.h", - "testsupport/y4m_frame_writer.cc", - "testsupport/yuv_frame_reader.cc", - "testsupport/yuv_frame_writer.cc", - ] - - deps = [ - ":test_support", - ":video_test_common", - "..:webrtc_common", - "../api:video_frame_api", - "../common_video", - "../rtc_base:rtc_base_approved", - "../system_wrappers", - "//testing/gmock", - "//testing/gtest", - ] - - if (!is_ios) { - deps += [ "//third_party:jpeg" ] - sources += [ "testsupport/jpeg_frame_writer.cc" ] - } else { - sources += [ "testsupport/jpeg_frame_writer_ios.cc" ] - } - - public_deps = [ - ":fileutils", - ] - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - - if (is_android) { - deps += [ "//base:base" ] - } - - if (is_ios) { - deps += [ "../sdk:common_objc" ] - } - - if (rtc_use_memcheck) { - data = valgrind_webrtc_dependencies - } -} - -rtc_source_set("test_support_test_output") { - testonly = true - sources = [ - "testsupport/test_output.cc", - "testsupport/test_output.h", - ] - deps = [ - ":fileutils", - "../rtc_base:rtc_base_approved", - ] -} - -test_support_unittests_resources = [ - "../resources/foreman_cif_short.yuv", - "../resources/video_coding/frame-ethernet-ii.pcap", - "../resources/video_coding/frame-loopback.pcap", - "../resources/video_coding/pltype103.rtp", - "../resources/video_coding/pltype103_header_only.rtp", - "../resources/video_coding/ssrcs-2.pcap", - "../resources/video_coding/ssrcs-3.pcap", -] - -if (is_ios) { - bundle_data("test_support_unittests_bundle_data") { +if (!build_with_chromium) { + # This target used to depend on //third_party/gflags which Chromium does not + # provide. TODO(oprypin): remove the conditional. + rtc_source_set("test_main") { testonly = true - sources = test_support_unittests_resources - outputs = [ - "{{bundle_resources_dir}}/{{source_file_part}}", + sources = [ + "test_main.cc", + ] + + public_deps = [ + ":test_support", + ] + deps = [ + ":field_trial", + "../rtc_base:rtc_base_approved", + "../system_wrappers:metrics_default", + "//testing/gmock", + "//testing/gtest", ] } -} -rtc_test("test_support_unittests") { - deps = [ - ":fake_audio_device", - ":rtp_test_utils", - "../api:video_frame_api", - "../call:call_interfaces", - "../common_audio", - "../modules/rtp_rtcp", - "../rtc_base:rtc_base_approved", - "../system_wrappers", + rtc_source_set("video_test_support") { + testonly = true + + sources = [ + "testsupport/frame_reader.h", + "testsupport/frame_writer.h", + "testsupport/metrics/video_metrics.cc", + "testsupport/metrics/video_metrics.h", + "testsupport/mock/mock_frame_reader.h", + "testsupport/mock/mock_frame_writer.h", + "testsupport/y4m_frame_writer.cc", + "testsupport/yuv_frame_reader.cc", + "testsupport/yuv_frame_writer.cc", + ] + + deps = [ + ":test_support", + ":video_test_common", + "..:webrtc_common", + "../api:video_frame_api", + "../common_video", + "../rtc_base:rtc_base_approved", + "../system_wrappers", + "//testing/gmock", + "//testing/gtest", + ] + + if (!is_ios) { + deps += [ "//third_party:jpeg" ] + sources += [ "testsupport/jpeg_frame_writer.cc" ] + } else { + sources += [ "testsupport/jpeg_frame_writer_ios.cc" ] + } + + public_deps = [ + ":fileutils", + ] + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + + if (is_android) { + deps += [ "//base:base" ] + } + + if (is_ios) { + deps += [ "../sdk:common_objc" ] + } + + if (rtc_use_memcheck) { + data = valgrind_webrtc_dependencies + } + } + + rtc_source_set("test_support_test_output") { + testonly = true + sources = [ + "testsupport/test_output.cc", + "testsupport/test_output.h", + ] + deps = [ + ":fileutils", + "../rtc_base:rtc_base_approved", + ] + } + + test_support_unittests_resources = [ + "../resources/foreman_cif_short.yuv", + "../resources/video_coding/frame-ethernet-ii.pcap", + "../resources/video_coding/frame-loopback.pcap", + "../resources/video_coding/pltype103.rtp", + "../resources/video_coding/pltype103_header_only.rtp", + "../resources/video_coding/ssrcs-2.pcap", + "../resources/video_coding/ssrcs-3.pcap", ] - sources = [ - "fake_audio_device_unittest.cc", - "fake_network_pipe_unittest.cc", - "frame_generator_unittest.cc", - "rtp_file_reader_unittest.cc", - "rtp_file_writer_unittest.cc", - "single_threaded_task_queue_unittest.cc", - "testsupport/always_passing_unittest.cc", - "testsupport/metrics/video_metrics_unittest.cc", - "testsupport/packet_reader_unittest.cc", - "testsupport/perf_test_unittest.cc", - "testsupport/test_output_unittest.cc", - "testsupport/y4m_frame_writer_unittest.cc", - "testsupport/yuv_frame_reader_unittest.cc", - "testsupport/yuv_frame_writer_unittest.cc", - ] - - # TODO(jschuh): Bug 1348: fix this warning. - configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] - - if (is_win) { - # virtual override w/different const/volatile signature. - cflags = [ "/wd4373" ] - } - - if (!build_with_chromium && is_clang) { - # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). - suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] - } - - data = test_support_unittests_resources - if (is_android) { - deps += [ "//testing/android/native_test:native_test_support" ] - shard_timeout = 900 - } if (is_ios) { - deps += [ ":test_support_unittests_bundle_data" ] + bundle_data("test_support_unittests_bundle_data") { + testonly = true + sources = test_support_unittests_resources + outputs = [ + "{{bundle_resources_dir}}/{{source_file_part}}", + ] + } } - deps += [ - ":direct_transport", - ":fileutils_unittests", - ":test_common", - ":test_main", - ":test_support_test_output", - ":video_test_common", - ":video_test_support", - "../modules/video_capture", - "../rtc_base:rtc_base_approved", - "//testing/gmock", - "//testing/gtest", - ] + rtc_test("test_support_unittests") { + deps = [ + ":fake_audio_device", + ":rtp_test_utils", + "../api:video_frame_api", + "../call:call_interfaces", + "../common_audio", + "../modules/rtp_rtcp", + "../rtc_base:rtc_base_approved", + "../system_wrappers", + ] + sources = [ + "fake_audio_device_unittest.cc", + "fake_network_pipe_unittest.cc", + "frame_generator_unittest.cc", + "rtp_file_reader_unittest.cc", + "rtp_file_writer_unittest.cc", + "single_threaded_task_queue_unittest.cc", + "testsupport/always_passing_unittest.cc", + "testsupport/metrics/video_metrics_unittest.cc", + "testsupport/packet_reader_unittest.cc", + "testsupport/perf_test_unittest.cc", + "testsupport/test_output_unittest.cc", + "testsupport/y4m_frame_writer_unittest.cc", + "testsupport/yuv_frame_reader_unittest.cc", + "testsupport/yuv_frame_writer_unittest.cc", + ] + + # TODO(jschuh): Bug 1348: fix this warning. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + + if (is_win) { + # virtual override w/different const/volatile signature. + cflags = [ "/wd4373" ] + } + + if (!build_with_chromium && is_clang) { + # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + + data = test_support_unittests_resources + if (is_android) { + deps += [ "//testing/android/native_test:native_test_support" ] + shard_timeout = 900 + } + + if (is_ios) { + deps += [ ":test_support_unittests_bundle_data" ] + } + + deps += [ + ":direct_transport", + ":fileutils_unittests", + ":test_common", + ":test_main", + ":test_support_test_output", + ":video_test_common", + ":video_test_support", + "../modules/video_capture", + "../rtc_base:rtc_base_approved", + "//testing/gmock", + "//testing/gtest", + ] + } } if (is_ios) { diff --git a/tools_webrtc/autoroller/roll_deps.py b/tools_webrtc/autoroller/roll_deps.py index 8a57d78943..523caba4dd 100755 --- a/tools_webrtc/autoroller/roll_deps.py +++ b/tools_webrtc/autoroller/roll_deps.py @@ -22,6 +22,7 @@ import urllib # Skip these dependencies (list without solution name prefix). DONT_AUTOROLL_THESE = [ + 'src/third_party/gflags/src', 'src/third_party/winsdk_samples', 'src/examples/androidtests/third_party/gradle', ] diff --git a/tools_webrtc/autoroller/unittests/roll_deps_test.py b/tools_webrtc/autoroller/unittests/roll_deps_test.py index 5c48a86c16..dc2bacd385 100755 --- a/tools_webrtc/autoroller/unittests/roll_deps_test.py +++ b/tools_webrtc/autoroller/unittests/roll_deps_test.py @@ -107,7 +107,7 @@ class TestRollChromiumRevision(unittest.TestCase): self.assertEquals(vars_dict[variable_name], TEST_DATA_VARS[variable_name]) AssertVar('chromium_git') AssertVar('chromium_revision') - self.assertEquals(len(local_scope['deps']), 2) + self.assertEquals(len(local_scope['deps']), 3) self.assertEquals(len(local_scope['deps_os']), 1) def testGetMatchingDepsEntriesReturnsPathInSimpleCase(self): diff --git a/tools_webrtc/autoroller/unittests/testdata/DEPS b/tools_webrtc/autoroller/unittests/testdata/DEPS index ff30f0b481..4cf7677b99 100644 --- a/tools_webrtc/autoroller/unittests/testdata/DEPS +++ b/tools_webrtc/autoroller/unittests/testdata/DEPS @@ -13,6 +13,10 @@ deps = { # Entry that's also a DEPS entry in the Chromium DEPS file. 'src/buildtools': Var('chromium_git') + '/chromium/buildtools.git' + '@' + '64e38f0cebdde27aa0cfb405f330063582f9ac76', + + # Entry only present in WebRTC, not Chromium. + 'src/third_party/gflags/src': + Var('chromium_git') + '/external/github.com/gflags/gflags@03bebcb065c83beff83d50ae025a55a4bf94dfca', } deps_os = {