Fix problem that surface when rtc_cc_test is used as a test binary.

On CQ/CI bots, the rtc_cc_test targets are used as cc libraries. The actual test binary is the rtc_test_suite target. Some problem surface when trying to directly run rtc_cc_test targets on bots.

* Fix missing data in test target.
* Remove unused multi_stream_tests dependency in transport_feedback_tests.
* scenario_unittest_resources_bundle_data is renamed to scenario_unittest_bundle_data to avoid collision with the generated internal ios targets for bundle that has the same name.
* Widen the visibility lists naming rtc_cc_test targets. On Android, iOS
  and Fuchsia, test() compiles the test sources in an internal target
  (e.g. <name>__library on Android and <name>__exec on Fuchsia), so a
  visibility entry naming a test target only works while rtc_cc_test
  defines a library with that name.

Bug: webrtc:498394143
Change-Id: I059ec057f3f9f0289eb8168e212b444af72deeda
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/510020
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#48975}
diff --git a/logging/BUILD.gn b/logging/BUILD.gn
index ce022a4..d380d97 100644
--- a/logging/BUILD.gn
+++ b/logging/BUILD.gn
@@ -410,7 +410,7 @@
 if (rtc_enable_protobuf) {
   rtc_library("rtc_event_log_impl") {
     visibility = [
-      ":rtc_event_log_impl_unittest",
+      ":*",
       "../api/rtc_event_log:rtc_event_log_factory",
     ]
     sources = [
diff --git a/modules/audio_processing/agc2/BUILD.gn b/modules/audio_processing/agc2/BUILD.gn
index 1ce4f9a..60dd1c3 100644
--- a/modules/audio_processing/agc2/BUILD.gn
+++ b/modules/audio_processing/agc2/BUILD.gn
@@ -196,9 +196,7 @@
   ]
 
   visibility = [
-    "..:audio_processing",
-    "..:gain_controller2",
-    "..:gain_controller2_unittest",
+    "..:*",
     "./*",
   ]
 
@@ -556,7 +554,7 @@
     testonly = true
     visibility = [
       ":*",
-      "..:gain_controller2_unittest",
+      "..:*",
     ]
     sources = [
       "agc2_testing_common.cc",
diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn
index 75b8836..4e5b718 100644
--- a/modules/video_coding/BUILD.gn
+++ b/modules/video_coding/BUILD.gn
@@ -1742,6 +1742,10 @@
         "../../test:fileutils",
         "../../test:test_support",
       ]
+      data_deps = [ "../../resources:video_coding_tests_data" ]
+      if (is_ios) {
+        deps += [ "../../resources:video_coding_tests_bundle_data" ]
+      }
     }
   }
 
@@ -1758,6 +1762,10 @@
         "../../test:fileutils",
         "../../test:test_support",
       ]
+      data_deps = [ "../../resources:video_coding_tests_data" ]
+      if (is_ios) {
+        deps += [ "../../resources:video_coding_tests_bundle_data" ]
+      }
     }
   }
 
diff --git a/modules/video_coding/codecs/av1/BUILD.gn b/modules/video_coding/codecs/av1/BUILD.gn
index 96e801e..6c61ac7 100644
--- a/modules/video_coding/codecs/av1/BUILD.gn
+++ b/modules/video_coding/codecs/av1/BUILD.gn
@@ -96,7 +96,7 @@
 
 rtc_library("libaom_av1_encoder_v2") {
   visibility = [
-    ":libaom_av1_encoder_v2_unittest",
+    ":*",
     "../../../../api/video_codecs:libaom_av1_encoder_factory",
   ]
   poisonous = [ "software_video_codecs" ]
diff --git a/pc/BUILD.gn b/pc/BUILD.gn
index 75ebdab..b7f7de1 100644
--- a/pc/BUILD.gn
+++ b/pc/BUILD.gn
@@ -862,8 +862,7 @@
 rtc_library("media_protocol_names") {
   visibility = [
     ":*",
-    "../api:jsep",
-    "../api:webrtc_sdp_unittest",
+    "../api:*",
   ]
   sources = [
     "media_protocol_names.cc",
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index c904ada..6fa35df 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -722,7 +722,7 @@
 if (is_mac || is_ios) {
   rtc_library("rtc_task_queue_gcd") {
     visibility = [
-      ":task_queue_gcd_unittest",
+      ":*",
       "../api/task_queue:default_task_queue_factory",
     ]
     sources = [
diff --git a/rtc_base/memory/BUILD.gn b/rtc_base/memory/BUILD.gn
index 8f35b76..4273c0a 100644
--- a/rtc_base/memory/BUILD.gn
+++ b/rtc_base/memory/BUILD.gn
@@ -24,7 +24,7 @@
 rtc_library("fifo_buffer") {
   testonly = true
   visibility = [
-    ":fifo_buffer_unittest",
+    ":*",
     "..:rtc_base_tests_utils",
   ]
   sources = [
diff --git a/rtc_base/synchronization/BUILD.gn b/rtc_base/synchronization/BUILD.gn
index 7bad412..f7a4620 100644
--- a/rtc_base/synchronization/BUILD.gn
+++ b/rtc_base/synchronization/BUILD.gn
@@ -41,10 +41,7 @@
 }
 
 rtc_library("sequence_checker_internal") {
-  visibility = [
-    "../../api:sequence_checker",
-    "../../api:sequence_checker_unittest",
-  ]
+  visibility = [ "../../api:*" ]
   sources = [
     "sequence_checker_internal.cc",
     "sequence_checker_internal.h",
diff --git a/test/BUILD.gn b/test/BUILD.gn
index 67e1950..f11ee23 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -1280,6 +1280,10 @@
         "../rtc_base:crypto_random",
         "//third_party/abseil-cpp/absl/strings:string_view",
       ]
+      data = test_support_unittests_resources
+      if (is_ios) {
+        deps += [ ":test_support_unittests_bundle_data" ]
+      }
     }
 
     rtc_cc_test("copy_to_file_audio_capturer_unittest") {
diff --git a/test/scenario/BUILD.gn b/test/scenario/BUILD.gn
index 381f73b..f97bc1c 100644
--- a/test/scenario/BUILD.gn
+++ b/test/scenario/BUILD.gn
@@ -39,7 +39,7 @@
       outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
     }
 
-    bundle_data("scenario_unittest_resources_bundle_data") {
+    bundle_data("scenario_unittest_bundle_data") {
       testonly = true
       sources = scenario_unittest_resources
       outputs = [ "{{bundle_resources_dir}}/{{source_file_part}}" ]
@@ -232,7 +232,7 @@
     ]
     data = scenario_unittest_resources
     if (is_ios) {
-      deps += [ ":scenario_unittest_resources_bundle_data" ]
+      deps += [ ":scenario_unittest_bundle_data" ]
     }
   }
 
@@ -266,7 +266,7 @@
     ]
     data = scenario_unittest_resources
     if (is_ios) {
-      deps += [ ":scenario_unittest_resources_bundle_data" ]
+      deps += [ ":scenario_unittest_bundle_data" ]
     }
   }
 }
diff --git a/video/BUILD.gn b/video/BUILD.gn
index 883bbd7..1117cf5 100644
--- a/video/BUILD.gn
+++ b/video/BUILD.gn
@@ -1400,7 +1400,6 @@
     sources = [ "end_to_end_tests/transport_feedback_tests.cc" ]
     deps = [
       ":multi_stream_tester",
-      ":multi_stream_tests",
       "../api:rtp_header_extension_id",
       "../api:rtp_parameters",
       "../api:simulated_network_api",