Revert of Enabling `gn check` on webrtc/test (patchset #9 id:160001 of https://codereview.webrtc.org/2911203002/ )

Reason for revert:
ERROR at //webrtc/test/testsupport/fileutils_unittest.cc:20:11: Can't include this header from here.
#include "webrtc/base/checks.h"
          ^-------------------
The target:
  //webrtc/test:fileutils_unittests
is including a file from the target:
  //webrtc/base:rtc_base_approved

It's usually best to depend directly on the destination target.
In some cases, the destination target is considered a subcomponent
of an intermediate target. In this case, the intermediate target
should depend publicly on the destination to forward the ability
to include headers.

Dependency chain (there may also be others):
  //webrtc/test:fileutils_unittests -->
  //webrtc/test:fileutils --[private]-->
  //webrtc/base:rtc_base_approved

Original issue's description:
> Enabling `gn check` on webrtc/test
>
> BUG=webrtc:6828
> NOTRY=True
>
> Review-Url: https://codereview.webrtc.org/2911203002
> Cr-Commit-Position: refs/heads/master@{#18372}
> Committed: https://chromium.googlesource.com/external/webrtc/+/db5bb404b0f42a7c0a43f882b34ba1325d8cbae2

TBR=kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6828

Review-Url: https://codereview.webrtc.org/2920763002
Cr-Commit-Position: refs/heads/master@{#18375}
diff --git a/.gn b/.gn
index 70a0c3e..a6b4af7 100644
--- a/.gn
+++ b/.gn
@@ -37,7 +37,6 @@
   "//webrtc/sdk/*",
   "//webrtc/stats/*",
   "//webrtc/system_wrappers/*",
-  "//webrtc/test/*",
   "//webrtc/tools/*",
   "//webrtc/video/*",
   "//webrtc/voice_engine/*",
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index 8f87576..1b62973 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -1103,118 +1103,6 @@
   ]
 }
 
-rtc_source_set("neteq_test_tools") {
-  testonly = true
-  sources = [
-    "neteq/tools/audio_checksum.h",
-    "neteq/tools/audio_loop.cc",
-    "neteq/tools/audio_loop.h",
-    "neteq/tools/constant_pcm_packet_source.cc",
-    "neteq/tools/constant_pcm_packet_source.h",
-    "neteq/tools/output_audio_file.h",
-    "neteq/tools/output_wav_file.h",
-    "neteq/tools/rtp_file_source.cc",
-    "neteq/tools/rtp_file_source.h",
-    "neteq/tools/rtp_generator.cc",
-    "neteq/tools/rtp_generator.h",
-  ]
-
-  public_configs = [ ":neteq_tools_config" ]
-
-  if (!build_with_chromium && is_clang) {
-    # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
-  }
-
-  deps = [
-    ":pcm16b",
-    "..:module_api",
-    "../..:webrtc_common",
-    "../../base:rtc_base_approved",
-    "../../base:rtc_base_tests_utils",
-    "../../common_audio",
-    "../../test:rtp_test_utils",
-    "../rtp_rtcp",
-  ]
-
-  public_deps = [
-    ":neteq_tools",
-    ":neteq_tools_minimal",
-  ]
-
-  if (rtc_enable_protobuf) {
-    sources += [
-      "neteq/tools/neteq_packet_source_input.cc",
-      "neteq/tools/neteq_packet_source_input.h",
-    ]
-    deps += [ ":rtc_event_log_source" ]
-  }
-}
-
-config("neteq_tools_config") {
-  include_dirs = [ "tools" ]
-}
-
-rtc_source_set("neteq_tools") {
-  sources = [
-    "neteq/tools/fake_decode_from_file.cc",
-    "neteq/tools/fake_decode_from_file.h",
-    "neteq/tools/input_audio_file.cc",
-    "neteq/tools/input_audio_file.h",
-    "neteq/tools/neteq_replacement_input.cc",
-    "neteq/tools/neteq_replacement_input.h",
-    "neteq/tools/resample_input_audio_file.cc",
-    "neteq/tools/resample_input_audio_file.h",
-  ]
-
-  public_configs = [ ":neteq_tools_config" ]
-
-  if (!build_with_chromium && is_clang) {
-    # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
-  }
-
-  deps = [
-    "../..:webrtc_common",
-    "../../api/audio_codecs:audio_codecs_api",
-    "../../base:rtc_base_approved",
-    "../../common_audio",
-    "../rtp_rtcp",
-  ]
-
-  public_deps = [
-    ":neteq_tools_minimal",
-  ]
-}
-
-if (rtc_enable_protobuf) {
-  rtc_static_library("rtc_event_log_source") {
-    testonly = true
-
-    # TODO(kjellander): Remove (bugs.webrtc.org/6828)
-    # Needs call.h to be moved to webrtc/api first.
-    check_includes = false
-
-    sources = [
-      "neteq/tools/rtc_event_log_source.cc",
-      "neteq/tools/rtc_event_log_source.h",
-    ]
-
-    if (!build_with_chromium && is_clang) {
-      # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
-    }
-
-    deps = [
-      "../../base:rtc_base_approved",
-      "../../logging:rtc_event_log_parser",
-    ]
-    public_deps = [
-      "../../logging:rtc_event_log_proto",
-    ]
-  }
-}
-
 if (rtc_include_tests) {
   group("audio_coding_tests") {
     testonly = true
@@ -1507,6 +1395,32 @@
       proto_out_dir = "webrtc/modules/audio_coding/neteq"
     }
 
+    rtc_static_library("rtc_event_log_source") {
+      testonly = true
+
+      # TODO(kjellander): Remove (bugs.webrtc.org/6828)
+      # Needs call.h to be moved to webrtc/api first.
+      check_includes = false
+
+      sources = [
+        "neteq/tools/rtc_event_log_source.cc",
+        "neteq/tools/rtc_event_log_source.h",
+      ]
+
+      if (!build_with_chromium && is_clang) {
+        # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+        suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+      }
+
+      deps = [
+        "../../base:rtc_base_approved",
+        "../../logging:rtc_event_log_parser",
+      ]
+      public_deps = [
+        "../../logging:rtc_event_log_proto",
+      ]
+    }
+
     rtc_test("neteq_rtpplay") {
       testonly = true
       defines = []
@@ -1628,6 +1542,90 @@
     ]
   }
 
+  config("neteq_tools_config") {
+    include_dirs = [ "tools" ]
+  }
+
+  rtc_source_set("neteq_tools") {
+    sources = [
+      "neteq/tools/fake_decode_from_file.cc",
+      "neteq/tools/fake_decode_from_file.h",
+      "neteq/tools/input_audio_file.cc",
+      "neteq/tools/input_audio_file.h",
+      "neteq/tools/neteq_replacement_input.cc",
+      "neteq/tools/neteq_replacement_input.h",
+      "neteq/tools/resample_input_audio_file.cc",
+      "neteq/tools/resample_input_audio_file.h",
+    ]
+
+    public_configs = [ ":neteq_tools_config" ]
+
+    if (!build_with_chromium && is_clang) {
+      # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+    }
+
+    deps = [
+      "../..:webrtc_common",
+      "../../api/audio_codecs:audio_codecs_api",
+      "../../base:rtc_base_approved",
+      "../../common_audio",
+      "../rtp_rtcp",
+    ]
+
+    public_deps = [
+      ":neteq_tools_minimal",
+    ]
+  }
+
+  rtc_source_set("neteq_test_tools") {
+    testonly = true
+    sources = [
+      "neteq/tools/audio_checksum.h",
+      "neteq/tools/audio_loop.cc",
+      "neteq/tools/audio_loop.h",
+      "neteq/tools/constant_pcm_packet_source.cc",
+      "neteq/tools/constant_pcm_packet_source.h",
+      "neteq/tools/output_audio_file.h",
+      "neteq/tools/output_wav_file.h",
+      "neteq/tools/rtp_file_source.cc",
+      "neteq/tools/rtp_file_source.h",
+      "neteq/tools/rtp_generator.cc",
+      "neteq/tools/rtp_generator.h",
+    ]
+
+    public_configs = [ ":neteq_tools_config" ]
+
+    if (!build_with_chromium && is_clang) {
+      # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+    }
+
+    deps = [
+      ":pcm16b",
+      "..:module_api",
+      "../..:webrtc_common",
+      "../../base:rtc_base_approved",
+      "../../base:rtc_base_tests_utils",
+      "../../common_audio",
+      "../../test:rtp_test_utils",
+      "../rtp_rtcp",
+    ]
+
+    public_deps = [
+      ":neteq_tools",
+      ":neteq_tools_minimal",
+    ]
+
+    if (rtc_enable_protobuf) {
+      sources += [
+        "neteq/tools/neteq_packet_source_input.cc",
+        "neteq/tools/neteq_packet_source_input.h",
+      ]
+      deps += [ ":rtc_event_log_source" ]
+    }
+  }
+
   rtc_source_set("neteq_test_tools_deprecated") {
     testonly = true
     sources = [
diff --git a/webrtc/modules/audio_device/BUILD.gn b/webrtc/modules/audio_device/BUILD.gn
index 6476831..2f678d6 100644
--- a/webrtc/modules/audio_device/BUILD.gn
+++ b/webrtc/modules/audio_device/BUILD.gn
@@ -254,19 +254,6 @@
   }
 }
 
-rtc_source_set("mock_audio_device") {
-  testonly = true
-  sources = [
-    "include/mock_audio_device.h",
-    "include/mock_audio_transport.h",
-  ]
-  deps = [
-    ":audio_device",
-    "../../test:test_support",
-  ]
-  all_dependent_configs = [ ":mock_audio_device_config" ]
-}
-
 if (rtc_include_tests) {
   rtc_source_set("audio_device_unittests") {
     testonly = true
@@ -322,6 +309,19 @@
     }
   }
 
+  rtc_source_set("mock_audio_device") {
+    testonly = true
+    sources = [
+      "include/mock_audio_device.h",
+      "include/mock_audio_transport.h",
+    ]
+    deps = [
+      ":audio_device",
+      "../../test:test_support",
+    ]
+    all_dependent_configs = [ ":mock_audio_device_config" ]
+  }
+
   if (!is_ios) {
     # These tests do not work on ios, see
     # https://bugs.chromium.org/p/webrtc/issues/detail?id=4755
diff --git a/webrtc/modules/rtp_rtcp/BUILD.gn b/webrtc/modules/rtp_rtcp/BUILD.gn
index a9e257e..7f2d64f 100644
--- a/webrtc/modules/rtp_rtcp/BUILD.gn
+++ b/webrtc/modules/rtp_rtcp/BUILD.gn
@@ -211,21 +211,6 @@
   }
 }
 
-rtc_source_set("mock_rtp_rtcp") {
-  testonly = true
-  sources = [
-    "mocks/mock_recovered_packet_receiver.h",
-    "mocks/mock_rtcp_rtt_stats.h",
-    "mocks/mock_rtp_rtcp.h",
-  ]
-  deps = [
-    ":rtp_rtcp",
-    "..:module_api",
-    "../../base:rtc_base_approved",
-    "../../test:test_support",
-  ]
-}
-
 if (rtc_include_tests) {
   rtc_executable("test_packet_masks_metrics") {
     testonly = true
@@ -265,6 +250,21 @@
     }
   }
 
+  rtc_source_set("mock_rtp_rtcp") {
+    testonly = true
+    sources = [
+      "mocks/mock_recovered_packet_receiver.h",
+      "mocks/mock_rtcp_rtt_stats.h",
+      "mocks/mock_rtp_rtcp.h",
+    ]
+    deps = [
+      ":rtp_rtcp",
+      "..:module_api",
+      "../../base:rtc_base_approved",
+      "../../test:test_support",
+    ]
+  }
+
   rtc_source_set("rtp_rtcp_unittests") {
     testonly = true
 
diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn
index 9b42b25..bb04e19 100644
--- a/webrtc/test/BUILD.gn
+++ b/webrtc/test/BUILD.gn
@@ -58,14 +58,9 @@
   }
 
   deps = [
-    "..:video_stream_api",
-    "..:webrtc_common",
-    "../base:rtc_base_approved",
-    "../base:rtc_task_queue",
     "../common_video",
     "../media:rtc_media_base",
     "../modules/video_capture:video_capture_module",
-    "../system_wrappers",
   ]
 }
 
@@ -87,7 +82,6 @@
 
   deps = [
     "..:webrtc_common",
-    "../base:rtc_base_approved",
     "../modules/rtp_rtcp",
     "//testing/gtest",
   ]
@@ -171,7 +165,6 @@
     ]
     deps = [
       ":field_trial",
-      "../base:rtc_base_approved",
       "../system_wrappers:metrics_default",
       "//testing/gmock",
       "//testing/gtest",
@@ -195,9 +188,6 @@
     ]
 
     deps = [
-      ":test_support",
-      ":video_test_common",
-      "..:webrtc_common",
       "../base:rtc_base_approved",
       "../common_video",
       "../system_wrappers",
@@ -262,16 +252,7 @@
   }
 
   rtc_test("test_support_unittests") {
-    deps = [
-      ":fake_audio_device",
-      ":rtp_test_utils",
-      "../api:video_frame_api",
-      "../base:rtc_base_approved",
-      "../call:call_interfaces",
-      "../common_audio",
-      "../modules/rtp_rtcp",
-      "../system_wrappers",
-    ]
+    deps = []
     sources = [
       "fake_audio_device_unittest.cc",
       "fake_network_pipe_unittest.cc",
@@ -333,16 +314,11 @@
     "testsupport/fileutils.cc",
     "testsupport/fileutils.h",
   ]
-  deps = [
-    "..:webrtc_common",
-    "../base:rtc_base_approved",
-  ]
   if (is_ios) {
     sources += [ "testsupport/iosfileutils.mm" ]
-    deps += [ "../sdk:objc_common" ]
-  }
-  if (is_win) {
-    deps += [ "../base:rtc_base" ]
+    deps = [
+      "../sdk:objc_common",
+    ]
   }
   visibility = [ ":*" ]
 }
@@ -367,7 +343,6 @@
   ]
   deps = [
     ":fileutils",
-    ":test_support",
     "//testing/gmock",
     "//testing/gtest",
   ]
@@ -386,12 +361,9 @@
     suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
   deps = [
-    "..:webrtc_common",
     "../api:transport_api",
     "../base:rtc_base_approved",
     "../call",
-    "../modules/rtp_rtcp",
-    "../system_wrappers",
   ]
 }
 
@@ -406,11 +378,8 @@
     suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
   deps = [
-    "..:webrtc_common",
     "../base:rtc_base_approved",
-    "../common_audio:common_audio",
     "../modules/audio_device:audio_device",
-    "../system_wrappers:system_wrappers",
   ]
 }
 
@@ -462,30 +431,15 @@
     ":rtp_test_utils",
     ":test_support",
     ":video_test_common",
-    "..:video_stream_api",
     "..:webrtc_common",
-    "../api:transport_api",
-    "../api:video_frame_api",
-    "../api/audio_codecs:builtin_audio_decoder_factory",
     "../api/audio_codecs:builtin_audio_encoder_factory",
     "../api/video_codecs:video_codecs_api",
     "../audio",
     "../base:rtc_base_approved",
-    "../base:rtc_task_queue",
     "../call",
-    "../common_video",
-    "../logging:rtc_event_log_api",
-    "../modules/audio_device:mock_audio_device",
     "../modules/audio_mixer:audio_mixer_impl",
     "../modules/audio_processing",
-    "../modules/rtp_rtcp",
-    "../modules/rtp_rtcp:mock_rtp_rtcp",
-    "../modules/video_coding:webrtc_h264",
-    "../modules/video_coding:webrtc_vp8",
-    "../modules/video_coding:webrtc_vp9",
-    "../system_wrappers",
     "../video",
-    "../voice_engine",
     "//testing/gmock",
     "//testing/gtest",
   ]
@@ -561,9 +515,6 @@
 
   deps = [
     ":test_support",
-    "..:webrtc_common",
-    "../base:rtc_base_approved",
-    "../common_video",
     "../modules/media_file",
     "//testing/gtest",
   ]
@@ -580,10 +531,7 @@
   ]
 
   deps = [
-    ":test_support",
     "../api/audio_codecs:audio_codecs_api",
-    "../api/audio_codecs:builtin_audio_decoder_factory",
-    "../base:rtc_base_approved",
     "//testing/gmock",
   ]
 }
diff --git a/webrtc/test/fuzzers/BUILD.gn b/webrtc/test/fuzzers/BUILD.gn
index 6e5098e..33c2c47 100644
--- a/webrtc/test/fuzzers/BUILD.gn
+++ b/webrtc/test/fuzzers/BUILD.gn
@@ -15,7 +15,6 @@
     "webrtc_fuzzer_main.cc",
   ]
   deps = [
-    "../../base:rtc_base_approved",
     "../../system_wrappers:field_trial_default",
     "../../system_wrappers:metrics_default",
     "//testing/libfuzzer:libfuzzer_main",
@@ -65,7 +64,6 @@
     "vp8_qp_parser_fuzzer.cc",
   ]
   deps = [
-    "../../modules/video_coding:video_coding_utility",
     "../../modules/video_coding/",
   ]
 }
@@ -75,7 +73,6 @@
     "h264_bitstream_parser_fuzzer.cc",
   ]
   deps = [
-    "../../common_video",
     "../../modules/video_coding/",
   ]
 }
@@ -85,7 +82,6 @@
     "flexfec_header_reader_fuzzer.cc",
   ]
   deps = [
-    "../../base:rtc_base_approved",
     "../../modules/rtp_rtcp",
   ]
 }
@@ -96,7 +92,6 @@
   ]
   deps = [
     "../../modules/rtp_rtcp",
-    "../../system_wrappers",
   ]
   libfuzzer_options = [ "max_len=200" ]
 }
@@ -106,7 +101,6 @@
     "ulpfec_header_reader_fuzzer.cc",
   ]
   deps = [
-    "../../base:rtc_base_approved",
     "../../modules/rtp_rtcp",
     "../../modules/rtp_rtcp:fec_test_helper",
   ]
@@ -128,7 +122,6 @@
     "flexfec_receiver_fuzzer.cc",
   ]
   deps = [
-    "../../base:rtc_base_approved",
     "../../modules/rtp_rtcp",
   ]
   libfuzzer_options = [ "max_len=2000" ]
@@ -140,7 +133,6 @@
   ]
   deps = [
     "../../modules/video_coding/",
-    "../../system_wrappers",
   ]
   libfuzzer_options = [ "max_len=2000" ]
 }
@@ -150,9 +142,7 @@
     "rtcp_receiver_fuzzer.cc",
   ]
   deps = [
-    "../../base:rtc_base_approved",
     "../../modules/rtp_rtcp",
-    "../../system_wrappers:system_wrappers",
   ]
   seed_corpus = "corpora/rtcp-corpus"
 }
@@ -181,11 +171,8 @@
     "congestion_controller_feedback_fuzzer.cc",
   ]
   deps = [
-    "../../logging:rtc_event_log_api",
     "../../logging:rtc_event_log_impl",
     "../../modules/congestion_controller/",
-    "../../modules/remote_bitrate_estimator:remote_bitrate_estimator",
-    "../../modules/rtp_rtcp",
   ]
 }
 
@@ -194,12 +181,6 @@
     "audio_decoder_fuzzer.cc",
     "audio_decoder_fuzzer.h",
   ]
-  deps = [
-    "../..:webrtc_common",
-    "../../api/audio_codecs:audio_codecs_api",
-    "../../base:rtc_base_approved",
-    "../../modules/rtp_rtcp",
-  ]
 }
 
 webrtc_fuzzer_test("audio_decoder_ilbc_fuzzer") {
@@ -279,7 +260,6 @@
     "../../base:rtc_base_approved",
     "../../base:rtc_base_tests_utils",
     "../../modules/audio_coding:neteq",
-    "../../modules/audio_coding:neteq_test_tools",
     "../../modules/audio_coding:neteq_tools_minimal",
     "../../modules/audio_coding:pcm16b",
     "../../modules/rtp_rtcp",
@@ -333,7 +313,6 @@
     "pseudotcp_parser_fuzzer.cc",
   ]
   deps = [
-    "../../base:rtc_base",
     "../../p2p:rtc_p2p",
   ]
 }
@@ -343,7 +322,6 @@
     "transport_feedback_packet_loss_tracker_fuzzer.cc",
   ]
   deps = [
-    "../../base:rtc_base_approved",
     "../../modules/rtp_rtcp",
     "../../voice_engine",
   ]