From 656610fbe7a1339f5576cafb8564b5d7609c6be9 Mon Sep 17 00:00:00 2001 From: ehmaldonado Date: Mon, 6 Feb 2017 02:21:11 -0800 Subject: [PATCH] Move frame_generator_capture.{cc, h} and video_capturer.h to video_test_common. Remove video_capture as a dependency of test_common and add it as a dependency of modules_unittests, as it was before the refactor in https://codereview.webrtc.org/2629923002 BUG=webrtc:7037 NOTRY=True Review-Url: https://codereview.webrtc.org/2666113003 Cr-Commit-Position: refs/heads/master@{#16439} --- webrtc/BUILD.gn | 1 + webrtc/common_video/BUILD.gn | 1 + webrtc/modules/BUILD.gn | 2 + webrtc/modules/desktop_capture/BUILD.gn | 1 + .../modules/remote_bitrate_estimator/BUILD.gn | 1 + webrtc/modules/video_capture/BUILD.gn | 1 - webrtc/modules/video_coding/BUILD.gn | 7 ++ webrtc/test/BUILD.gn | 69 ++++++++++++++----- webrtc/voice_engine/BUILD.gn | 1 + 9 files changed, 67 insertions(+), 17 deletions(-) diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index 8969f13f10..5f91fa8e22 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -416,6 +416,7 @@ if (rtc_include_tests) { "modules/video_capture", "test:test_common", "test:test_main", + "test:video_test_common", "video:video_tests", ] data = video_engine_tests_resources diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn index 1c13fa4b06..b3e6c4234f 100644 --- a/webrtc/common_video/BUILD.gn +++ b/webrtc/common_video/BUILD.gn @@ -119,6 +119,7 @@ if (rtc_include_tests) { deps = [ ":common_video", + "../modules/video_capture:video_capture", "../system_wrappers:system_wrappers", "../test:test_main", "../test:video_test_common", diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn index 1d247dba06..e750a81097 100644 --- a/webrtc/modules/BUILD.gn +++ b/webrtc/modules/BUILD.gn @@ -52,6 +52,7 @@ if (rtc_include_tests) { deps = [ "../test:test_main", + "../test:video_test_common", "audio_coding:audio_coding_modules_tests", "desktop_capture:desktop_capture_modules_tests", "rtp_rtcp:rtp_rtcp_modules_tests", @@ -225,6 +226,7 @@ if (rtc_include_tests) { "remote_bitrate_estimator:remote_bitrate_estimator_unittests", "rtp_rtcp:rtp_rtcp_unittests", "utility:utility_unittests", + "video_capture", "video_coding:video_coding_unittests", "video_processing:video_processing_unittests", ] diff --git a/webrtc/modules/desktop_capture/BUILD.gn b/webrtc/modules/desktop_capture/BUILD.gn index e4f5b309c9..bbf9ac57bb 100644 --- a/webrtc/modules/desktop_capture/BUILD.gn +++ b/webrtc/modules/desktop_capture/BUILD.gn @@ -46,6 +46,7 @@ if (rtc_include_tests) { "../../base:rtc_base_approved", "../../system_wrappers:system_wrappers", "../../test:test_support", + "../../test:video_test_support", ] sources += [ "screen_capturer_integration_test.cc", diff --git a/webrtc/modules/remote_bitrate_estimator/BUILD.gn b/webrtc/modules/remote_bitrate_estimator/BUILD.gn index f89137e377..3a6997bf57 100644 --- a/webrtc/modules/remote_bitrate_estimator/BUILD.gn +++ b/webrtc/modules/remote_bitrate_estimator/BUILD.gn @@ -199,6 +199,7 @@ if (rtc_include_tests) { "../../base:rtc_base_approved", "../../test:test_common", "../../test:test_main", + "../../test:video_test_common", "../video_capture", "//testing/gmock", "//testing/gtest", diff --git a/webrtc/modules/video_capture/BUILD.gn b/webrtc/modules/video_capture/BUILD.gn index 90b824a5b8..a03bb3c6dd 100644 --- a/webrtc/modules/video_capture/BUILD.gn +++ b/webrtc/modules/video_capture/BUILD.gn @@ -31,7 +31,6 @@ rtc_static_library("video_capture_module") { "../../base:rtc_base_approved", "../../common_video", "../../system_wrappers", - "../utility", ] if (!build_with_chromium && is_clang) { diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn index 02b01079ee..d46fd113c8 100644 --- a/webrtc/modules/video_coding/BUILD.gn +++ b/webrtc/modules/video_coding/BUILD.gn @@ -303,6 +303,9 @@ if (rtc_include_tests) { "../../system_wrappers:metrics_default", "../../system_wrappers:system_wrappers", "../../test:test_support", + "../../test:video_test_common", + "../../test:video_test_support", + "../video_capture", "//third_party/gflags", ] } # video_quality_measurement @@ -334,6 +337,7 @@ if (rtc_include_tests) { "../../common_video:common_video", "../../system_wrappers:system_wrappers", "../../test:test_support", + "../../test:video_test_support", ] } @@ -356,6 +360,8 @@ if (rtc_include_tests) { "../../media:rtc_media_base", "../../test:test_support", "../../test:video_test_common", + "../../test:video_test_support", + "../video_capture", ] if (rtc_use_h264) { defines = [ "WEBRTC_VIDEOPROCESSOR_H264_TESTS" ] @@ -431,6 +437,7 @@ if (rtc_include_tests) { "../../test:field_trial", "../../test:test_support", "../../test:video_test_common", + "../../test:video_test_support", "../rtp_rtcp:rtp_rtcp", "//testing/gmock", ] diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn index 352eb371a8..0e885c84b4 100644 --- a/webrtc/test/BUILD.gn +++ b/webrtc/test/BUILD.gn @@ -37,8 +37,13 @@ rtc_source_set("video_test_common") { "fake_texture_frame.h", "frame_generator.cc", "frame_generator.h", + "frame_generator_capturer.cc", + "frame_generator_capturer.h", "frame_utils.cc", "frame_utils.h", + "vcm_capturer.cc", + "vcm_capturer.h", + "video_capturer.h", ] if (!build_with_chromium && is_clang) { @@ -47,7 +52,9 @@ rtc_source_set("video_test_common") { } deps = [ + ":video_test_support", "../common_video", + "../modules/video_capture:video_capture_module", ] } @@ -118,22 +125,59 @@ rtc_source_set("fileutils") { } } +rtc_source_set("video_test_support") { + testonly = true + + sources = [ + "testsupport/frame_reader.cc", + "testsupport/frame_reader.h", + "testsupport/frame_writer.cc", + "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", + ] + + deps = [ + "../base:rtc_base_approved", + "../common_video", + "../system_wrappers", + "//testing/gmock", + "//testing/gtest", + "//third_party/gflags", + ] + + 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 += [ "//webrtc/sdk:rtc_sdk_common_objc" ] + } + + if (rtc_use_memcheck) { + data = valgrind_webrtc_dependencies + } +} + rtc_source_set("test_support") { testonly = true sources = [ "gmock.h", "gtest.h", - "testsupport/frame_reader.cc", - "testsupport/frame_reader.h", - "testsupport/frame_writer.cc", - "testsupport/frame_writer.h", "testsupport/isolated_output.cc", "testsupport/isolated_output.h", - "testsupport/metrics/video_metrics.cc", - "testsupport/metrics/video_metrics.h", - "testsupport/mock/mock_frame_reader.h", - "testsupport/mock/mock_frame_writer.h", "testsupport/packet_reader.cc", "testsupport/packet_reader.h", "testsupport/perf_test.cc", @@ -144,7 +188,6 @@ rtc_source_set("test_support") { ] deps = [ - ":video_test_common", "../base:gtest_prod", "../base:rtc_base_approved", "../common_video", @@ -250,6 +293,7 @@ rtc_test("test_support_unittests") { ":fileutils_unittests", ":test_common", ":test_main", + ":video_test_common", "../modules/video_capture", "//testing/gmock", "//testing/gtest", @@ -292,8 +336,6 @@ rtc_source_set("test_common") { "fake_network_pipe.cc", "fake_network_pipe.h", "fake_videorenderer.h", - "frame_generator_capturer.cc", - "frame_generator_capturer.h", "layer_filtering_transport.cc", "layer_filtering_transport.h", "mock_transport.h", @@ -304,9 +346,6 @@ rtc_source_set("test_common") { "rtp_rtcp_observer.h", "statistics.cc", "statistics.h", - "vcm_capturer.cc", - "vcm_capturer.h", - "video_capturer.h", "win/run_loop_win.cc", ] if (!is_win) { @@ -332,8 +371,6 @@ rtc_source_set("test_common") { "../modules/audio_device:mock_audio_device", "../modules/audio_mixer:audio_mixer_impl", "../modules/audio_processing", - "../modules/video_capture:video_capture", - "../modules/video_capture:video_capture_module", "../video", "//testing/gmock", "//testing/gtest", diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn index cb97693232..07c00eaeb3 100644 --- a/webrtc/voice_engine/BUILD.gn +++ b/webrtc/voice_engine/BUILD.gn @@ -348,6 +348,7 @@ if (rtc_include_tests) { "//webrtc/system_wrappers/:system_wrappers_default", "//webrtc/test/:test_common", "//webrtc/test/:test_support", + "//webrtc/test/:video_test_common", ] sources = [