[M130 Migration][WebRTC] Enable unit tests 64/324664/2
authorMichal Jurkiewicz <m.jurkiewicz@samsung.com>
Fri, 24 Feb 2023 12:45:05 +0000 (13:45 +0100)
committerBot Blink <blinkbot@samsung.com>
Thu, 22 May 2025 20:13:36 +0000 (20:13 +0000)
* [M120 Migration][WebRTC] Enable unit tests
  https://archive.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/312461

Bug: https://jira-eu.sec.samsung.net/browse/VDWASM-2371
Change-Id: I7438b30be514b6ea84fc897d73d99c033f1067f7
Signed-off-by: Adam Bujalski <a.bujalski@samsung.com>
Signed-off-by: Michal Jurkiewicz <m.jurkiewicz@samsung.com>
46 files changed:
packaging/chromium-efl.spec
packaging/chromium-tizen_rtc_unittests.manifest [new file with mode: 0644]
run_webrtc_unittests.sh [new file with mode: 0755]
third_party/abseil-cpp/absl.gni
third_party/webrtc/api/BUILD.gn
third_party/webrtc/api/rtc_event_log/BUILD.gn
third_party/webrtc/api/rtc_event_log/rtc_event_log_factory.cc
third_party/webrtc/call/BUILD.gn
third_party/webrtc/call/rtp_video_sender_unittest.cc
third_party/webrtc/modules/BUILD.gn
third_party/webrtc/modules/audio_coding/BUILD.gn
third_party/webrtc/modules/audio_device/BUILD.gn
third_party/webrtc/modules/audio_processing/BUILD.gn
third_party/webrtc/modules/audio_processing/test/conversational_speech/BUILD.gn
third_party/webrtc/modules/audio_processing/test/py_quality_assessment/BUILD.gn
third_party/webrtc/modules/audio_processing/transient/BUILD.gn
third_party/webrtc/modules/congestion_controller/BUILD.gn
third_party/webrtc/modules/congestion_controller/goog_cc/BUILD.gn
third_party/webrtc/modules/congestion_controller/pcc/BUILD.gn
third_party/webrtc/modules/congestion_controller/receive_side_congestion_controller_unittest.cc
third_party/webrtc/modules/rtp_rtcp/source/remote_ntp_time_estimator_unittest.cc
third_party/webrtc/modules/rtp_rtcp/source/rtcp_packet/congestion_control_feedback_unittest.cc
third_party/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback_unittest.cc
third_party/webrtc/modules/video_capture/BUILD.gn
third_party/webrtc/modules/video_coding/BUILD.gn
third_party/webrtc/pc/BUILD.gn
third_party/webrtc/pc/media_stream_unittest.cc
third_party/webrtc/pc/peer_connection_integrationtest.cc
third_party/webrtc/pc/rtc_stats_collector.cc
third_party/webrtc/pc/rtp_sender.cc
third_party/webrtc/resources/audio_processing/test/py_quality_assessment/BUILD.gn
third_party/webrtc/rtc_base/system/BUILD.gn
third_party/webrtc/rtc_tools/BUILD.gn
third_party/webrtc/system_wrappers/BUILD.gn
third_party/webrtc/test/BUILD.gn
third_party/webrtc/test/pc/e2e/BUILD.gn
third_party/webrtc/test/pc/e2e/analyzer/video/BUILD.gn
third_party/webrtc/test/pc/e2e/analyzer/video/dvqa/BUILD.gn
third_party/webrtc/test/scenario/BUILD.gn
third_party/webrtc/test/test_main_lib.cc
third_party/webrtc/video/BUILD.gn
third_party/webrtc/video/video_stream_encoder_unittest.cc
third_party/webrtc/webrtc.gni
third_party/webrtc_overrides/BUILD.gn
third_party/webrtc_overrides/rtc_base/event.cc
tizen_src/build/config/tizen_features.gni

index 125c87d19506552bf2aebab2be75cf37ee87ce7a..d84f2e6278dcddb7169e78dd201666402454f552 100644 (file)
@@ -597,6 +597,15 @@ Requires: %{name} = %{version}-%{release}
 Chromium Media Module unittests
 %endif
 
+%if 0%{?build_rtc_unittests}
+%package rtc_unittests
+Summary: Chromium WebRTC unittests
+Group: Development/UnitTests
+Requires: %{name} = %{version}-%{release}
+%description rtc_unittests
+Chromium WebRTC unittests
+%endif
+
 %if 0%{?__enable_gcov}
 %package -n webkit2-gcov
 Summary: Chromium gcov
@@ -654,6 +663,10 @@ Chromium Tizen V8 unittests
     v8/test/wasm-js/tests.tar.gz
 %endif
 
+%if 0%{?build_rtc_unittests}
+%global TIZEN_RTC_UT_DIR /usr-ut/tizen_rtc_unittests
+%endif
+
 # The tv profile has a different tpk generation policy.
 # 2 types(update, upgrade) of tpk can be generated and used simultaneously.
 # If tpktype is not defined and tizen version is less than 6.0, upgrade type is generated by default.
@@ -810,6 +823,9 @@ fi
 %if 0%{?__tizen_product_da}
   "tizen_product_da=true" \
 %endif
+%if 0%{?build_rtc_unittests}
+  "tizen_rtc_unittests=true" \
+%endif
 %if "%{?_with_emulator}" == "1"
   "tizen_video_hole=false" \
 %endif
@@ -935,6 +951,9 @@ ninja %{_smp_mflags} -C "%{OUTPUT_FOLDER}" \
 %endif
 %if 0%{?__build_chrome}
   %{__browser_binary_name} \
+%endif
+%if 0%{?build_rtc_unittests}
+  webrtc_test_component \
 %endif
   efl_webprocess chromium-ewk efl_webview_app mini_browser ubrowser
 
@@ -993,6 +1012,12 @@ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH_ORIG
 
 %endif
 
+%if 0%{?run_unittests_in_gbs}
+%if 0%{?build_rtc_unittests}
+./run_webrtc_unittests.sh %{OUTPUT_FOLDER}
+%endif
+%endif
+
 echo %{version} > "%{OUTPUT_FOLDER}"/version
 
 # Prepare Tizen App Manifest
@@ -1359,6 +1384,20 @@ install -m 0664 -p -D $PWD%{MEDIA_UT_DATA_DIR}h264-320x180-frame-0 \
                       %{buildroot}%{TIZEN_MEDIA_UT_DIR}%{MEDIA_UT_DATA_DIR}
 %endif
 
+%if 0%{?build_rtc_unittests}
+mkdir -p %{buildroot}%{TIZEN_RTC_UT_DIR}
+install -m 0755 -p -D %{OUTPUT_FOLDER}/call_unittests %{buildroot}%{TIZEN_RTC_UT_DIR}
+install -m 0755 -p -D %{OUTPUT_FOLDER}/modules_unittests %{buildroot}%{TIZEN_RTC_UT_DIR}
+install -m 0755 -p -D %{OUTPUT_FOLDER}/peerconnection_unittests %{buildroot}%{TIZEN_RTC_UT_DIR}
+install -m 0755 -p -D %{OUTPUT_FOLDER}/rtc_pc_unittests %{buildroot}%{TIZEN_RTC_UT_DIR}
+install -m 0755 -p -D %{OUTPUT_FOLDER}/video_unittests %{buildroot}%{TIZEN_RTC_UT_DIR}
+%if %{__use_clang} == 1
+  # FIXME: This will copy 3 identical files under different names.
+  #        Use symlink or add dependency to package provideing libatomic.
+  install -m 0644 %{_libdir}/libatomic.so* %{buildroot}%{TIZEN_RTC_UT_DIR}
+%endif
+%endif
+
 %if 0%{?build_tizen_ppapi_extension_unittests}
 mkdir -p %{buildroot}/opt/usr/utc_exec/
 install -m 0755 -p -D %{OUTPUT_FOLDER}/efl_integration_unittests %{buildroot}/opt/usr/utc_exec/
@@ -1828,3 +1867,16 @@ rm -rf %{TIZEN_V8_UT_DIR}/v8
 %{TIZEN_V8_UT_DIR}/bin
 %{TIZEN_V8_UT_DIR}/v8-test-data.tar.bz2
 %endif
+
+%if 0%{?build_rtc_unittests}
+%files rtc_unittests
+%manifest ./packaging/chromium-tizen_rtc_unittests.manifest
+%{TIZEN_RTC_UT_DIR}/call_unittests
+%{TIZEN_RTC_UT_DIR}/modules_unittests
+%{TIZEN_RTC_UT_DIR}/peerconnection_unittests
+%{TIZEN_RTC_UT_DIR}/rtc_pc_unittests
+%{TIZEN_RTC_UT_DIR}/video_unittests
+%if %{__use_clang} == 1
+%{TIZEN_RTC_UT_DIR}/libatomic.so*
+%endif
+%endif
diff --git a/packaging/chromium-tizen_rtc_unittests.manifest b/packaging/chromium-tizen_rtc_unittests.manifest
new file mode 100644 (file)
index 0000000..4ef1828
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+  <request>
+    <domain name="_"/>
+  </request>
+</manifest>
\ No newline at end of file
diff --git a/run_webrtc_unittests.sh b/run_webrtc_unittests.sh
new file mode 100755 (executable)
index 0000000..e35e131
--- /dev/null
@@ -0,0 +1,193 @@
+#!/bin/bash -e
+
+OUT_DIR=$1
+
+if [ ! -d $OUT_DIR ]; then
+  echo "ERROR: ${OUT_DIR} doesn't point to valid directory"
+  exit 1
+fi
+
+echo "Running: ${OUT_DIR}/call_unittests"
+${OUT_DIR}/call_unittests
+
+# TODO(vd.wasm) Investigate failures of excluded tests under GBS
+echo "Running: ${OUT_DIR}/modules_unittests"
+${OUT_DIR}/modules_unittests --gtest_filter=-\
+AcmSenderBitExactnessOldApi*:\
+AcmSetBitRateNewApi*:\
+AgcManagerDirectParametrizedTest.DisabledAnalogAgcDoesNotAdaptUpwards*:\
+AgcManagerDirectParametrizedTest.EmptyRmsErrorOverrideHasNoEffect*:\
+AgcManagerDirectParametrizedTest.NonEmptyRmsErrorOverrideHasEffect*:\
+AlignmentMixer*:\
+ApmConfiguration*:\
+ApmTest*:\
+AudioEncoderCngDeathTest*:\
+AudioEncoderCopyRedDeathTest.NullSpeechEncoder*:\
+AudioEncoderOpusTest.OpusDtxFilteringHighEnergyRefreshPackets:\
+BandwidthAdaptationTest.BandwidthAdaptationTest:\
+CngDeathTest*:\
+CngTest*:\
+CommonFormats/AudioProcessingTest*:\
+DebugDumpTest*:\
+DifferentInputLengths*:\
+EchoControlMobileBitExactnessTest*:\
+EchoPathDelayEstimator*:\
+EchoRemover*:\
+ExpandTest*:\
+GainController2.CheckEqualResultFromInjectedVadProbabilityWithAdaptiveDigitalController:\
+GainController2.CheckFinalGainWithAdaptiveDigitalController:\
+GainController2.CheckInjectedVadProbabilityUsedWithAdaptiveDigitalController:\
+InputVolumeControllerParametrizedTest.EmptyRmsErrorHasNoEffect*:\
+InputVolumeControllerTest*:\
+LoudnessHistogramTest.ActiveCircularBuffer:\
+LoudnessHistogramTest.InactiveCircularBuffer:\
+MultiChannel/CoarseFilterUpdateGainOneTwoEightRenderChannels.GainCausesFilterToConverge*:\
+MultiChannel/NetEqStereoTest*:\
+Multistream/OpusTest.OpusCbr*:\
+Multistream/OpusTest.OpusDecodeInit*:\
+Multistream/OpusTest.OpusDecodePlc*:\
+Multistream/OpusTest.OpusDecodeRepacketized*:\
+Multistream/OpusTest.OpusDtx*:\
+Multistream/OpusTest.OpusDurationEstimation*:\
+Multistream/OpusTest.OpusEncodeDecode*:\
+Multistream/OpusTest.OpusSetBandwidth*:\
+NetEqBgnTest.RunTest:\
+NetEqDecoderPlc*:\
+NetEqNoTimeStretchingMode.RunTest:\
+NonDebugMultiChannel/SubtractorMultiChannelUpToEightRender.Convergence*:\
+NonDebugMultiChannel/SubtractorMultiChannelUpToFourRender.NonConvergenceOnUncorrelatedSignals*:\
+PacketBufferTest.FramesAfterClear:\
+Param/AudioEncoderOpusTest.EncodeAtMinBitrate*:\
+Param/AudioEncoderOpusTest.OpusFlagDtxAsNonSpeech*:\
+PitchBasedVadTest.VoicingProbabilityTest:\
+RnnVadTest*:\
+Singlestream/OpusTest.OpusCbr*:\
+Singlestream/OpusTest.OpusDecodeInit*:\
+Singlestream/OpusTest.OpusDecodePlc*:\
+Singlestream/OpusTest.OpusDecodeRepacketized*:\
+Singlestream/OpusTest.OpusDtx*:\
+Singlestream/OpusTest.OpusDurationEstimation*:\
+Singlestream/OpusTest.OpusEncodeDecode*:\
+Singlestream/OpusTest.OpusSetBandwidth*:\
+StandaloneVadTest.ActivityDetection:\
+TimeStretchTest*:\
+TransientDetectorTest.CorrectnessBasedOnFiles:\
+TransientFileUtilsTest*:\
+VoiceActivityDetectorTest.Speech16kHzHasHighVoiceProbabilities:\
+VoiceActivityDetectorTest.Speech32kHzHasHighVoiceProbabilities:\
+WPDTreeTest.CorrectnessBasedOnMatlabFiles:\
+NoiseSuppressor.IdenticalChannelEffects:\
+ReceiveSideCongestionControllerTest.ConvergesToCapacity:\
+ReceiveSideCongestionControllerTest.IsFairToTCP:\
+BandwidthQualityScalerTest.*:\
+GoogCcScenario.*:\
+PccNetworkControllerTest.*:\
+FrameCombinerDeathTest.*:\
+TestAudioDeviceModuleTest.*:\
+TestAudioDeviceTest.*:\
+AudioNetworkAdaptorImplTest.*:\
+TaskQueuePacedSenderTest.*:\
+ScreenshareLayerTest.*:\
+Param/AudioEncoderOpusTest.PacketLossFractionSmoothedOnSetUplinkPacketLossFraction*:\
+Param/AudioEncoderOpusTest.UpdateUplinkBandwidthInAudioNetworkAdaptor*:\
+RtpSenderVideoFrameTransformerDelegateTest.OnTransformedFrameCallsSenderSendVideo:\
+RtpSenderVideoFrameTransformerDelegateTest.ReceiverFrameConvertedToSenderFrame:\
+RtpRtcpImpl2Test.*:\
+ControllerManagerTest.ReorderBeyondMinReordingTimeAndMinDistance:\
+ControllerManagerTest.DebugDumpLoggedWhenCreateFromConfigString:\
+ControllerManagerTest.CreateFromConfigStringAndCheckReordering:\
+_/MatchedFilterTest*:\
+DataChannelIntegrationTest/DataChannelIntegrationTest.*:\
+PeerConnectionIntegrationTest/PeerConnectionIntegrationTest.*:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.*
+
+
+# TODO(vd.wasm) Investigate failures of excluded tests under GBS
+echo "Running: ${OUT_DIR}/peerconnection_unittests"
+${OUT_DIR}/peerconnection_unittests --gtest_filter=-\
+PeerConnectionEncodingsIntegrationTest.VP8_FallbackFromSvcResultsInL1T2:\
+PeerConnectionFieldTrialTest.ApplyFakeNetworkConfig:\
+PeerConnectionIntegrationTestUnifiedPlan.RenegotiateManyAudioTransceivers:\
+PeerConnectionIntegrationTestUnifiedPlan.RenegotiateManyVideoTransceiversAndWatchAudioDelay:\
+RTCStatsIntegrationTest.GetStatsFromCaller:\
+RTCStatsIntegrationTest.GetStatsFromCallee:\
+RTCStatsIntegrationTest.GetStatsWithReceiverSelector:\
+RTCStatsIntegrationTest.GetStatsWithSenderSelector:\
+PeerConnectionEncodingsIntegrationTest.VP9_LegacySvcWhenScalabilityModeNotSpecified:\
+PeerConnectionEncodingsIntegrationTest.VP9_StandardSvcWithSingleActiveEncoding:\
+RTCStatsCollectorTest.CachedStatsReports:\
+RTCStatsCollectorTest.MultipleCallbacksWithInvalidatedCacheInBetween:\
+RTCStatsCollectorTest.CertificateStatsCache:\
+RtpSenderReceiverTest.LocalAudioSourceOptionsApplied:\
+PeerConnectionIntegrationTest/PeerConnectionIntegrationTest.MediaContinuesFlowingAfterIceRestart/0:\
+PeerConnectionIntegrationTest/PeerConnectionIntegrationTest.RtcEventLogOutputWriteCalled/0:\
+PeerConnectionIntegrationTest/PeerConnectionIntegrationTest.RtcEventLogOutputWriteCalled/1:\
+PeerConnectionIntegrationTest/PeerConnectionIntegrationTest.RtcEventLogOutputWriteCalledOnStop/0:\
+PeerConnectionIntegrationTest/PeerConnectionIntegrationTest.RtcEventLogOutputWriteCalledOnStop/1:\
+PeerConnectionIntegrationTest/PeerConnectionIntegrationTest.RtcEventLogOutputWriteCalledOnClose/0:\
+PeerConnectionIntegrationTest/PeerConnectionIntegrationTest.RtcEventLogOutputWriteCalledOnClose/1:\
+PeerConnectionIntegrationTest/PeerConnectionIntegrationTestWithFakeClock.EndToEndConnectionTimeWithTurnTurnPair/0:\
+PeerConnectionIntegrationTest/PeerConnectionIntegrationTestWithFakeClock.EndToEndConnectionTimeWithTurnTurnPair/1:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.Simulcast/VP9:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.Simulcast/AV1:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.SimulcastWithRequestedResolution/VP9:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.SimulcastWithRequestedResolution/AV1:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.SimulcastScaleDownByNoLongerPowerOfTwo/VP8:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.SimulcastScaleDownByNoLongerPowerOfTwo/VP9:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.SimulcastScaleDownByNoLongerPowerOfTwo/AV1:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.SimulcastEncodingStopWhenRtpEncodingChangeToInactive/VP8:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.SimulcastEncodingStopWhenRtpEncodingChangeToInactive/VP9:\
+StandardPath/PeerConnectionEncodingsIntegrationParameterizedTest.SimulcastEncodingStopWhenRtpEncodingChangeToInactive/AV1:\
+DtmfSenderTest.InsertDtmfWithDefaultCommaDelay
+
+echo "Running: ${OUT_DIR}/rtc_pc_unittests"
+${OUT_DIR}/rtc_pc_unittests
+
+
+echo "Running: ${OUT_DIR}/video_unittests"
+${OUT_DIR}/video_unittests --gtest_filter=-\
+MultiCodecReceiveTest.SingleStreamReceivesVp8H264:\
+MultiCodecReceiveTest.SingleStreamReceivesVp8H264WithTl:\
+MultiCodecReceiveTest.SingleStreamReceivesVp8Vp9H264:\
+MultiCodecReceiveTest.SingleStreamReceivesVp8Vp9H264WithTl:\
+FrameCadenceAdapterTest.*:\
+ZeroHertzLayerQualityConvergenceTest.*:\
+FrameInstrumentationGeneratorTest.FailsWhenCodecIsUnsupported:\
+CodecEndToEndTest.SendsAndReceivesVP9:\
+QualityScalingTest.AdaptsDownAndThenUpWithBalanced:\
+QualityScalingTest.AdaptsDownForHighQp_Vp8:\
+QualityScalingTest.AdaptsDownForLowStartBitrateAndThenUp:\
+QualityScalingTest.AdaptsDownForHighQp_HighestStreamActive_Vp8:\
+QualityScalingTest.AdaptsDownForHighQp_Vp9:\
+SendStatisticsProxyTest.TotalEncodedBytesTargetIncrementsBasedOnFrameRate:\
+SendStatisticsProxyTest.EncodeFrameRateInSubStream:\
+SendStatisticsProxyTest.EncodeFrameRateInSubStreamsVp8Simulcast:\
+SendStatisticsProxyTest.EncodeFrameRateInSubStreamsVp9Svc:\
+TaskQueueFrameDecodeSchedulerTest.FrameYieldedAfterSpecifiedPeriod:\
+TaskQueueFrameDecodeSchedulerTest.NegativeDecodeDelayIsRoundedToZero:\
+VideoReceiveStreamTimeoutTrackerTest.TimeoutAfterInitialPeriod:\
+VideoReceiveStreamTimeoutTrackerTest.TimeoutForDeltaFrame:\
+VideoReceiveStreamTimeoutTrackerTest.TimeoutForKeyframeWhenForced:\
+VideoReceiveStreamTimeoutTrackerTest.TotalTimeoutUsedInCallback:\
+VideoSendStreamImplTest.DoNotRegistersAsBitrateObserverOnStrayEncodedImage:\
+VideoSendStreamImplTest.DisablesPaddingOnPausedEncoder:\
+VideoSendStreamTest.SupportsFlexfecWithNackVp9:\
+VideoStreamEncoderTest.*:\
+VideoStreamEncoderFrameCadenceTest.*:\
+BalancedDegradationTest.*:\
+ReconfigureEncoderTest.*:\
+VideoStreamEncoderFrameCadenceRestrictionTest.*:\
+VideoReceiveStream2Test/VideoReceiveStream2Test.*:\
+ZeroHertzQueueOverloadTest.*:\
+FrameCadenceAdapterSimulcastLayersParamTest.*:\
+AdjustWithHeadroomVariations/EncoderBitrateAdjusterTest.*:\
+PerCodecType/EncoderOvershootDetectorTest.:*\
+VideoStreamBufferController/VideoStreamBufferControllerTest.*:\
+VideoStreamBufferController/LowLatencyVideoStreamBufferControllerTest.*:\
+AlignmentAndScaleFactors/ResolutionAlignmentTest.*:\
+ScalabilityMode/Vp9Test.*:\
+ScalabilityModeOn/Vp9Test.*:\
+VideoSendStreamTest.DoesUtilizeUlpfecForVp8WithNackEnabled:\
+VideoStreamEncoderInitialFrameDropperTest/VideoStreamEncoderInitialFrameDropperTest.*:\
+All/VideoStreamEncoderWithRealEncoderTest.*:\
+PerCodecType/EncoderOvershootDetectorTest.*
index 90e7c4813f48909da1f45129eb4a5b5f41edd78c..e886d24f1076b4e4e732bd72cef01c401789755d 100644 (file)
@@ -18,6 +18,7 @@
 #  }
 
 import("//build_overrides/build.gni")
+import("//tizen_src/build/config/tizen_features.gni")
 
 declare_args() {
   absl_build_tests = build_with_chromium
@@ -59,7 +60,7 @@ template("absl_source_set") {
         # banned targets like absl/types:any. A few targets require exceptions.
         # TODO(crbug.com/1096380): Consider replacing build_with_chromium with
         # is_component_build for a narrower, more accurate condition.
-        if (build_with_chromium) {
+        if (build_with_chromium && !tizen_rtc_unittests) {
           visibility = [
             # Abseil itself.
             "//third_party/abseil-cpp/*",
index 9229a89f895e5b64ba47eb52d49225db114991e6..7a59f3eea5b42e8e93ee1680f1c560a4dccf994f 100644 (file)
@@ -75,7 +75,7 @@ rtc_source_set("enable_media_with_defaults") {
   ]
 }
 
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   rtc_library("create_peerconnection_factory") {
     visibility = [ "*" ]
     allow_poison = [ "environment_construction" ]
@@ -661,7 +661,7 @@ if (rtc_include_tests) {
     ]
   }
 
-  if (!build_with_chromium) {
+  if (!build_with_chromium || tizen_rtc_unittests) {
     rtc_source_set("video_quality_test_fixture_api") {
       visibility = [ "*" ]
       testonly = true
@@ -1007,7 +1007,7 @@ rtc_source_set("sequence_checker") {
 }
 
 if (rtc_include_tests) {
-  if (rtc_enable_protobuf && !build_with_chromium) {
+  if (rtc_enable_protobuf && (!build_with_chromium || tizen_rtc_unittests)) {
     rtc_library("audioproc_f_api") {
       visibility = [ "*" ]
       testonly = true
index f5d44afe24f02979db87066b7e9a64199c09c87b..cf0c5656310f700ef80b60aaef7f40dac3ea48dc 100644 (file)
@@ -48,4 +48,8 @@ rtc_library("rtc_event_log_factory") {
     defines = [ "WEBRTC_ENABLE_RTC_EVENT_LOG" ]
     deps += [ "../../logging:rtc_event_log_impl" ]
   }
+
+  if (tizen_rtc_unittests) {
+    deps += [ "../../logging:rtc_event_log_impl" ]
+  }
 }
index bfe272d2a8ccdaad074b246e702db347b252759f..04f3a2efcd081f972a97eef16f3c976f429f738e 100644 (file)
@@ -17,7 +17,8 @@
 #include "api/field_trials_view.h"
 #include "api/rtc_event_log/rtc_event_log.h"
 
-#ifdef WEBRTC_ENABLE_RTC_EVENT_LOG
+#if defined(WEBRTC_ENABLE_RTC_EVENT_LOG) || \
+    WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS
 #include "logging/rtc_event_log/rtc_event_log_impl.h"
 #endif
 
@@ -25,7 +26,8 @@ namespace webrtc {
 
 absl::Nonnull<std::unique_ptr<RtcEventLog>> RtcEventLogFactory::Create(
     const Environment& env) const {
-#ifndef WEBRTC_ENABLE_RTC_EVENT_LOG
+#if !defined(WEBRTC_ENABLE_RTC_EVENT_LOG) && \
+    !WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS
   return std::make_unique<RtcEventLogNull>();
 #else
   if (env.field_trials().IsEnabled("WebRTC-RtcEventLogKillSwitch")) {
index 2876ab1307dabe313974d4d0c1cb82fa2d809197..3bed3df9931799e8832a86451ac290b7852d98b9 100644 (file)
@@ -495,7 +495,7 @@ rtc_library("fake_network") {
 }
 
 if (rtc_include_tests) {
-  if (!build_with_chromium) {
+  if (!build_with_chromium || tizen_rtc_unittests) {
     rtc_library("call_tests") {
       testonly = true
 
@@ -616,6 +616,12 @@ if (rtc_include_tests) {
         "//third_party/abseil-cpp/absl/strings:string_view",
         "//third_party/abseil-cpp/absl/types:variant",
       ]
+
+      if (tizen_rtc_unittests) {
+        # Below test depends on LogSink which is not defined
+        # when building for Tizen.
+        sources -= [ "bitrate_estimator_tests.cc" ]
+      }
     }
 
     rtc_library("call_perf_tests") {
@@ -700,6 +706,18 @@ if (rtc_include_tests) {
         "//third_party/abseil-cpp/absl/strings:string_view",
       ]
     }
+
+    if (tizen_rtc_unittests) {
+      rtc_test("call_unittests") {
+        testonly = true
+        deps = [
+          ":call_tests",
+          "../system_wrappers:field_trial_for_tests",
+          "../system_wrappers:metrics_for_tests",
+          "../test:test_main",
+        ]
+      }
+    }
   }
 
   # TODO(eladalon): This should be moved, as with the TODO for `rtp_interfaces`.
index 2c8e9d37073352f7db2bba9eb1c621f090348b5b..dcafe348386f6a94baa764e33995233c12c58419 100644 (file)
@@ -554,7 +554,7 @@ TEST(RtpVideoSenderTest, DoesNotRetrasmitAckedPackets) {
 // stream sent along with a secondary untouched stream. The transport wide
 // feedback packets from the secondary stream allows the sending side to
 // detect and retreansmit the lost packets from the lossy stream.
-TEST(RtpVideoSenderTest, RetransmitsOnTransportWideLossInfo) {
+TEST(RtpVideoSenderTest, DISABLED_RetransmitsOnTransportWideLossInfo) {
   int rtx_packets;
   test::Scenario s(test_info_);
   test::CallClientConfig call_conf;
index 21f866d0eb2e857c3b00d9763ce0b28b7bc86bf9..1e0d3e4b3b4663d571b9051eccd58c1da8fc6317 100644 (file)
@@ -42,7 +42,7 @@ rtc_source_set("module_fec_api") {
   sources = [ "include/module_fec_types.h" ]
 }
 
-if (rtc_include_tests && !build_with_chromium) {
+if (rtc_include_tests && (!build_with_chromium || tizen_rtc_unittests)) {
   modules_tests_resources = [
     "../resources/audio_coding/testfile16kHz.pcm",
     "../resources/audio_coding/testfile32kHz.pcm",
@@ -229,6 +229,13 @@ if (rtc_include_tests && !build_with_chromium) {
       "video_coding/timing:timing_unittests",
     ]
 
+    if (tizen_rtc_unittests) {
+      deps += [
+        "../system_wrappers:field_trial_for_tests",
+        "../system_wrappers:metrics_for_tests",
+      ]
+    }
+
     if (rtc_desktop_capture_supported) {
       deps += [ "desktop_capture:desktop_capture_unittests" ]
     }
index c92a26fd0d09976656801966a78563a467c4bcc6..6e839f1b33209a5c7df40d64251a09a5b790cf8a 100644 (file)
@@ -1552,7 +1552,7 @@ if (rtc_include_tests) {
     deps = [ ":g722" ]
   }
 
-  if (!build_with_chromium) {
+  if (!build_with_chromium || tizen_rtc_unittests) {
     rtc_executable("ilbc_test") {
       testonly = true
 
index 257aa6bfd6179cc97c148d794fc69f99eee50a14..a5a3136b9432742e350f32bec2e268a8b1d342af 100644 (file)
@@ -171,7 +171,7 @@ rtc_source_set("audio_device_module_from_input_and_output") {
   }
 }
 
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   rtc_library("test_audio_device_module") {
     visibility = [ "*" ]
     sources = [
@@ -221,7 +221,7 @@ rtc_library("audio_device_dummy") {
   ]
 }
 
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   rtc_library("file_audio_device") {
     visibility = [ "*" ]
     sources = [
@@ -397,7 +397,7 @@ rtc_library("audio_device_impl") {
     defines = [ "WEBRTC_DUMMY_AUDIO_BUILD" ]
   }
 
-  if (!build_with_chromium) {
+  if (!build_with_chromium || tizen_rtc_unittests) {
     deps += [ ":file_audio_device" ]
 
     # TODO(titovartem): remove after downstream is fixed
@@ -439,7 +439,7 @@ rtc_source_set("mock_audio_device") {
   ]
 }
 
-if (rtc_include_tests && !build_with_chromium) {
+if (rtc_include_tests && (!build_with_chromium || tizen_rtc_unittests)) {
   rtc_library("audio_device_unittests") {
     testonly = true
 
index 1f4bc7e7dbde1dea7eec87c14fec729aaff12784..387800e2e12f13e0f23d69fa073b083109ee891a 100644 (file)
@@ -298,7 +298,7 @@ if (rtc_include_tests) {
     ]
   }
 
-  if (!build_with_chromium) {
+  if (!build_with_chromium || tizen_rtc_unittests) {
     group("audio_processing_tests") {
       testonly = true
       deps = [
@@ -492,7 +492,7 @@ if (rtc_include_tests) {
     ]
   }
 
-  if (rtc_enable_protobuf && !build_with_chromium) {
+  if (rtc_enable_protobuf && (!build_with_chromium || tizen_rtc_unittests)) {
     rtc_library("audioproc_f_impl") {
       testonly = true
       configs += [ ":apm_debug_dump" ]
index 543306e9d5be0f90fd6205391dc657035bc89c96..bf6f503c1ea04195ab3f33b355736e3d02121fde 100644 (file)
@@ -8,7 +8,7 @@
 
 import("../../../../webrtc.gni")
 
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   group("conversational_speech") {
     testonly = true
     deps = [ ":conversational_speech_generator" ]
index e53a829623c8a79636a9bfdb6d4528a5ce0ccd25..19758688badf5dcecf4c0c2e8c315b7671e1b5f3 100644 (file)
@@ -8,7 +8,7 @@
 
 import("../../../../webrtc.gni")
 
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   group("py_quality_assessment") {
     testonly = true
     deps = [
index 75e2761d5a5a2135dcdb855342317ff62a7e2435..301f2123c684dc73fee3e49b9bb6dbd33b3957c2 100644 (file)
@@ -58,7 +58,7 @@ rtc_library("voice_probability_delay_unit") {
 }
 
 if (rtc_include_tests) {
-  if (!build_with_chromium) {
+  if (!build_with_chromium || tizen_rtc_unittests) {
     rtc_executable("click_annotate") {
       testonly = true
       sources = [
index 2c007352350cb193b11722f627967b4b46b98815..e85c1b89b72497b9624741f483b34ac34d55c6d6 100644 (file)
@@ -38,7 +38,7 @@ rtc_library("congestion_controller") {
   ]
 }
 
-if (rtc_include_tests && !build_with_chromium) {
+if (rtc_include_tests && (!build_with_chromium || tizen_rtc_unittests)) {
   rtc_library("congestion_controller_unittests") {
     testonly = true
 
index f82a54ae8c2d862946cb07b2d874540faf37dc8f..0411dd292ca91729201eae1a58c2c5cd2b05fc52 100644 (file)
@@ -276,7 +276,7 @@ if (rtc_include_tests) {
       "//third_party/abseil-cpp/absl/strings:string_view",
     ]
   }
-  if (!build_with_chromium) {
+  if (!build_with_chromium || tizen_rtc_unittests) {
     rtc_library("goog_cc_unittests") {
       testonly = true
 
index 0af1baff011d650bacfba68573ca7b6f696909d2..ad6e29f0ba892ebe89d1a58ad15b52b369bb7c49 100644 (file)
@@ -92,7 +92,7 @@ rtc_library("bitrate_controller") {
   ]
 }
 
-if (rtc_include_tests && !build_with_chromium) {
+if (rtc_include_tests && (!build_with_chromium || tizen_rtc_unittests)) {
   rtc_library("pcc_unittests") {
     testonly = true
     sources = [
index dd78033b209b816e47a44fcb593ccee401e2502f..4e5005ab5dd01979ba0480bc92175b6d81911f54 100644 (file)
@@ -100,7 +100,7 @@ TEST(ReceiveSideCongestionControllerTest, SendsRfc8888FeedbackIfForced) {
   EXPECT_CALL(rtcp_sender, Call);
   RtpPacketReceived packet;
   packet.set_arrival_time(clock.CurrentTime());
-  controller.OnReceivedPacket(packet, MediaType::VIDEO);
+  controller.OnReceivedPacket(clock.CurrentTime(), packet, MediaType::VIDEO);
   TimeDelta next_process = controller.MaybeProcess();
   clock.AdvanceTime(next_process);
   next_process = controller.MaybeProcess();
@@ -129,7 +129,7 @@ TEST(ReceiveSideCongestionControllerTest, SendsRfc8888FeedbackIfEnabled) {
 
   RtpPacketReceived packet;
   packet.set_arrival_time(clock.CurrentTime());
-  controller.OnReceivedPacket(packet, MediaType::VIDEO);
+  controller.OnReceivedPacket(clock.CurrentTime(), packet, MediaType::VIDEO);
   TimeDelta next_process = controller.MaybeProcess();
   clock.AdvanceTime(next_process);
   next_process = controller.MaybeProcess();
@@ -150,7 +150,7 @@ TEST(ReceiveSideCongestionControllerTest,
   EXPECT_CALL(rtcp_sender, Call).Times(0);
   RtpPacketReceived packet;
   packet.set_arrival_time(clock.CurrentTime());
-  controller.OnReceivedPacket(packet, MediaType::VIDEO);
+  controller.OnReceivedPacket(clock.CurrentTime(), packet, MediaType::VIDEO);
   TimeDelta next_process = controller.MaybeProcess();
   clock.AdvanceTime(next_process);
   next_process = controller.MaybeProcess();
index e9e8ce9fcc0dbcd1bdabba58a91366f0f4ab9641..39c2eadd98822c503050079dd7a37cd1554e578f 100644 (file)
 #include "test/gmock.h"
 #include "test/gtest.h"
 
+#if defined(WEBRTC_TIZEN_TV)
+// This tests runs logic inside RTC_DCHECK* macros, so ensure they are enabled.
+#undef RTC_DCHECK
+#define RTC_DCHECK(condition) RTC_CHECK(condition)
+#endif
+
 namespace webrtc {
 namespace {
 
index 497f96d8514e85e823199048c02a288f8a7136ab..5e1bd88f25cadfbba5ab9934cdba64f29b63b172 100644 (file)
@@ -48,10 +48,21 @@ bool PacketInfoEqual(const CongestionControlFeedback::PacketInfo& a,
   RTC_LOG_IF(LS_INFO, !equal)
       << " Not equal got ssrc: " << a.ssrc << ", seq: " << a.sequence_number
       << " arrival_time_offset: " << a.arrival_time_offset.ms_or(-1)
-      << " ecn: " << a.ecn << " expected ssrc:" << b.ssrc
-      << ", seq: " << b.sequence_number
+      << " ecn: " <<
+#if defined(WEBRTC_TIZEN_TV)
+      static_cast<int>(a.ecn)
+#else
+      a.ecn
+#endif
+      << " expected ssrc:" << b.ssrc << ", seq: " << b.sequence_number
       << " arrival_time_offset: " << b.arrival_time_offset.ms_or(-1)
-      << " ecn: " << b.ecn;
+      << " ecn: " <<
+#if defined(WEBRTC_TIZEN_TV)
+      static_cast<int>(b.ecn);
+#else
+      b.ecn;
+#endif
+
   return equal;
 }
 
index 264d613f4a2a042131faf323ea739200522ce4b7..71446b846291f71d6c8df522d8b1f4f43b337e8e 100644 (file)
 #include "test/gmock.h"
 #include "test/gtest.h"
 
+#if defined(WEBRTC_TIZEN_TV)
+// This tests runs logic inside RTC_DCHECK* macros, so ensure they are enabled.
+#undef RTC_DCHECK
+#undef RTC_DCHECK_EQ
+#define RTC_DCHECK(condition) RTC_CHECK(condition)
+#define RTC_DCHECK_EQ(v1, v2) RTC_CHECK_EQ(v1, v2)
+#endif
+
 namespace webrtc {
 namespace {
 
index 29a7bea9d9bc3905cfb8f157e1776474f83a051c..a6dca706f0966636955419442c43f8aaed273c25 100644 (file)
@@ -49,7 +49,7 @@ rtc_library("video_capture_module") {
   ]
 }
 
-if (!build_with_chromium || is_linux || is_chromeos) {
+if (!build_with_chromium || is_linux || is_chromeos || tizen_rtc_unittests) {
   rtc_source_set("video_capture_internal_impl") {
     visibility = [ "*" ]
     deps = [
index 396255b1357ae59300af023f7fc6c80d1e740770..05368f0089df8962423cd186bbf20c4585baf2d8 100644 (file)
@@ -1242,8 +1242,13 @@ if (rtc_include_tests) {
       "svc:svc_rate_allocator_tests",
       "timing:jitter_estimator",
       "timing:timing_module",
-      "//third_party/abseil-cpp/absl/types:variant",
     ]
+
+    if (tizen_rtc_unittests) {
+      deps -= [ "../../third_party/libyuv:libyuv" ]
+      deps += [ "//third_party/libyuv" ]
+    }
+
     if (rtc_build_libvpx) {
       deps += [ rtc_libvpx_dir ]
     }
index f9de7813fd48c91718673a6aca919f8f1b5197ce..12940c7fbe6b73889f9cd730845c870cc3c3d6c7 100644 (file)
@@ -1945,7 +1945,7 @@ rtc_source_set("libjingle_peerconnection") {
   ]
 }
 
-if (rtc_include_tests && !build_with_chromium) {
+if (rtc_include_tests && (!build_with_chromium || tizen_rtc_unittests)) {
   rtc_test("rtc_pc_unittests") {
     testonly = true
 
@@ -2094,6 +2094,18 @@ if (rtc_include_tests && !build_with_chromium) {
         "//testing/android/native_test:native_test_support",
       ]
     }
+
+    if (tizen_rtc_unittests) {
+      deps -= [
+        "../system_wrappers:metrics",
+      ]
+
+      deps += [
+        "../rtc_base/synchronization:yield_policy",
+        "../system_wrappers:field_trial_for_tests",
+        "../system_wrappers:metrics_for_tests",
+      ]
+    }
   }
 
   rtc_library("peerconnection_perf_tests") {
@@ -2427,6 +2439,18 @@ if (rtc_include_tests && !build_with_chromium) {
       "//third_party/abseil-cpp/absl/strings",
     ]
 
+    if (tizen_rtc_unittests) {
+      deps -= [
+        "../system_wrappers:metrics",
+      ]
+
+      deps += [
+        "../rtc_base/synchronization:yield_policy",
+        "../system_wrappers:field_trial_for_tests",
+        "../system_wrappers:metrics_for_tests",
+      ]
+    }
+
     if (is_android) {
       use_default_launcher = false
       deps += [
index d6c79efae96d62d172a1c9d2b2e6982ead010946..fe1539df866413c4249e61bbe9017201542e9439 100644 (file)
@@ -23,7 +23,10 @@ static const char kStreamId1[] = "local_stream_1";
 static const char kVideoTrackId[] = "dummy_video_cam_1";
 static const char kAudioTrackId[] = "dummy_microphone_1";
 
+#if !defined(WEBRTC_TIZEN_TV)
 using rtc::scoped_refptr;
+#endif
+
 using ::testing::Exactly;
 
 namespace webrtc {
@@ -81,9 +84,9 @@ class MediaStreamTest : public ::testing::Test {
   }
 
   rtc::AutoThread main_thread_;
-  scoped_refptr<MediaStreamInterface> stream_;
-  scoped_refptr<AudioTrackInterface> audio_track_;
-  scoped_refptr<VideoTrackInterface> video_track_;
+  rtc::scoped_refptr<MediaStreamInterface> stream_;
+  rtc::scoped_refptr<AudioTrackInterface> audio_track_;
+  rtc::scoped_refptr<VideoTrackInterface> video_track_;
 };
 
 TEST_F(MediaStreamTest, GetTrackInfo) {
@@ -91,7 +94,7 @@ TEST_F(MediaStreamTest, GetTrackInfo) {
   ASSERT_EQ(1u, stream_->GetAudioTracks().size());
 
   // Verify the video track.
-  scoped_refptr<MediaStreamTrackInterface> video_track(
+  rtc::scoped_refptr<MediaStreamTrackInterface> video_track(
       stream_->GetVideoTracks()[0]);
   EXPECT_EQ(0, video_track->id().compare(kVideoTrackId));
   EXPECT_TRUE(video_track->enabled());
@@ -105,7 +108,7 @@ TEST_F(MediaStreamTest, GetTrackInfo) {
   EXPECT_TRUE(video_track->enabled());
 
   // Verify the audio track.
-  scoped_refptr<MediaStreamTrackInterface> audio_track(
+  rtc::scoped_refptr<MediaStreamTrackInterface> audio_track(
       stream_->GetAudioTracks()[0]);
   EXPECT_EQ(0, audio_track->id().compare(kAudioTrackId));
   EXPECT_TRUE(audio_track->enabled());
@@ -139,12 +142,14 @@ TEST_F(MediaStreamTest, RemoveTrack) {
 }
 
 TEST_F(MediaStreamTest, ChangeVideoTrack) {
-  scoped_refptr<VideoTrackInterface> video_track(stream_->GetVideoTracks()[0]);
+  rtc::scoped_refptr<VideoTrackInterface> video_track(
+      stream_->GetVideoTracks()[0]);
   ChangeTrack(video_track.get());
 }
 
 TEST_F(MediaStreamTest, ChangeAudioTrack) {
-  scoped_refptr<AudioTrackInterface> audio_track(stream_->GetAudioTracks()[0]);
+  rtc::scoped_refptr<AudioTrackInterface> audio_track(
+      stream_->GetAudioTracks()[0]);
   ChangeTrack(audio_track.get());
 }
 
index 774e08b4f6f7ee995e621ebeeda5ee98881bd7d6..0877f9f2b82d521900fab3f217011fc3a2151e4a 100644 (file)
@@ -3340,7 +3340,14 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan,
     ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
     auto elapsed_time_ms = rtc::TimeMillis() - start_time_ms;
     RTC_LOG(LS_INFO) << "Renegotiating took " << elapsed_time_ms << " ms";
+#if defined(WEBRTC_TIZEN_TV)
+    // When run in GBS or on TV board directly it usually takes more than
+    // 1 second. Give it some additional margin in case the build server that
+    // runs the tests is heavy loaded.
+    ASSERT_GT(10000, elapsed_time_ms)
+#else
     ASSERT_GT(1000, elapsed_time_ms)
+#endif
         << "Video transceivers: Negotiation took too long after "
         << current_size << " tracks added";
   }
@@ -3383,7 +3390,14 @@ TEST_F(PeerConnectionIntegrationTestUnifiedPlan,
     auto elapsed_time_ms = rtc::TimeMillis() - start_time_ms;
     RTC_LOG(LS_INFO) << "Renegotiating took " << elapsed_time_ms << " ms";
     // This is a guard against the test using excessive amounts of time.
+#if defined(WEBRTC_TIZEN_TV)
+    // When run in GBS or on TV board directly it usually takes more than
+    // 5 seconds. Give it some additional margin in case the build server that
+    // runs the tests is heavy loaded.
+    ASSERT_GT(20000, elapsed_time_ms)
+#else
     ASSERT_GT(5000, elapsed_time_ms)
+#endif
         << "Video transceivers: Negotiation took too long after "
         << current_size << " tracks added";
     caller()->UpdateDelayStats("caller reception", current_size);
index 16e23e70b7e91e1dacb7d2f5774c030fdb2f3061..2c3c2e4e5d693e98b19262293fd4697b659b6b83 100644 (file)
@@ -1335,11 +1335,15 @@ void RTCStatsCollector::MergeNetworkReport_s() {
   cached_report_ = partial_report_;
   partial_report_ = nullptr;
   transceiver_stats_infos_.clear();
+  // The following trace is required by some tests, so enable it
+  // but only for tests.
+#if WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS
   // Trace WebRTC Stats when getStats is called on Javascript.
   // This allows access to WebRTC stats from trace logs. To enable them,
   // select the "webrtc_stats" category when recording traces.
   TRACE_EVENT_INSTANT1("webrtc_stats", "webrtc_stats", TRACE_EVENT_SCOPE_GLOBAL,
                        "report", cached_report_->ToJson());
+#endif  // if WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS
 
   // Deliver report and clear `requests_`.
   std::vector<RequestInfo> requests;
index 2a38fcaf3e093121e9ac67364ef4e000243acbaa..bd05c8f5264955a2cf869b14d5051904d413f09b 100644 (file)
@@ -744,7 +744,10 @@ void AudioRtpSender::SetSend() {
     return;
   }
   cricket::AudioOptions options;
-#if !defined(WEBRTC_CHROMIUM_BUILD) && !defined(WEBRTC_WEBKIT_BUILD)
+  // Needed for unit testing and thus enabled via
+  // WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS
+#if (!defined(WEBRTC_CHROMIUM_BUILD) && !defined(WEBRTC_WEBKIT_BUILD)) || \
+    WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS
   // TODO(tommi): Remove this hack when we move CreateAudioSource out of
   // PeerConnection.  This is a bit of a strange way to apply local audio
   // options since it is also applied to all streams/channels, local or remote.
index 594efb05bb9c8f3f198d274085b169477e5aeda5..bfd8ad081a806b9a59f927ceacb30b8be39854a5 100644 (file)
@@ -8,7 +8,7 @@
 
 import("../../../../webrtc.gni")
 
-if (rtc_include_tests && !build_with_chromium) {
+if (rtc_include_tests && (!build_with_chromium || tizen_rtc_unittests)) {
   copy("noise_tracks") {
     testonly = true
     sources = [ "noise_tracks/city.wav" ]
index b18114f10704d88a041d3bcde94077d1ed6f6677..e36f7b3d81e3e30bae5f54f217b2aa18affd486f 100644 (file)
@@ -43,6 +43,20 @@ if (rtc_include_tests) {
       "//test:fileutils",
       "//test:test_support",
     ]
+
+    if (tizen_rtc_unittests) {
+      deps -= [
+        "//rtc_base:checks",
+        "//test:fileutils",
+        "//test:test_support",
+      ]
+
+      deps += [
+        "..:checks",
+        "../../test:fileutils",
+        "../../test:test_support",
+      ]
+    }
   }
 }
 
index 2c99a6275d101a349eeb56deceee4965d1e14cf2..5782a3310c267e4b1e07467e9c3dc40641159308 100644 (file)
@@ -277,7 +277,7 @@ if (!is_component_build) {
 
 # Only expose the targets needed by Chromium (e.g. frame_analyzer) to avoid
 # building a lot of redundant code as part of Chromium builds.
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   rtc_executable("psnr_ssim_analyzer") {
     testonly = true
     sources = [ "psnr_ssim_analyzer/psnr_ssim_analyzer.cc" ]
@@ -430,6 +430,22 @@ if (!build_with_chromium) {
         "//third_party/abseil-cpp/absl/strings",
         "//third_party/abseil-cpp/absl/strings:string_view",
       ]
+
+      if (tizen_rtc_unittests) {
+        deps -= [
+          "//api/units:time_delta",
+          "//logging:rtc_event_log_parser",
+          "//rtc_base:protobuf_utils",
+          "//rtc_base:safe_conversions",
+        ]
+
+        deps += [
+          "../api/units:time_delta",
+          "../logging:rtc_event_log_parser",
+          "../rtc_base:protobuf_utils",
+          "../rtc_base:safe_conversions",
+        ]
+      }
     }
 
     rtc_library("event_log_visualizer_bindings_unittest") {
@@ -443,6 +459,22 @@ if (!build_with_chromium) {
         "//test:fileutils",
         "//test:test_support",
       ]
+
+      if (tizen_rtc_unittests) {
+        deps -= [
+          "//rtc_base:protobuf_utils",
+          "//rtc_base/system:file_wrapper",
+          "//test:fileutils",
+          "//test:test_support",
+        ]
+
+        deps += [
+          "../rtc_base:protobuf_utils",
+          "../rtc_base/system:file_wrapper",
+          "../test:fileutils",
+          "../test:test_support",
+        ]
+      }
     }
   }
 
@@ -476,11 +508,50 @@ if (!build_with_chromium) {
       "//third_party/abseil-cpp/absl/flags:usage",
       "//third_party/abseil-cpp/absl/strings:strings",
     ]
+    if (tizen_rtc_unittests) {
+      deps -= [
+        "//api:create_frame_generator",
+        "//api:frame_generator_api",
+        "//api/environment",
+        "//api/environment:environment_factory",
+        "//api/video:builtin_video_bitrate_allocator_factory",
+        "//api/video_codecs:builtin_video_decoder_factory",
+        "//api/video_codecs:builtin_video_encoder_factory",
+        "//api/video_codecs:video_codecs_api",
+        "//common_video:common_video",
+        "//media:media_constants",
+        "//modules/video_coding:video_codec_interface",
+        "//modules/video_coding:video_coding_utility",
+        "//modules/video_coding/codecs/av1:av1_svc_config",
+        "//modules/video_coding/svc:scalability_mode_util",
+        "//rtc_base:logging",
+        "//test:y4m_frame_generator",
+      ]
+
+      deps += [
+        "../api:create_frame_generator",
+        "../api:frame_generator_api",
+        "../api/environment",
+        "../api/environment:environment_factory",
+        "../api/video:builtin_video_bitrate_allocator_factory",
+        "../api/video_codecs:builtin_video_decoder_factory",
+        "../api/video_codecs:builtin_video_encoder_factory",
+        "../api/video_codecs:video_codecs_api",
+        "../common_video:common_video",
+        "../media:media_constants",
+        "../modules/video_coding:video_codec_interface",
+        "../modules/video_coding:video_coding_utility",
+        "../modules/video_coding/codecs/av1:av1_svc_config",
+        "../modules/video_coding/svc:scalability_mode_util",
+        "../rtc_base:logging",
+        "../test:y4m_frame_generator",
+      ]
+    }
   }
 }
 
 if (rtc_include_tests) {
-  if (!build_with_chromium) {
+  if (!build_with_chromium || tizen_rtc_unittests) {
     if (rtc_enable_protobuf) {
       rtc_executable("event_log_visualizer") {
         # TODO(bugs.webrtc.org/14248): Remove once usage of std::tmpnam
index 5e66d4b0ef7267b4331b9100ea0e4f8784c93dbd..20b54bf2b5afad045eb62a6b9f92bcf91d70b24a 100644 (file)
@@ -95,6 +95,20 @@ rtc_library("field_trial") {
   ]
 }
 
+if (tizen_rtc_unittests) {
+  rtc_library("field_trial_for_tests") {
+    testonly = true
+    visibility = [ "*" ]
+    public = [ "include/field_trial.h" ]
+    sources = [ "source/field_trial.cc" ]
+    deps = [
+      "../rtc_base:checks",
+      "../rtc_base:logging",
+      "../rtc_base:stringutils",
+    ]
+  }
+}
+
 rtc_library("metrics") {
   visibility = [ "*" ]
   public = [ "include/metrics.h" ]
@@ -111,6 +125,19 @@ rtc_library("metrics") {
   ]
 }
 
+if (tizen_rtc_unittests) {
+  rtc_library("metrics_for_tests") {
+    testonly = true
+    visibility = [ "*" ]
+    public = [ "include/metrics.h" ]
+    sources = [ "source/metrics.cc" ]
+    deps = [
+      "../rtc_base:checks",
+      "../rtc_base/synchronization:mutex",
+    ]
+  }
+}
+
 rtc_library("denormal_disabler") {
   visibility = [ "*" ]
   public = [ "include/denormal_disabler.h" ]
index 33e920f8ba0739ee460a7b4860c7300363cacd75..2f895786817b43bda2d3d087b252355dae891763 100644 (file)
@@ -229,7 +229,7 @@ rtc_library("audio_test_common") {
   ]
 }
 
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   if (is_mac || is_ios) {
     rtc_library("video_test_mac") {
       testonly = true
@@ -570,7 +570,7 @@ if (rtc_include_tests) {
     }
   }
 
-  if (!build_with_chromium) {
+  if (!build_with_chromium || tizen_rtc_unittests) {
     rtc_library("resources_dir_flag") {
       testonly = true
       visibility = [ "*" ]
@@ -1177,7 +1177,7 @@ rtc_library("audio_codec_mocks") {
   ]
 }
 
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   rtc_library("copy_to_file_audio_capturer") {
     testonly = true
     sources = [
index 01ae59812fa40b81766bdfff7c83df9db2c10d79..16f757d46f1deed03534a9be87615cb3471b1ea3 100644 (file)
@@ -13,7 +13,7 @@ rtc_library("metric_metadata_keys") {
   sources = [ "metric_metadata_keys.h" ]
 }
 
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   group("e2e") {
     testonly = true
 
index e055703ecf5f85922e85e0fb5a9b372260ce2417..60f3b9b0c9a5f34a3f839c1ee2118b568b25d599 100644 (file)
@@ -8,7 +8,7 @@
 
 import("../../../../../webrtc.gni")
 
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   group("video_analyzer") {
     testonly = true
 
index fd250f4f73559c9da27518c734248f074a46cbb4..4093dfdf0a3abbb59a36bc5d0405ba43b8c6ac32 100644 (file)
@@ -8,7 +8,7 @@
 
 import("../../../../../../webrtc.gni")
 
-if (!build_with_chromium) {
+if (!build_with_chromium || tizen_rtc_unittests) {
   group("dvqa") {
     testonly = true
 
index f055bbdd9307bd7f1f3fb7006a1065e3af242da2..d9e699a1aacfca9801117caa3bcb7e4b9cd161f3 100644 (file)
@@ -21,7 +21,7 @@ rtc_library("column_printer") {
   ]
 }
 
-if (rtc_include_tests && !build_with_chromium) {
+if (rtc_include_tests && (!build_with_chromium || tizen_rtc_unittests)) {
   scenario_resources = [
     "../../resources/difficult_photo_1850_1110.yuv",
     "../../resources/photo_1850_1110.yuv",
index 08f9b4e23aa1f8b620d7b26f866d892a4f802864..bbd54e8c8b617a73a9b70dbdcb4dab26ed6596cb 100644 (file)
@@ -134,14 +134,18 @@ class TestMainImpl : public TestMain {
 
     // Default to LS_INFO, even for release builds to provide better test
     // logging.
+#if !defined(WEBRTC_TIZEN_TV)
     if (rtc::LogMessage::GetLogToDebug() > rtc::LS_INFO)
+#endif
       rtc::LogMessage::LogToDebug(rtc::LS_INFO);
 
     if (absl::GetFlag(FLAGS_verbose))
       rtc::LogMessage::LogToDebug(rtc::LS_VERBOSE);
 
+#if !defined(WEBRTC_TIZEN_TV)
     rtc::LogMessage::SetLogToStderr(absl::GetFlag(FLAGS_logs) ||
                                     absl::GetFlag(FLAGS_verbose));
+#endif
 
     // InitFieldTrialsFromString stores the char*, so the char array must
     // outlive the application.
index 2f4d83329a498281f134744152f3d866eb144629..e10ec1e5d5970c8b88495ae56fbce3d65f1c9cce 100644 (file)
@@ -484,7 +484,7 @@ if (rtc_include_tests) {
       "../test:test_support",
     ]
   }
-  if (!build_with_chromium) {
+  if (!build_with_chromium || tizen_rtc_unittests) {
     rtc_library("video_quality_test") {
       testonly = true
 
@@ -956,4 +956,17 @@ if (rtc_include_tests) {
       deps += [ "../media:rtc_media_base" ]
     }
   }
+
+  if (tizen_rtc_unittests) {
+      rtc_test("video_unittests") {
+        testonly = true
+        deps = [
+          ":video_tests",
+          "../rtc_base/synchronization:yield_policy",
+          "../system_wrappers:field_trial_for_tests",
+          "../system_wrappers:metrics_for_tests",
+          "../test:test_main",
+        ]
+      }
+    }
 }
index 573b6a545f077a46a0a25f47a65c045b4d57af09..e33bc86acdbdaa68760344dc241c12d93f94ba46 100644 (file)
@@ -8980,6 +8980,10 @@ class VideoStreamEncoderWithRealEncoderTest
       default:
         RTC_DCHECK_NOTREACHED();
     }
+#if defined(WEBRTC_TIZEN_TV)
+    // libaom might be disabled on tizen, so encoder may be null in this case.
+    ASSERT_NE(encoder, nullptr);
+#endif
     ConfigureEncoderAndBitrate(codec_type_, std::move(encoder));
   }
 
index f11bd75e6c4a3071cfc048a243d3520447a98e82..4dea6be9534037a9b2ffe3c6986a8183b76c2db4 100644 (file)
@@ -96,7 +96,7 @@ declare_args() {
   # will tell the pre-processor to remove the default definition of the
   # SystemTimeNanos() which is defined in rtc_base/system_time.cc. In
   # that case a new implementation needs to be provided.
-  rtc_exclude_system_time = build_with_chromium
+  rtc_exclude_system_time = build_with_chromium && !tizen_rtc_unittests
 
   # Setting this to false will require the API user to pass in their own
   # SSLCertificateVerifier to verify the certificates presented from a
@@ -205,7 +205,7 @@ declare_args() {
 
   # By default, use normal platform audio support or dummy audio, but don't
   # use file-based audio playout and record.
-  rtc_use_dummy_audio_file_devices = false
+  rtc_use_dummy_audio_file_devices = false || tizen_rtc_unittests
 
   # When set to true, replace the audio output with a sinus tone at 440Hz.
   # The ADM will ask for audio data from WebRTC but instead of reading real
@@ -310,7 +310,7 @@ declare_args() {
 
   # Chromium uses its own IO handling, so the internal ADM is only built for
   # standalone WebRTC.
-  rtc_include_internal_audio_device = !build_with_chromium
+  rtc_include_internal_audio_device = !build_with_chromium || tizen_rtc_unittests
 
   # Set this to true to enable the avx2 support in webrtc.
   # TODO: Make sure that AVX2 works also for non-clang compilers.
@@ -322,7 +322,7 @@ declare_args() {
 
   # Set this to true to build the unit tests.
   # Disabled when building with Chromium or Mozilla.
-  rtc_include_tests = !build_with_chromium && !build_with_mozilla
+  rtc_include_tests = (!build_with_chromium && !build_with_mozilla) || tizen_rtc_unittests
 
   # Set this to false to skip building code that also requires X11 extensions
   # such as Xdamage, Xfixes.
@@ -562,7 +562,7 @@ template("rtc_test") {
         "`absl_deps` has been deprecated, add your Abseil dependencies to the `deps` variable.")
 
     # Abseil dependencies need to be converted to //third_party/abseil-cpp:absl when build_with_chromium=true
-    if (build_with_chromium && defined(deps) && !use_efl) {
+    if (build_with_chromium && defined(deps) && !use_efl && !tizen_rtc_unittests) {
       absl_dependencies =
           filter_labels_include(deps, [ "//third_party/abseil-cpp/*" ])
       if (absl_dependencies != []) {
@@ -679,7 +679,7 @@ template("rtc_source_set") {
         "`absl_deps` has been deprecated, add your Abseil dependencies to the `deps` variable.")
 
     # Abseil dependencies need to be converted to //third_party/abseil-cpp:absl when build_with_chromium=true
-    if (build_with_chromium && defined(deps) && !use_efl) {
+    if (build_with_chromium && defined(deps) && !use_efl && !tizen_rtc_unittests) {
       absl_dependencies =
           filter_labels_include(deps, [ "//third_party/abseil-cpp/*" ])
       if (absl_dependencies != []) {
@@ -776,7 +776,7 @@ template("rtc_static_library") {
         "`absl_deps` has been deprecated, add your Abseil dependencies to the `deps` variable.")
 
     # Abseil dependencies need to be converted to //third_party/abseil-cpp:absl when build_with_chromium=true
-    if (build_with_chromium && defined(deps) && !use_efl) {
+    if (build_with_chromium && defined(deps) && !use_efl && !tizen_rtc_unittests) {
       absl_dependencies =
           filter_labels_include(deps, [ "//third_party/abseil-cpp/*" ])
       if (absl_dependencies != []) {
@@ -923,7 +923,7 @@ template("rtc_library") {
         "`absl_deps` has been deprecated, add your Abseil dependencies to the `deps` variable.")
 
     # Abseil dependencies need to be converted to //third_party/abseil-cpp:absl when build_with_chromium=true
-    if (build_with_chromium && defined(deps) && !use_efl) {
+    if (build_with_chromium && defined(deps) && !use_efl && !tizen_rtc_unittests) {
       absl_dependencies =
           filter_labels_include(deps, [ "//third_party/abseil-cpp/*" ])
       if (absl_dependencies != []) {
index c891ab4c300618d6e90be98cbb87de73132721aa..37ea27f3e74efe78baffe765f51e4a80f72a55ab 100644 (file)
@@ -188,6 +188,23 @@ component("webrtc_component") {
   public_deps = webrtc_public_deps
 }
 
+if (tizen_rtc_unittests) {
+  component("webrtc_test_component") {
+    configs += webrtc_configs
+    public_configs = webrtc_public_configs
+    public_deps = webrtc_public_deps
+    testonly = true
+
+    deps = [
+      "//third_party/webrtc/call:call_unittests",
+      "//third_party/webrtc/modules:modules_unittests",
+      "//third_party/webrtc/pc:peerconnection_unittests",
+      "//third_party/webrtc/pc:rtc_pc_unittests",
+      "//third_party/webrtc/video:video_unittests",
+    ]
+  }
+}
+
 source_set("init_webrtc") {
   visibility = [ ":*" ]
   sources = [
@@ -268,6 +285,9 @@ source_set("task_queue_factory") {
     "//third_party/webrtc/api/units:time_delta",
     "//third_party/webrtc/rtc_base/system:rtc_export",
   ]
+  if (tizen_rtc_unittests) {
+    deps += [ "//third_party/webrtc/rtc_base/synchronization:yield_policy" ]
+  }
 }
 
 source_set("metronome_like_task_queue_test") {
index 5f8c339fcc96926ca60ab0df725d338d5d2859f5..ca343d02497aaad5a60c0f4fa2faa35f88e548da 100644 (file)
@@ -6,6 +6,10 @@
 
 #include "base/time/time.h"
 
+#if WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS
+#include "rtc_base/synchronization/yield_policy.h"
+#endif
+
 namespace rtc {
 
 using base::WaitableEvent;
@@ -29,6 +33,11 @@ void Event::Reset() {
 }
 
 bool Event::Wait(webrtc::TimeDelta give_up_after) {
+#if WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS
+  // Needed by UnitTests.
+  ScopedYieldPolicy::YieldExecution();
+#endif
+
   if (give_up_after.IsPlusInfinity()) {
     event_.Wait();
     return true;
index 35ddac703f99ab2bd5d5eaa3038bbe63a5b74801..16acafb85a5e155d205947ef9f16b4a54a82b686 100644 (file)
@@ -100,6 +100,7 @@ declare_args() {
   tizen_tv_mch_pcm_use_ppi = false
   tizen_tv_mch_pcm_use_tinycompress = false
   tizen_tv_video_capture = false
+  tizen_rtc_unittests = false
 
   drm_mapi_aarch_64 = false
   tizen_tv_riscv64 = false