From 90ec30807606d02435d8456c3616adef8f0c2ea2 Mon Sep 17 00:00:00 2001 From: Bo-Rong Chen Date: Tue, 19 Nov 2024 15:43:28 -0800 Subject: [PATCH] [media] Enable media_unittests for all platforms Enable `media_unittests` for Cobalt, and list three tasks for the following unit_tests: - StarboardRenderer: b/379934658 - BidirectionalFitReuseAllocator: b/379934533 - starboard_utils_test: b/379936173 - Disable ffmpeg: b/378909148 This PR also fixed building content_shell_apk target on android. b/379927913 --- .github/config/android-arm.json | 3 ++- .github/config/android-arm64.json | 3 ++- .github/config/android-x86.json | 3 ++- .github/config/chromium_android-arm.json | 3 ++- .github/config/chromium_android-arm64.json | 3 ++- .github/config/chromium_android-x86.json | 3 ++- .github/config/chromium_linux.json | 1 + .github/config/linux.json | 1 + media/base/mock_filters.h | 3 +++ media/media_options.gni | 5 +++-- media/starboard/BUILD.gn | 8 ++++---- 11 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/config/android-arm.json b/.github/config/android-arm.json index b8b6850e2c03..6296f1d59915 100644 --- a/.github/config/android-arm.json +++ b/.github/config/android-arm.json @@ -13,7 +13,8 @@ "gpu_unittests", "gin_unittests", "blink_unittests", - "content_shell", + "media_unittests", + "content_shell_apk", "system_webview_apk", "system_webview_shell_apk", "cobalt:gn_all" diff --git a/.github/config/android-arm64.json b/.github/config/android-arm64.json index 8f5d8b87de4c..14cf3ea7aba2 100644 --- a/.github/config/android-arm64.json +++ b/.github/config/android-arm64.json @@ -13,7 +13,8 @@ "gpu_unittests", "gin_unittests", "blink_unittests", - "content_shell", + "media_unittests", + "content_shell_apk", "system_webview_apk", "system_webview_shell_apk", "cobalt:gn_all" diff --git a/.github/config/android-x86.json b/.github/config/android-x86.json index b466f5549f42..8a42062e9996 100644 --- a/.github/config/android-x86.json +++ b/.github/config/android-x86.json @@ -13,7 +13,8 @@ "gpu_unittests", "gin_unittests", "blink_unittests", - "content_shell", + "media_unittests", + "content_shell_apk", "system_webview_apk", "system_webview_shell_apk", "cobalt:gn_all" diff --git a/.github/config/chromium_android-arm.json b/.github/config/chromium_android-arm.json index 12b586a28ad6..108d0609bae9 100644 --- a/.github/config/chromium_android-arm.json +++ b/.github/config/chromium_android-arm.json @@ -13,7 +13,8 @@ "gpu_unittests", "gin_unittests", "blink_unittests", - "content_shell", + "media_unittests", + "content_shell_apk", "system_webview_apk", "system_webview_shell_apk" ], diff --git a/.github/config/chromium_android-arm64.json b/.github/config/chromium_android-arm64.json index 7f14382226f3..112fe51458d0 100644 --- a/.github/config/chromium_android-arm64.json +++ b/.github/config/chromium_android-arm64.json @@ -13,7 +13,8 @@ "gpu_unittests", "gin_unittests", "blink_unittests", - "content_shell", + "media_unittests", + "content_shell_apk", "system_webview_apk", "system_webview_shell_apk" ], diff --git a/.github/config/chromium_android-x86.json b/.github/config/chromium_android-x86.json index 298136961740..fb93cb95c676 100644 --- a/.github/config/chromium_android-x86.json +++ b/.github/config/chromium_android-x86.json @@ -13,7 +13,8 @@ "gpu_unittests", "gin_unittests", "blink_unittests", - "content_shell", + "media_unittests", + "content_shell_apk", "system_webview_apk", "system_webview_shell_apk" ], diff --git a/.github/config/chromium_linux.json b/.github/config/chromium_linux.json index f83ef4e63649..01114cd966a6 100644 --- a/.github/config/chromium_linux.json +++ b/.github/config/chromium_linux.json @@ -13,6 +13,7 @@ "gpu_unittests", "gin_unittests", "blink_unittests", + "media_unittests", "content_shell" ], "includes": [ diff --git a/.github/config/linux.json b/.github/config/linux.json index 2332acd83354..bcbf9b7f8af9 100644 --- a/.github/config/linux.json +++ b/.github/config/linux.json @@ -13,6 +13,7 @@ "gpu_unittests", "gin_unittests", "blink_unittests", + "media_unittests", "content_shell", "cobalt:gn_all" ], diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h index 487af904af7c..5f6b383e0e7b 100644 --- a/media/base/mock_filters.h +++ b/media/base/mock_filters.h @@ -140,6 +140,9 @@ class MockPipeline : public Pipeline { } MOCK_METHOD2(OnSetCdm, void(CdmContext* cdm_context, CdmAttachedCB& cdm_attached_cb)); +#if BUILDFLAG(USE_STARBOARD_MEDIA) + MOCK_METHOD0(GetSetBoundsCB, SetBoundsCB()); +#endif // BUILDFLAG(USE_STARBOARD_MEDIA) }; class MockMediaResource : public MediaResource { diff --git a/media/media_options.gni b/media/media_options.gni index b4401c58d95c..8017ccf22796 100644 --- a/media/media_options.gni +++ b/media/media_options.gni @@ -57,9 +57,10 @@ declare_args() { media_use_libvpx = false } - # Chrobalt doesn't use ffmpeg. if (is_cobalt) { - media_use_ffmpeg = false + # TODO(b/378909148): Chrobalt doesn't use ffmpeg. + # Comment it as it breaks media_unittests. + #media_use_ffmpeg = false } # Enable usage of OpenH264 within the media library. Used for software based diff --git a/media/starboard/BUILD.gn b/media/starboard/BUILD.gn index 9f860dfdb446..492ce50bb0c3 100644 --- a/media/starboard/BUILD.gn +++ b/media/starboard/BUILD.gn @@ -96,10 +96,10 @@ source_set("unit_tests") { testonly = true sources = [] if (use_starboard_media) { - sources += [ - "bidirectional_fit_reuse_allocator_test.cc", - "starboard_utils_test.cc", - ] + # TODO(b/379934658): add starboard_renderer_test. + # TODO(b/379936173): enable starboard_utils_test + # TODO(b/379934533): enable bidirectional_fit_reuse_allocator_test. + sources += [] } configs += [ "//media:media_config" ] deps = [