[WebRTC] Adding WebRTC video_engine unit tests 86/296586/2
authorAdam Bujalski <a.bujalski@samsung.com>
Wed, 21 Jun 2023 08:28:45 +0000 (10:28 +0200)
committerBot Blink <blinkbot@samsung.com>
Thu, 3 Aug 2023 04:25:12 +0000 (04:25 +0000)
[==========] 1054 tests from 77 test suites ran. (972211 ms total)
[  PASSED  ] 1034 tests.
[  FAILED  ] 20 tests, listed below:
[  FAILED  ] MultiCodecReceiveTest.SingleStreamReceivesVp8H264
[  FAILED  ] MultiCodecReceiveTest.SingleStreamReceivesVp8Vp9H264
[  FAILED  ] MultiCodecReceiveTest.SingleStreamReceivesVp8Vp9H264WithTl
[  FAILED  ] QualityScalingTest.AdaptsDownButNotUpWithBalancedIfBitrateNotEnough
[  FAILED  ] VideoStreamEncoderTest.ReportsVideoLayersAllocationForVP8Simulcast
[  FAILED  ] VideoStreamEncoderTest.ReportsVideoLayersAllocationForVP8WithMiddleLayerDisabled
[  FAILED  ] VideoStreamEncoderTest.ReportsVideoLayersAllocationForVP8WithMiddleAndHighestLayerDisabled
[  FAILED  ] VideoStreamEncoderTest.ReportsVideoLayersAllocationForV9SvcWithTemporalLayerSupport
[  FAILED  ] VideoStreamEncoderTest.ReportsVideoLayersAllocationForV9SvcWithoutTemporalLayerSupport
[  FAILED  ] VideoStreamEncoderTest.ReportsVideoLayersAllocationForVP9KSvcWithTemporalLayerSupport
[  FAILED  ] VideoStreamEncoderTest.ReportsVideoLayersAllocationForV9SvcWithLowestLayerDisabled
[  FAILED  ] VideoStreamEncoderTest.ReportsVideoLayersAllocationForV9SvcWithHighestLayerDisabled
[  FAILED  ] VideoStreamEncoderTest.ReportsVideoLayersAllocationForV9SvcWithAllButHighestLayerDisabled
[  FAILED  ] VideoStreamEncoderTest.ReportsVideoLayersAllocationForH264
[  FAILED  ] VideoStreamEncoderTest.ReportsUpdatedVideoLayersAllocationWhenBweChanges
[  FAILED  ] VideoStreamEncoderTest.ReportsUpdatedVideoLayersAllocationWhenResolutionChanges
[  FAILED  ] VideoStreamEncoderTest.DoesNotUpdateBitrateAllocationWhenSuspended
[  FAILED  ] All/VideoStreamEncoderWithRealEncoderTest.EncoderMapsNativeI420/AV1_AllowToI420, where GetParam() = (3, true)
[  FAILED  ] All/VideoStreamEncoderWithRealEncoderTest.EncoderMapsNativeNV12/AV1_AllowToI420, where GetParam() = (3, true)
[  FAILED  ] All/VideoStreamEncoderWithRealEncoderTest.HandlesLayerToggling/AV1_AllowToI420, where GetParam() = (3, true)

Bug: https://cam.sprc.samsung.pl/browse/VDGAME-249
Change-Id: I6dae9b81f1c3fd044b1700d0e2b1cdc32c83b4e5

packaging/chromium-efl.spec
third_party/webrtc/pc/BUILD.gn
third_party/webrtc/system_wrappers/BUILD.gn
third_party/webrtc/video/BUILD.gn
third_party/webrtc/video/test/mock_video_stream_encoder.h
third_party/webrtc/video/video_stream_encoder_unittest.cc
third_party/webrtc_overrides/BUILD.gn
third_party/webrtc_overrides/rtc_base/event.cc

index 1112fc0fa21d2c97af2791e62296b9ac734cb548..21a152285ce79375114b33fc155413ea39d1e7ff 100755 (executable)
@@ -865,6 +865,8 @@ v8/tools/run-tests.py --verbose --outdir=../%{OUTPUT_FOLDER} -j 1 --progress=ver
 %{OUTPUT_FOLDER}/call_unittests
 %{OUTPUT_FOLDER}/modules_unittests
 %{OUTPUT_FOLDER}/peerconnection_unittests
+# Video UnitTest takes some time, so don't run them under GBS
+# %{OUTPUT_FOLDER}/video_unittests
 %endif
 %endif
 
@@ -1141,6 +1143,7 @@ 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}/video_unittests %{buildroot}%{TIZEN_RTC_UT_DIR}
 %endif
 
 %if 0%{?build_tizen_media_unittests}
@@ -1607,4 +1610,5 @@ rm -rf %{TIZEN_V8_UT_DIR}/v8
 %{TIZEN_RTC_UT_DIR}/call_unittests
 %{TIZEN_RTC_UT_DIR}/modules_unittests
 %{TIZEN_RTC_UT_DIR}/peerconnection_unittests
+%{TIZEN_RTC_UT_DIR}/video_unittests
 %endif
index 35b1e58e4b02d6de2d725bf4588f523c096b4f96..ce6b318952af77fe22cb3e1a14d731ba4d245ac4 100644 (file)
@@ -1157,6 +1157,7 @@ if (rtc_include_tests && (!build_with_chromium || tizen_rtc_unittests)) {
       ]
 
       deps += [
+        "../rtc_base/synchronization:yield_policy",
         "../system_wrappers:field_trial_for_tests",
         "../system_wrappers:metrics_for_tests",
       ]
index de5b612d2eac2f8459d90100995f37ca93d0ed4d..af48a0baa61c5926614bc7b01cb7f55f90082b29 100644 (file)
@@ -100,10 +100,7 @@ rtc_library("field_trial") {
 
 rtc_library("field_trial_for_tests") {
   testonly = true
-  visibility = [
-    "//third_party/webrtc/call:call_unittests",
-    "//third_party/webrtc/pc:peerconnection_unittests",
-  ]
+  visibility = [ "*" ]
   public = [ "include/field_trial.h" ]
   sources = [ "source/field_trial.cc" ]
   deps = [
@@ -130,10 +127,7 @@ rtc_library("metrics") {
 
 rtc_library("metrics_for_tests") {
   testonly = true
-  visibility = [
-    "//third_party/webrtc/call:call_unittests",
-    "//third_party/webrtc/pc:peerconnection_unittests",
-  ]
+  visibility = [ "*" ]
   public = [ "include/metrics.h" ]
   sources = [ "source/metrics.cc" ]
   deps = [
index f2fa1c7218ae731de41c458c6d4d32e12c376f6b..c53d526c41df43e1cef40e45372651cb8cf0c146 100644 (file)
@@ -750,4 +750,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 2af613e3ad63228f9e94c91dc00fd07ab60a90f2..b01d01ea5385483a8081d61d59bd79eda21bb001 100644 (file)
@@ -50,6 +50,8 @@ class MockVideoStreamEncoder : public VideoStreamEncoderInterface {
               (override));
   MOCK_METHOD(void, Stop, (), (override));
 
+  MOCK_METHOD(bool, IsVp8Encoder, (), (override));
+
   MOCK_METHOD(void,
               MockedConfigureEncoder,
               (const VideoEncoderConfig&, size_t));
index b9c6f8f10ed17ea28e456fc59143d5f3140f5bdb..f8f4859bef9a327c4222051e138055593dc285d5 100644 (file)
@@ -8362,6 +8362,8 @@ class VideoStreamEncoderWithRealEncoderTest
       default:
         RTC_NOTREACHED();
     }
+    // libaom might be disabled on tizen, so encoder may be null in this case.
+    ASSERT_NE(encoder, nullptr);
     ConfigureEncoderAndBitrate(codec_type_, std::move(encoder));
   }
 
index 85fcd87d76533633813de679aeb1fe2f8f55eafd..85383e531c2843a588917f09326ab220a99ea787 100644 (file)
@@ -189,6 +189,7 @@ if (rtc_include_tests) {
         "//third_party/webrtc/call:call_unittests",
         "//third_party/webrtc/pc:peerconnection_unittests",
         "//third_party/webrtc/modules:modules_unittests",
+        "//third_party/webrtc/video:video_unittests",
       ]
     }
   }
@@ -248,6 +249,9 @@ source_set("task_queue_factory") {
     "//third_party/webrtc/api/task_queue",
     "//third_party/webrtc/rtc_base/system:rtc_export",
   ]
+  if (tizen_rtc_unittests) {
+    deps += [ "//third_party/webrtc/rtc_base/synchronization:yield_policy" ]
+  }
 }
 
 source_set("system_time") {
index f81232c0acbdabe94c3e65025ec351d41e84745d..01452d688aa7ef979b535b753ab960554b4a8c50 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(int give_up_after_ms) {
+#if WEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS
+  // Needed by UnitTests.
+  ScopedYieldPolicy::YieldExecution();
+#endif
+
   if (give_up_after_ms == kForever) {
     event_.Wait();
     return true;