Remove SIMULATED_WAIT

Bug: webrtc:381524905
Change-Id: I24c455d6656412a9ce2e16250564d9986a6a6964
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/460080
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47280}
diff --git a/media/BUILD.gn b/media/BUILD.gn
index d02dea6..54d8b8b 100644
--- a/media/BUILD.gn
+++ b/media/BUILD.gn
@@ -871,7 +871,6 @@
       "../rtc_base:checks",
       "../rtc_base:copy_on_write_buffer",
       "../rtc_base:dscp",
-      "../rtc_base:gunit_helpers",
       "../rtc_base:logging",
       "../rtc_base:macromagic",
       "../rtc_base:network_route",
diff --git a/modules/audio_processing/aec3/BUILD.gn b/modules/audio_processing/aec3/BUILD.gn
index 6b5279b..d0e1c0d 100644
--- a/modules/audio_processing/aec3/BUILD.gn
+++ b/modules/audio_processing/aec3/BUILD.gn
@@ -325,7 +325,6 @@
       "../../../api/environment:environment_factory",
       "../../../rtc_base:checks",
       "../../../rtc_base:cpu_info",
-      "../../../rtc_base:gunit_helpers",
       "../../../rtc_base:random",
       "../../../rtc_base:safe_minmax",
       "../../../rtc_base:stringutils",
diff --git a/modules/audio_processing/agc2/BUILD.gn b/modules/audio_processing/agc2/BUILD.gn
index 92276ee..55e28a7 100644
--- a/modules/audio_processing/agc2/BUILD.gn
+++ b/modules/audio_processing/agc2/BUILD.gn
@@ -304,7 +304,6 @@
     "..:apm_logging",
     "../../../api/audio:audio_processing",
     "../../../rtc_base:checks",
-    "../../../rtc_base:gunit_helpers",
     "../../../test:test_support",
   ]
 }
@@ -323,7 +322,6 @@
     "..:audio_frame_view",
     "../../../api/audio:audio_processing",
     "../../../common_audio",
-    "../../../rtc_base:gunit_helpers",
     "../../../test:test_support",
   ]
 }
@@ -337,7 +335,6 @@
     ":gain_applier",
     ":test_utils",
     "../../../api/audio:audio_frame_api",
-    "../../../rtc_base:gunit_helpers",
     "../../../test:test_support",
   ]
 }
@@ -354,7 +351,6 @@
     ":common",
     ":saturation_protector",
     "..:apm_logging",
-    "../../../rtc_base:gunit_helpers",
     "../../../test:test_support",
   ]
 }
@@ -364,7 +360,6 @@
   sources = [ "biquad_filter_unittest.cc" ]
   deps = [
     ":biquad_filter",
-    "../../../rtc_base:gunit_helpers",
     "../../../test:test_support",
   ]
 }
@@ -393,7 +388,6 @@
     "../../../api/audio:audio_frame_api",
     "../../../common_audio",
     "../../../rtc_base:checks",
-    "../../../rtc_base:gunit_helpers",
     "../../../system_wrappers:metrics",
     "../../../test:test_support",
   ]
@@ -442,7 +436,6 @@
     "../../../api:function_view",
     "../../../api/audio:audio_frame_api",
     "../../../rtc_base:checks",
-    "../../../rtc_base:gunit_helpers",
     "../../../test:test_support",
   ]
 }
@@ -455,7 +448,6 @@
     ":vad_wrapper",
     "../../../api/audio:audio_frame_api",
     "../../../rtc_base:checks",
-    "../../../rtc_base:gunit_helpers",
     "../../../rtc_base:safe_compare",
     "../../../test:test_support",
   ]
diff --git a/modules/audio_processing/capture_levels_adjuster/BUILD.gn b/modules/audio_processing/capture_levels_adjuster/BUILD.gn
index b8df947..61292c7 100644
--- a/modules/audio_processing/capture_levels_adjuster/BUILD.gn
+++ b/modules/audio_processing/capture_levels_adjuster/BUILD.gn
@@ -38,7 +38,6 @@
     ":capture_levels_adjuster",
     "..:audio_buffer",
     "..:audioproc_test_utils",
-    "../../../rtc_base:gunit_helpers",
     "../../../rtc_base:stringutils",
     "../../../test:test_support",
   ]
diff --git a/modules/audio_processing/capture_mixer/BUILD.gn b/modules/audio_processing/capture_mixer/BUILD.gn
index 16dfba7..c7b2b4c 100644
--- a/modules/audio_processing/capture_mixer/BUILD.gn
+++ b/modules/audio_processing/capture_mixer/BUILD.gn
@@ -48,7 +48,6 @@
   deps = [
     ":capture_mixer",
     "..:audioproc_test_utils",
-    "../../../rtc_base:gunit_helpers",
     "../../../rtc_base:stringutils",
     "../../../test:test_support",
   ]
diff --git a/modules/video_capture/BUILD.gn b/modules/video_capture/BUILD.gn
index 741380d..ef4c4ff 100644
--- a/modules/video_capture/BUILD.gn
+++ b/modules/video_capture/BUILD.gn
@@ -193,7 +193,6 @@
         "../../api/video:video_rtp_headers",
         "../../common_video",
         "../../rtc_base:checks",
-        "../../rtc_base:gunit_helpers",
         "../../rtc_base:macromagic",
         "../../rtc_base:timeutils",
         "../../rtc_base/synchronization:mutex",
diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn
index bc12178..8ff2369 100644
--- a/p2p/BUILD.gn
+++ b/p2p/BUILD.gn
@@ -1195,7 +1195,6 @@
       "../rtc_base:copy_on_write_buffer",
       "../rtc_base:crypto_random",
       "../rtc_base:dscp",
-      "../rtc_base:gunit_helpers",
       "../rtc_base:ip_address",
       "../rtc_base:logging",
       "../rtc_base:mdns_responder_interface",
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index 29888f0..7f9af04 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -751,7 +751,6 @@
 
     sources = [ "task_queue_stdlib_unittest.cc" ]
     deps = [
-      ":gunit_helpers",
       ":logging",
       ":rtc_event",
       ":rtc_task_queue_stdlib",
@@ -1415,7 +1414,6 @@
     sources = [ "async_packet_socket_unittest.cc" ]
     deps = [
       ":async_packet_socket",
-      ":gunit_helpers",
       ":socket",
       ":socket_address",
       "../test:test_support",
@@ -1429,7 +1427,6 @@
     deps = [
       ":async_packet_socket",
       ":async_udp_socket",
-      ":gunit_helpers",
       ":mock_socket",
       ":rtc_base_tests_utils",
       ":socket",
@@ -1450,7 +1447,6 @@
     deps = [
       ":async_packet_socket",
       ":async_tcp_socket",
-      ":gunit_helpers",
       ":net_helpers",
       ":rtc_base_tests_utils",
       ":socket",
@@ -1739,19 +1735,6 @@
   sources = [ "gtest_prod_util.h" ]
 }
 
-rtc_library("gunit_helpers") {
-  testonly = true
-  sources = [ "gunit.h" ]
-  deps = [
-    ":logging",
-    ":rtc_base_tests_utils",
-    ":stringutils",
-    ":threading",
-    "../test:test_support",
-    "//third_party/abseil-cpp/absl/strings:string_view",
-  ]
-}
-
 rtc_library("testclient") {
   testonly = true
   sources = [
@@ -1762,7 +1745,6 @@
     ":async_packet_socket",
     ":async_udp_socket",
     ":buffer",
-    ":gunit_helpers",
     ":rtc_base_tests_utils",
     ":socket",
     ":socket_address",
@@ -1783,7 +1765,6 @@
   sources = [ "callback_list_unittest.cc" ]
   deps = [
     ":callback_list",
-    ":gunit_helpers",
     ":untyped_function",
     "../api:function_view",
     "../test:test_support",
@@ -1995,7 +1976,6 @@
     sources = [ "operations_chain_unittest.cc" ]
     deps = [
       ":checks",
-      ":gunit_helpers",
       ":rtc_event",
       ":rtc_operations_chain",
       ":threading",
@@ -2026,7 +2006,6 @@
         ":buffer",
         ":checks",
         ":file_rotating_stream",
-        ":gunit_helpers",
         ":ip_address",
         ":logging",
         ":net_helpers",
@@ -2127,7 +2106,6 @@
         ":divide_round",
         ":event_tracer",
         ":frequency_tracker",
-        ":gunit_helpers",
         ":histogram_percentile_counter",
         ":ip_address",
         ":logging",
@@ -2202,7 +2180,6 @@
 
       sources = [ "task_queue_unittest.cc" ]
       deps = [
-        ":gunit_helpers",
         ":rtc_base_tests_utils",
         ":rtc_event",
         ":task_queue_for_test",
@@ -2219,7 +2196,6 @@
 
       sources = [ "weak_ptr_unittest.cc" ]
       deps = [
-        ":gunit_helpers",
         ":rtc_base_tests_utils",
         ":rtc_event",
         ":task_queue_for_test",
@@ -2259,7 +2235,6 @@
 
       sources = [ "strings/json_unittest.cc" ]
       deps = [
-        ":gunit_helpers",
         ":rtc_base_tests_utils",
         ":rtc_json",
         "../test:test_support",
@@ -2303,7 +2278,6 @@
         ":data_rate_limiter",
         ":denormal_disabler",
         ":digest",
-        ":gunit_helpers",
         ":ifaddrs_converter",
         ":ip_address",
         ":logging",
diff --git a/rtc_base/experiments/BUILD.gn b/rtc_base/experiments/BUILD.gn
index 13601c3..98d3025 100644
--- a/rtc_base/experiments/BUILD.gn
+++ b/rtc_base/experiments/BUILD.gn
@@ -235,7 +235,6 @@
       ":quality_scaler_settings",
       ":quality_scaling_experiment",
       ":rate_control_settings",
-      "..:gunit_helpers",
       "../../api:field_trials",
       "../../api:field_trials_view",
       "../../api/units:data_rate",
diff --git a/rtc_base/gunit.h b/rtc_base/gunit.h
deleted file mode 100644
index cf61fab..0000000
--- a/rtc_base/gunit.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- *  Copyright 2004 The WebRTC Project Authors. All rights reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef RTC_BASE_GUNIT_H_
-#define RTC_BASE_GUNIT_H_
-
-// TODO(bugs.webrtc.org/42226242): remove transitive includes
-#include "rtc_base/thread.h"  // IWYU pragma: keep
-#include "test/gtest.h"       // IWYU pragma: keep
-
-// Wait until "ex" is true, or "timeout" expires, using fake clock where
-// messages are processed every millisecond.
-// TODO(pthatcher): Allow tests to control how many milliseconds to advance.
-#define SIMULATED_WAIT(ex, timeout, clock)                          \
-  for (int64_t wait_start = ::webrtc::TimeMillis();                 \
-       !(ex) && ::webrtc::TimeMillis() < wait_start + (timeout);) { \
-    (clock).AdvanceTime(webrtc::TimeDelta::Millis(1));              \
-  }
-
-#endif  // RTC_BASE_GUNIT_H_
diff --git a/rtc_base/win32_unittest.cc b/rtc_base/win32_unittest.cc
index 902f915..863376f 100644
--- a/rtc_base/win32_unittest.cc
+++ b/rtc_base/win32_unittest.cc
@@ -12,7 +12,6 @@
 
 #include <string>
 
-#include "rtc_base/gunit.h"
 #include "rtc_base/ip_address.h"
 #include "rtc_base/net_helpers.h"
 #include "test/gtest.h"
diff --git a/rtc_tools/network_tester/BUILD.gn b/rtc_tools/network_tester/BUILD.gn
index fd98be7..f396547 100644
--- a/rtc_tools/network_tester/BUILD.gn
+++ b/rtc_tools/network_tester/BUILD.gn
@@ -90,7 +90,6 @@
       "../../api:rtc_error_matchers",
       "../../api/environment",
       "../../api/environment:environment_factory",
-      "../../rtc_base:gunit_helpers",
       "../../rtc_base:random",
       "../../rtc_base:threading",
       "../../rtc_base:timeutils",
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index 065df50..5252eb9 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -1236,9 +1236,9 @@
             "../media:rtc_media_base",
             "../media:rtc_media_tests_utils",
             "../modules/video_coding:video_codec_interface",
-            "../rtc_base:gunit_helpers",
             "../rtc_base:refcount",
             "../rtc_base:rtc_event",
+            "../rtc_base:threading",
             "../rtc_base/system:unused",
             "../system_wrappers",
             "../test:create_test_environment",
diff --git a/sdk/objc/unittests/RTCAudioSessionTest.mm b/sdk/objc/unittests/RTCAudioSessionTest.mm
index 03f7b69..a8c0679 100644
--- a/sdk/objc/unittests/RTCAudioSessionTest.mm
+++ b/sdk/objc/unittests/RTCAudioSessionTest.mm
@@ -12,10 +12,12 @@
 #import <OCMock/OCMock.h>
 #import <XCTest/XCTest.h>
 
+#include "rtc_base/thread.h"
+#include "test/gtest.h"
+
 #include <vector>
 
 #include "rtc_base/event.h"
-#include "rtc_base/gunit.h"
 
 #import "components/audio/RTCAudioSession+Private.h"
 
@@ -25,8 +27,9 @@
 @interface RTC_OBJC_TYPE (RTCAudioSession)
 (UnitTesting)
 
-    @property(nonatomic, readonly) std::vector<
-        __weak id<RTC_OBJC_TYPE(RTCAudioSessionDelegate)> > delegates;
+    @property(nonatomic, readonly)
+        std::vector<__weak id<RTC_OBJC_TYPE(RTCAudioSessionDelegate)> >
+            delegates;
 
 - (instancetype)initWithAudioSession:(id)audioSession;
 
diff --git a/sdk/objc/unittests/RTCCertificateTest.mm b/sdk/objc/unittests/RTCCertificateTest.mm
index 64c68e0..3af2f6a 100644
--- a/sdk/objc/unittests/RTCCertificateTest.mm
+++ b/sdk/objc/unittests/RTCCertificateTest.mm
@@ -11,9 +11,9 @@
 #import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
 
-#include <vector>
+#include "test/gtest.h"
 
-#include "rtc_base/gunit.h"
+#include <vector>
 
 #import "api/peerconnection/RTCConfiguration+Private.h"
 #import "api/peerconnection/RTCConfiguration.h"
diff --git a/sdk/objc/unittests/RTCConfigurationTest.mm b/sdk/objc/unittests/RTCConfigurationTest.mm
index 5c8fca0..2716b1e 100644
--- a/sdk/objc/unittests/RTCConfigurationTest.mm
+++ b/sdk/objc/unittests/RTCConfigurationTest.mm
@@ -11,9 +11,9 @@
 #import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
 
-#include <vector>
+#include "test/gtest.h"
 
-#include "rtc_base/gunit.h"
+#include <vector>
 
 #import "api/peerconnection/RTCConfiguration+Private.h"
 #import "api/peerconnection/RTCConfiguration.h"
diff --git a/sdk/objc/unittests/RTCDataChannelConfigurationTest.mm b/sdk/objc/unittests/RTCDataChannelConfigurationTest.mm
index ccebd74..e2a0ab0 100644
--- a/sdk/objc/unittests/RTCDataChannelConfigurationTest.mm
+++ b/sdk/objc/unittests/RTCDataChannelConfigurationTest.mm
@@ -11,7 +11,7 @@
 #import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
 
-#include "rtc_base/gunit.h"
+#include "test/gtest.h"
 
 #import "api/peerconnection/RTCDataChannelConfiguration+Private.h"
 #import "api/peerconnection/RTCDataChannelConfiguration.h"
diff --git a/sdk/objc/unittests/RTCFileVideoCapturer_xctest.mm b/sdk/objc/unittests/RTCFileVideoCapturer_xctest.mm
index 9e5f227..e4a6847 100644
--- a/sdk/objc/unittests/RTCFileVideoCapturer_xctest.mm
+++ b/sdk/objc/unittests/RTCFileVideoCapturer_xctest.mm
@@ -12,8 +12,9 @@
 
 #import <XCTest/XCTest.h>
 
+#include "test/gtest.h"
+
 #include "api/test/rtc_error_matchers.h"
-#include "rtc_base/gunit.h"
 #include "test/gmock.h"
 #include "test/wait_until.h"
 
diff --git a/sdk/objc/unittests/RTCIceCandidateTest.mm b/sdk/objc/unittests/RTCIceCandidateTest.mm
index 268d330..b89a55d 100644
--- a/sdk/objc/unittests/RTCIceCandidateTest.mm
+++ b/sdk/objc/unittests/RTCIceCandidateTest.mm
@@ -11,9 +11,9 @@
 #import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
 
-#include <memory>
+#include "test/gtest.h"
 
-#include "rtc_base/gunit.h"
+#include <memory>
 
 #import "api/peerconnection/RTCIceCandidate+Private.h"
 #import "api/peerconnection/RTCIceCandidate.h"
diff --git a/sdk/objc/unittests/RTCIceServerTest.mm b/sdk/objc/unittests/RTCIceServerTest.mm
index 2916396..0d1919d 100644
--- a/sdk/objc/unittests/RTCIceServerTest.mm
+++ b/sdk/objc/unittests/RTCIceServerTest.mm
@@ -11,9 +11,9 @@
 #import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
 
-#include <vector>
+#include "test/gtest.h"
 
-#include "rtc_base/gunit.h"
+#include <vector>
 
 #import "api/peerconnection/RTCIceServer+Private.h"
 #import "api/peerconnection/RTCIceServer.h"
diff --git a/sdk/objc/unittests/RTCMediaConstraintsTest.mm b/sdk/objc/unittests/RTCMediaConstraintsTest.mm
index 60d68f3e..7b67147 100644
--- a/sdk/objc/unittests/RTCMediaConstraintsTest.mm
+++ b/sdk/objc/unittests/RTCMediaConstraintsTest.mm
@@ -11,9 +11,9 @@
 #import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
 
-#include <memory>
+#include "test/gtest.h"
 
-#include "rtc_base/gunit.h"
+#include <memory>
 
 #import "api/peerconnection/RTCMediaConstraints+Private.h"
 #import "api/peerconnection/RTCMediaConstraints.h"
diff --git a/sdk/objc/unittests/RTCPeerConnectionFactoryBuilderTest.mm b/sdk/objc/unittests/RTCPeerConnectionFactoryBuilderTest.mm
index 115b5e2..15eb6ca 100644
--- a/sdk/objc/unittests/RTCPeerConnectionFactoryBuilderTest.mm
+++ b/sdk/objc/unittests/RTCPeerConnectionFactoryBuilderTest.mm
@@ -10,6 +10,8 @@
 
 #import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
+
+#include "test/gtest.h"
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -28,7 +30,6 @@
 #include "api/video_codecs/video_decoder_factory.h"
 #include "api/video_codecs/video_encoder_factory.h"
 
-#include "rtc_base/gunit.h"
 #include "rtc_base/system/unused.h"
 
 @interface RTCPeerConnectionFactoryBuilderTests : XCTestCase
diff --git a/sdk/objc/unittests/RTCPeerConnectionTest.mm b/sdk/objc/unittests/RTCPeerConnectionTest.mm
index e2c05f9..57a0894 100644
--- a/sdk/objc/unittests/RTCPeerConnectionTest.mm
+++ b/sdk/objc/unittests/RTCPeerConnectionTest.mm
@@ -11,11 +11,11 @@
 #import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
 
+#include "test/gtest.h"
+
 #include <memory>
 #include <vector>
 
-#include "rtc_base/gunit.h"
-
 #import "api/peerconnection/RTCConfiguration+Private.h"
 #import "api/peerconnection/RTCConfiguration.h"
 #import "api/peerconnection/RTCCryptoOptions.h"
diff --git a/sdk/objc/unittests/RTCSessionDescriptionTest.mm b/sdk/objc/unittests/RTCSessionDescriptionTest.mm
index d64abce..790fcd7 100644
--- a/sdk/objc/unittests/RTCSessionDescriptionTest.mm
+++ b/sdk/objc/unittests/RTCSessionDescriptionTest.mm
@@ -11,8 +11,9 @@
 #import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
 
+#include "test/gtest.h"
+
 #include "api/jsep.h"
-#include "rtc_base/gunit.h"
 
 #import "api/peerconnection/RTCSessionDescription+Private.h"
 #import "api/peerconnection/RTCSessionDescription.h"
diff --git a/sdk/objc/unittests/RTCTracingTest.mm b/sdk/objc/unittests/RTCTracingTest.mm
index 63008a7..1d613ea 100644
--- a/sdk/objc/unittests/RTCTracingTest.mm
+++ b/sdk/objc/unittests/RTCTracingTest.mm
@@ -11,9 +11,9 @@
 #import <Foundation/Foundation.h>
 #import <XCTest/XCTest.h>
 
-#include <vector>
+#include "test/gtest.h"
 
-#include "rtc_base/gunit.h"
+#include <vector>
 
 #import "api/peerconnection/RTCTracing.h"
 #import "helpers/NSString+StdString.h"
diff --git a/sdk/objc/unittests/avformatmappertests.mm b/sdk/objc/unittests/avformatmappertests.mm
index 06aefb4..2d8d2d3 100644
--- a/sdk/objc/unittests/avformatmappertests.mm
+++ b/sdk/objc/unittests/avformatmappertests.mm
@@ -11,7 +11,7 @@
 #import <Foundation/Foundation.h>
 #import <OCMock/OCMock.h>
 
-#include "rtc_base/gunit.h"
+#include "test/gtest.h"
 
 // Width and height don't play any role so lets use predefined values throughout
 // the tests.
diff --git a/sdk/objc/unittests/nalu_rewriter_xctest.mm b/sdk/objc/unittests/nalu_rewriter_xctest.mm
index 82260a5..ac98010 100644
--- a/sdk/objc/unittests/nalu_rewriter_xctest.mm
+++ b/sdk/objc/unittests/nalu_rewriter_xctest.mm
@@ -12,7 +12,6 @@
 
 #include "common_video/h264/h264_common.h"
 #include "components/video_codec/nalu_rewriter.h"
-#include "rtc_base/gunit.h"
 
 #import <XCTest/XCTest.h>
 
@@ -212,11 +211,8 @@
   CMSampleBufferRef out_sample_buffer = nil;
   CMVideoFormatDescriptionRef description = [self createDescription];
 
-  Boolean result =
-      webrtc::H264AnnexBBufferToCMSampleBuffer(annex_b_test_data,
-                                               description,
-                                               &out_sample_buffer,
-                                               memory_pool);
+  Boolean result = webrtc::H264AnnexBBufferToCMSampleBuffer(
+      annex_b_test_data, description, &out_sample_buffer, memory_pool);
 
   XCTAssertTrue(result);
 
diff --git a/sdk/objc/unittests/objc_video_decoder_factory_tests.mm b/sdk/objc/unittests/objc_video_decoder_factory_tests.mm
index 3a8748e..e3008a1 100644
--- a/sdk/objc/unittests/objc_video_decoder_factory_tests.mm
+++ b/sdk/objc/unittests/objc_video_decoder_factory_tests.mm
@@ -12,6 +12,8 @@
 #import <OCMock/OCMock.h>
 #import <XCTest/XCTest.h>
 
+#include "test/gtest.h"
+
 #include "sdk/objc/native/src/objc_video_decoder_factory.h"
 
 #include "api/environment/environment_factory.h"
@@ -20,7 +22,6 @@
 #include "media/base/codec.h"
 #include "modules/video_coding/include/video_codec_interface.h"
 #include "modules/video_coding/include/video_error_codes.h"
-#include "rtc_base/gunit.h"
 #import "sdk/objc/base/RTCMacros.h"
 
 id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)> CreateDecoderFactoryReturning(
diff --git a/sdk/objc/unittests/objc_video_encoder_factory_tests.mm b/sdk/objc/unittests/objc_video_encoder_factory_tests.mm
index 12b9c99..4c0c435 100644
--- a/sdk/objc/unittests/objc_video_encoder_factory_tests.mm
+++ b/sdk/objc/unittests/objc_video_encoder_factory_tests.mm
@@ -12,6 +12,8 @@
 #import <OCMock/OCMock.h>
 #import <XCTest/XCTest.h>
 
+#include "test/gtest.h"
+
 #include "sdk/objc/native/src/objc_video_encoder_factory.h"
 
 #include "api/environment/environment_factory.h"
@@ -23,7 +25,6 @@
 #import "components/video_frame_buffer/RTCCVPixelBuffer.h"
 #include "modules/video_coding/include/video_codec_interface.h"
 #include "modules/video_coding/include/video_error_codes.h"
-#include "rtc_base/gunit.h"
 #include "sdk/objc/native/src/objc_frame_buffer.h"
 
 id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)> CreateEncoderFactoryReturning(
diff --git a/stats/BUILD.gn b/stats/BUILD.gn
index a523cb8..5626cc5 100644
--- a/stats/BUILD.gn
+++ b/stats/BUILD.gn
@@ -63,7 +63,6 @@
       "../api:scoped_refptr",
       "../api/units:timestamp",
       "../rtc_base:checks",
-      "../rtc_base:gunit_helpers",
       "../rtc_base:rtc_json",
       "../test:test_support",
     ]
diff --git a/test/pc/e2e/BUILD.gn b/test/pc/e2e/BUILD.gn
index 058a694..20b8524 100644
--- a/test/pc/e2e/BUILD.gn
+++ b/test/pc/e2e/BUILD.gn
@@ -348,7 +348,6 @@
         "../../../modules/audio_device:audio_device_impl",
         "../../../pc:pc_test_utils",
         "../../../pc:peerconnection_wrapper",
-        "../../../rtc_base:gunit_helpers",
         "../../../rtc_base:logging",
         "../../../rtc_base:rtc_event",
         "../../../test:fileutils",