Reland "Make the test library for field trials testonly."

This is a reland of commit c33f1a828c31412e7422e7bf11db7c9b61fab339

Original change's description:
> Make the test library for field trials testonly.
>
> Bug: None
> Change-Id: I703a82e0ca10908bdc56c0d4f1455e042ce74ac1
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267163
> Reviewed-by: Artem Titov <titovartem@webrtc.org>
> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37371}

Bug: None
Change-Id: I1a1a7732e50e838f00ee3c713c4cf4def9b543ad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267166
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37373}
diff --git a/test/BUILD.gn b/test/BUILD.gn
index 4e41076..d588dd7 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -215,6 +215,7 @@
 }
 
 rtc_library("field_trial") {
+  testonly = true
   visibility = [ "*" ]
   sources = [
     "field_trial.cc",
@@ -235,7 +236,6 @@
   ]
 
   deps = [
-    ":field_trial",
     "../api:field_trials_view",
     "../rtc_base:checks",
   ]
@@ -243,6 +243,7 @@
 }
 
 rtc_library("scoped_key_value_config") {
+  testonly = true
   visibility = [ "*" ]
   sources = [
     "scoped_key_value_config.cc",