Decouple //rtc_base:rtc_base_tests_utils from gunit.

This CL decouples //rtc_base:rtc_base_tests_utils from gunit by
moving gunit helpers (rtc_base/gunit.h) and rtc_base/testclient.h
(which depends on gunit helpers) to their own build target.

It also removes some unused dependencies in the WebRTC build graph.

Bug: None
Change-Id: Ia9820e84ff697da39b351eef73c45f6e4bdf2623
Reviewed-on: https://webrtc-review.googlesource.com/c/111861
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25769}
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index ae89107..f188d47 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -934,11 +934,41 @@
   ]
 }
 
+rtc_source_set("gunit_helpers") {
+  testonly = true
+  sources = [
+    "gunit.cc",
+    "gunit.h",
+  ]
+  deps = [
+    ":logging",
+    ":rtc_base",
+    ":rtc_base_tests_utils",
+    ":stringutils",
+    "../test:test_support",
+  ]
+}
+
+rtc_source_set("testclient") {
+  testonly = true
+  sources = [
+    "testclient.cc",
+    "testclient.h",
+  ]
+  deps = [
+    ":criticalsection",
+    ":gunit_helpers",
+    ":macromagic",
+    ":rtc_base",
+    ":rtc_base_tests_utils",
+    ":timeutils",
+    "//third_party/abseil-cpp/absl/memory:memory",
+  ]
+}
+
 rtc_source_set("rtc_base_tests_utils") {
   testonly = true
   sources = [
-    # Also use this as a convenient dumping ground for misc files that are
-    # included by multiple targets below.
     "cpu_time.cc",
     "cpu_time.h",
     "fake_mdns_responder.h",
@@ -949,8 +979,6 @@
     "fakesslidentity.h",
     "firewallsocketserver.cc",
     "firewallsocketserver.h",
-    "gunit.cc",
-    "gunit.h",
     "memory_stream.cc",
     "memory_stream.h",
     "memory_usage.cc",
@@ -969,8 +997,6 @@
     "socketstream.h",
     "testbase64.h",
     "testcertificateverifier.h",
-    "testclient.cc",
-    "testclient.h",
     "testechoserver.cc",
     "testechoserver.h",
     "testutils.cc",
@@ -981,16 +1007,10 @@
   deps = [
     ":checks",
     ":rtc_base",
-    ":stringutils",
     "../api/units:time_delta",
-    "../test:test_support",
-    "system:fallthrough",
     "third_party/sigslot",
     "//third_party/abseil-cpp/absl/memory",
   ]
-  public_deps = [
-    "//testing/gtest",
-  ]
 }
 
 rtc_source_set("rtc_task_queue_for_test") {
@@ -1015,6 +1035,7 @@
       "sigslot_unittest.cc",
     ]
     deps = [
+      ":gunit_helpers",
       ":rtc_base",
       ":rtc_base_tests_utils",
       "third_party/sigslot",
@@ -1027,6 +1048,7 @@
       "unittest_main.cc",
     ]
     deps = [
+      ":gunit_helpers",
       ":rtc_base",
       ":rtc_base_approved",
       ":rtc_base_tests_utils",
@@ -1055,9 +1077,11 @@
     ]
     deps = [
       ":checks",
+      ":gunit_helpers",
       ":rtc_base",
       ":rtc_base_tests_main",
       ":rtc_base_tests_utils",
+      ":testclient",
       "../system_wrappers:system_wrappers",
       "../test:fileutils",
       "../test:test_support",
@@ -1124,6 +1148,7 @@
     }
     deps = [
       ":checks",
+      ":gunit_helpers",
       ":rate_limiter",
       ":rtc_base",
       ":rtc_base_approved",
@@ -1134,6 +1159,7 @@
       ":safe_minmax",
       ":sanitizer",
       ":stringutils",
+      ":testclient",
       "../api:array_view",
       "../system_wrappers:system_wrappers",
       "../test:fileutils",
@@ -1153,6 +1179,7 @@
       "task_queue_unittest.cc",
     ]
     deps = [
+      ":gunit_helpers",
       ":rtc_base_approved",
       ":rtc_base_tests_main",
       ":rtc_base_tests_utils",
@@ -1186,6 +1213,7 @@
       "weak_ptr_unittest.cc",
     ]
     deps = [
+      ":gunit_helpers",
       ":rtc_base_approved",
       ":rtc_base_tests_main",
       ":rtc_base_tests_utils",
@@ -1221,6 +1249,7 @@
       "strings/json_unittest.cc",
     ]
     deps = [
+      ":gunit_helpers",
       ":rtc_base_tests_main",
       ":rtc_base_tests_utils",
       ":rtc_json",
@@ -1272,9 +1301,11 @@
     }
     deps = [
       ":checks",
+      ":gunit_helpers",
       ":rtc_base_tests_main",
       ":rtc_base_tests_utils",
       ":stringutils",
+      ":testclient",
       "../api:array_view",
       "../test:fileutils",
       "../test:test_support",