[WebRTC-SendPacketsOnWorkerThread] Cleanup TaskQueuePacedSender

This remove use of MaybeWorkerThread from TaskQueuePacedSender. Instead,
the TaskQueue used when creating the TaskQueuePacedSender is used for
pacing. That is, the "worker thread".

Bug: webrtc:14502
Change-Id: I504f8e634653af6493e609db6e42b07d488fd699
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300820
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39813}
diff --git a/call/rtp_transport_controller_send.cc b/call/rtp_transport_controller_send.cc
index 2d871ce..1225e58 100644
--- a/call/rtp_transport_controller_send.cc
+++ b/call/rtp_transport_controller_send.cc
@@ -81,7 +81,6 @@
       pacer_(clock,
              &packet_router_,
              *config.trials,
-             config.task_queue_factory,
              TimeDelta::Millis(5),
              3,
              config.pacer_burst_interval),
diff --git a/modules/pacing/task_queue_paced_sender.cc b/modules/pacing/task_queue_paced_sender.cc
index 2747760..b5dfdd4 100644
--- a/modules/pacing/task_queue_paced_sender.cc
+++ b/modules/pacing/task_queue_paced_sender.cc
@@ -40,7 +40,6 @@
     Clock* clock,
     PacingController::PacketSender* packet_sender,
     const FieldTrialsView& field_trials,
-    TaskQueueFactory* task_queue_factory,
     TimeDelta max_hold_back_window,
     int max_hold_back_window_in_packets,
     absl::optional<TimeDelta> burst_interval)
@@ -54,7 +53,7 @@
       is_shutdown_(false),
       packet_size_(/*alpha=*/0.95),
       include_overhead_(false),
-      task_queue_(field_trials, "TaskQueuePacedSender", task_queue_factory) {
+      task_queue_(TaskQueueBase::Current()) {
   RTC_DCHECK_GE(max_hold_back_window_, PacingController::kMinSleepTime);
   // There are multiple field trials that can affect burst. If multiple bursts
   // are specified we pick the largest of the values.
@@ -70,70 +69,52 @@
 }
 
 TaskQueuePacedSender::~TaskQueuePacedSender() {
-  // Post an immediate task to mark the queue as shutting down.
-  // The rtc::TaskQueue destructor will wait for pending tasks to
-  // complete before continuing.
-  task_queue_.RunOrPost([&]() {
-    RTC_DCHECK_RUN_ON(&task_queue_);
-    is_shutdown_ = true;
-  });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  is_shutdown_ = true;
 }
 
 void TaskQueuePacedSender::EnsureStarted() {
-  task_queue_.RunOrPost([this]() {
-    RTC_DCHECK_RUN_ON(&task_queue_);
-    is_started_ = true;
-    MaybeProcessPackets(Timestamp::MinusInfinity());
-  });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  is_started_ = true;
+  MaybeProcessPackets(Timestamp::MinusInfinity());
 }
 
 void TaskQueuePacedSender::CreateProbeClusters(
     std::vector<ProbeClusterConfig> probe_cluster_configs) {
-  task_queue_.RunOrPost(
-      [this, probe_cluster_configs = std::move(probe_cluster_configs)]() {
-        RTC_DCHECK_RUN_ON(&task_queue_);
-        pacing_controller_.CreateProbeClusters(probe_cluster_configs);
-        MaybeProcessPackets(Timestamp::MinusInfinity());
-      });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  pacing_controller_.CreateProbeClusters(probe_cluster_configs);
+  MaybeProcessPackets(Timestamp::MinusInfinity());
 }
 
 void TaskQueuePacedSender::Pause() {
-  task_queue_.RunOrPost([this]() {
-    RTC_DCHECK_RUN_ON(&task_queue_);
-    pacing_controller_.Pause();
-  });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  pacing_controller_.Pause();
 }
 
 void TaskQueuePacedSender::Resume() {
-  task_queue_.RunOrPost([this]() {
-    RTC_DCHECK_RUN_ON(&task_queue_);
-    pacing_controller_.Resume();
-    MaybeProcessPackets(Timestamp::MinusInfinity());
-  });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  pacing_controller_.Resume();
+  MaybeProcessPackets(Timestamp::MinusInfinity());
 }
 
 void TaskQueuePacedSender::SetCongested(bool congested) {
-  task_queue_.RunOrPost([this, congested]() {
-    RTC_DCHECK_RUN_ON(&task_queue_);
-    pacing_controller_.SetCongested(congested);
-    MaybeProcessPackets(Timestamp::MinusInfinity());
-  });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  pacing_controller_.SetCongested(congested);
+  MaybeProcessPackets(Timestamp::MinusInfinity());
 }
 
 void TaskQueuePacedSender::SetPacingRates(DataRate pacing_rate,
                                           DataRate padding_rate) {
-  task_queue_.RunOrPost([this, pacing_rate, padding_rate]() {
-    RTC_DCHECK_RUN_ON(&task_queue_);
-    pacing_controller_.SetPacingRates(pacing_rate, padding_rate);
-    MaybeProcessPackets(Timestamp::MinusInfinity());
-  });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  pacing_controller_.SetPacingRates(pacing_rate, padding_rate);
+  MaybeProcessPackets(Timestamp::MinusInfinity());
 }
 
 void TaskQueuePacedSender::EnqueuePackets(
     std::vector<std::unique_ptr<RtpPacketToSend>> packets) {
-  task_queue_.TaskQueueForPost()->PostTask(task_queue_.MaybeSafeTask(
-      safety_.flag(), [this, packets = std::move(packets)]() mutable {
-        RTC_DCHECK_RUN_ON(&task_queue_);
+  task_queue_->PostTask(
+      SafeTask(safety_.flag(), [this, packets = std::move(packets)]() mutable {
+        RTC_DCHECK_RUN_ON(task_queue_);
         TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("webrtc"),
                      "TaskQueuePacedSender::EnqueuePackets");
         for (auto& packet : packets) {
@@ -155,45 +136,36 @@
 }
 
 void TaskQueuePacedSender::RemovePacketsForSsrc(uint32_t ssrc) {
-  task_queue_.TaskQueueForPost()->PostTask(
-      task_queue_.MaybeSafeTask(safety_.flag(), [this, ssrc] {
-        RTC_DCHECK_RUN_ON(&task_queue_);
-        pacing_controller_.RemovePacketsForSsrc(ssrc);
-        MaybeProcessPackets(Timestamp::MinusInfinity());
-      }));
+  task_queue_->PostTask(SafeTask(safety_.flag(), [this, ssrc] {
+    RTC_DCHECK_RUN_ON(task_queue_);
+    pacing_controller_.RemovePacketsForSsrc(ssrc);
+    MaybeProcessPackets(Timestamp::MinusInfinity());
+  }));
 }
 
 void TaskQueuePacedSender::SetAccountForAudioPackets(bool account_for_audio) {
-  task_queue_.RunOrPost([this, account_for_audio]() {
-    RTC_DCHECK_RUN_ON(&task_queue_);
-    pacing_controller_.SetAccountForAudioPackets(account_for_audio);
-    MaybeProcessPackets(Timestamp::MinusInfinity());
-  });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  pacing_controller_.SetAccountForAudioPackets(account_for_audio);
+  MaybeProcessPackets(Timestamp::MinusInfinity());
 }
 
 void TaskQueuePacedSender::SetIncludeOverhead() {
-  task_queue_.RunOrPost([this]() {
-    RTC_DCHECK_RUN_ON(&task_queue_);
-    include_overhead_ = true;
-    pacing_controller_.SetIncludeOverhead();
-    MaybeProcessPackets(Timestamp::MinusInfinity());
-  });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  include_overhead_ = true;
+  pacing_controller_.SetIncludeOverhead();
+  MaybeProcessPackets(Timestamp::MinusInfinity());
 }
 
 void TaskQueuePacedSender::SetTransportOverhead(DataSize overhead_per_packet) {
-  task_queue_.RunOrPost([this, overhead_per_packet]() {
-    RTC_DCHECK_RUN_ON(&task_queue_);
-    pacing_controller_.SetTransportOverhead(overhead_per_packet);
-    MaybeProcessPackets(Timestamp::MinusInfinity());
-  });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  pacing_controller_.SetTransportOverhead(overhead_per_packet);
+  MaybeProcessPackets(Timestamp::MinusInfinity());
 }
 
 void TaskQueuePacedSender::SetQueueTimeLimit(TimeDelta limit) {
-  task_queue_.RunOrPost([this, limit]() {
-    RTC_DCHECK_RUN_ON(&task_queue_);
-    pacing_controller_.SetQueueTimeLimit(limit);
-    MaybeProcessPackets(Timestamp::MinusInfinity());
-  });
+  RTC_DCHECK_RUN_ON(task_queue_);
+  pacing_controller_.SetQueueTimeLimit(limit);
+  MaybeProcessPackets(Timestamp::MinusInfinity());
 }
 
 TimeDelta TaskQueuePacedSender::ExpectedQueueTime() const {
@@ -224,13 +196,13 @@
 }
 
 void TaskQueuePacedSender::OnStatsUpdated(const Stats& stats) {
-  MutexLock lock(&stats_mutex_);
+  RTC_DCHECK_RUN_ON(task_queue_);
   current_stats_ = stats;
 }
 
 void TaskQueuePacedSender::MaybeProcessPackets(
     Timestamp scheduled_process_time) {
-  RTC_DCHECK_RUN_ON(&task_queue_);
+  RTC_DCHECK_RUN_ON(task_queue_);
 
   TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("webrtc"),
                "TaskQueuePacedSender::MaybeProcessPackets");
@@ -294,8 +266,8 @@
   if (next_process_time_.IsMinusInfinity() ||
       next_process_time_ > next_send_time) {
     // Prefer low precision if allowed and not probing.
-    task_queue_.TaskQueueForDelayedTasks()->PostDelayedHighPrecisionTask(
-        task_queue_.MaybeSafeTask(
+    task_queue_->PostDelayedHighPrecisionTask(
+        SafeTask(
             safety_.flag(),
             [this, next_send_time]() { MaybeProcessPackets(next_send_time); }),
         time_to_next_process.RoundUpTo(TimeDelta::Millis(1)));
@@ -314,7 +286,7 @@
 }
 
 TaskQueuePacedSender::Stats TaskQueuePacedSender::GetStats() const {
-  MutexLock lock(&stats_mutex_);
+  RTC_DCHECK_RUN_ON(task_queue_);
   return current_stats_;
 }
 
diff --git a/modules/pacing/task_queue_paced_sender.h b/modules/pacing/task_queue_paced_sender.h
index 4d51695..b8e7d78 100644
--- a/modules/pacing/task_queue_paced_sender.h
+++ b/modules/pacing/task_queue_paced_sender.h
@@ -50,11 +50,13 @@
   // a packet "debt" that correspond to approximately the send rate during the
   // specified interval. This greatly reduced wake ups by not pacing packets
   // within the allowed burst budget.
+  //
+  // The taskqueue used when constructing a TaskQueuePacedSender will also be
+  // used for pacing.
   TaskQueuePacedSender(
       Clock* clock,
       PacingController::PacketSender* packet_sender,
       const FieldTrialsView& field_trials,
-      TaskQueueFactory* task_queue_factory,
       TimeDelta max_hold_back_window,
       int max_hold_back_window_in_packets,
       absl::optional<TimeDelta> burst_interval = absl::nullopt);
@@ -178,13 +180,10 @@
   rtc::ExpFilter packet_size_ RTC_GUARDED_BY(task_queue_);
   bool include_overhead_ RTC_GUARDED_BY(task_queue_);
 
-  // TODO(webrtc:14502): Remove stats_mutex_ when pacer runs on the worker
-  // thread.
-  mutable Mutex stats_mutex_;
-  Stats current_stats_ RTC_GUARDED_BY(stats_mutex_);
+  Stats current_stats_ RTC_GUARDED_BY(task_queue_);
 
   ScopedTaskSafety safety_;
-  MaybeWorkerThread task_queue_;
+  TaskQueueBase* task_queue_;
 };
 }  // namespace webrtc
 #endif  // MODULES_PACING_TASK_QUEUE_PACED_SENDER_H_
diff --git a/modules/pacing/task_queue_paced_sender_unittest.cc b/modules/pacing/task_queue_paced_sender_unittest.cc
index a8a7b65..5434749 100644
--- a/modules/pacing/task_queue_paced_sender_unittest.cc
+++ b/modules/pacing/task_queue_paced_sender_unittest.cc
@@ -118,35 +118,11 @@
   return packets;
 }
 
-constexpr char kSendPacketOnWorkerThreadFieldTrialDisabled[] =
-    "WebRTC-SendPacketsOnWorkerThread/Disabled/";
-
-std::vector<std::string> ParameterizedFieldTrials() {
-  return {{""}, {kSendPacketOnWorkerThreadFieldTrialDisabled}};
-}
-
-bool UsingWorkerThread(absl::string_view field_trials) {
-  return field_trials.find(kSendPacketOnWorkerThreadFieldTrialDisabled) ==
-         std::string::npos;
-}
-
-class TaskQueuePacedSenderTest
-    : public ::testing::TestWithParam<std::string /*field_trials*/> {};
-
-INSTANTIATE_TEST_SUITE_P(TaskQueuePacedSenderTest,
-                         TaskQueuePacedSenderTest,
-                         testing::ValuesIn(ParameterizedFieldTrials()),
-                         [](const testing::TestParamInfo<std::string>& info) {
-                           return UsingWorkerThread(info.param) ? "UsingWt"
-                                                                : "OwnedTQ";
-                         });
-
-TEST_P(TaskQueuePacedSenderTest, PacesPackets) {
+TEST(TaskQueuePacedSenderTest, PacesPackets) {
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
-  ScopedKeyValueConfig trials(GetParam());
+  ScopedKeyValueConfig trials;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
                              PacingController::kMinSleepTime,
                              TaskQueuePacedSender::kNoPacketHoldback);
 
@@ -170,7 +146,7 @@
         if (packets_sent == kPacketsToSend) {
           end_time = time_controller.GetClock()->CurrentTime();
         }
-        EXPECT_EQ(sequence_checker.IsCurrent(), UsingWorkerThread(GetParam()));
+        EXPECT_TRUE(sequence_checker.IsCurrent());
       });
 
   const Timestamp start_time = time_controller.GetClock()->CurrentTime();
@@ -184,12 +160,12 @@
 }
 
 // Same test as above, but with 0.5s of burst applied.
-TEST_P(TaskQueuePacedSenderTest, PacesPacketsWithBurst) {
+TEST(TaskQueuePacedSenderTest, PacesPacketsWithBurst) {
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
-  ScopedKeyValueConfig trials(GetParam());
+  ScopedKeyValueConfig trials;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              PacingController::kMinSleepTime,
                              TaskQueuePacedSender::kNoPacketHoldback,
                              // Half a second of bursting.
@@ -215,7 +191,7 @@
         if (packets_sent == kPacketsToSend) {
           end_time = time_controller.GetClock()->CurrentTime();
         }
-        EXPECT_EQ(sequence_checker.IsCurrent(), UsingWorkerThread(GetParam()));
+        EXPECT_TRUE(sequence_checker.IsCurrent());
       });
 
   const Timestamp start_time = time_controller.GetClock()->CurrentTime();
@@ -230,12 +206,12 @@
   EXPECT_NEAR((end_time - start_time).ms<double>(), 500.0, 50.0);
 }
 
-TEST_P(TaskQueuePacedSenderTest, ReschedulesProcessOnRateChange) {
+TEST(TaskQueuePacedSenderTest, ReschedulesProcessOnRateChange) {
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
-  ScopedKeyValueConfig trials(GetParam());
+  ScopedKeyValueConfig trials;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              PacingController::kMinSleepTime,
                              TaskQueuePacedSender::kNoPacketHoldback);
 
@@ -284,12 +260,12 @@
               1.0);
 }
 
-TEST_P(TaskQueuePacedSenderTest, SendsAudioImmediately) {
+TEST(TaskQueuePacedSenderTest, SendsAudioImmediately) {
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
-  ScopedKeyValueConfig trials(GetParam());
+  ScopedKeyValueConfig trials;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              PacingController::kMinSleepTime,
                              TaskQueuePacedSender::kNoPacketHoldback);
 
@@ -316,13 +292,13 @@
   ::testing::Mock::VerifyAndClearExpectations(&packet_router);
 }
 
-TEST_P(TaskQueuePacedSenderTest, SleepsDuringCoalscingWindow) {
+TEST(TaskQueuePacedSenderTest, SleepsDuringCoalscingWindow) {
   const TimeDelta kCoalescingWindow = TimeDelta::Millis(5);
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
-  ScopedKeyValueConfig trials(GetParam());
+  ScopedKeyValueConfig trials;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              kCoalescingWindow,
                              TaskQueuePacedSender::kNoPacketHoldback);
 
@@ -353,13 +329,13 @@
   ::testing::Mock::VerifyAndClearExpectations(&packet_router);
 }
 
-TEST_P(TaskQueuePacedSenderTest, ProbingOverridesCoalescingWindow) {
+TEST(TaskQueuePacedSenderTest, ProbingOverridesCoalescingWindow) {
   const TimeDelta kCoalescingWindow = TimeDelta::Millis(5);
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
-  ScopedKeyValueConfig trials(GetParam());
+  ScopedKeyValueConfig trials;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              kCoalescingWindow,
                              TaskQueuePacedSender::kNoPacketHoldback);
 
@@ -390,13 +366,13 @@
   time_controller.AdvanceTime(kCoalescingWindow - TimeDelta::Millis(1));
 }
 
-TEST_P(TaskQueuePacedSenderTest, SchedulesProbeAtSentTime) {
+TEST(TaskQueuePacedSenderTest, SchedulesProbeAtSentTime) {
   ScopedKeyValueConfig trials(
-      GetParam() + "WebRTC-Bwe-ProbingBehavior/min_probe_delta:1ms/");
+      "WebRTC-Bwe-ProbingBehavior/min_probe_delta:1ms/");
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              PacingController::kMinSleepTime,
                              TaskQueuePacedSender::kNoPacketHoldback);
 
@@ -461,15 +437,15 @@
   time_controller.AdvanceTime(TimeDelta::Millis(2));
 }
 
-TEST_P(TaskQueuePacedSenderTest, NoMinSleepTimeWhenProbing) {
+TEST(TaskQueuePacedSenderTest, NoMinSleepTimeWhenProbing) {
   // Set min_probe_delta to be less than kMinSleepTime (1ms).
   const TimeDelta kMinProbeDelta = TimeDelta::Micros(200);
   ScopedKeyValueConfig trials(
-      GetParam() + "WebRTC-Bwe-ProbingBehavior/min_probe_delta:200us/");
+      "WebRTC-Bwe-ProbingBehavior/min_probe_delta:200us/");
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              PacingController::kMinSleepTime,
                              TaskQueuePacedSender::kNoPacketHoldback);
 
@@ -523,15 +499,15 @@
   EXPECT_EQ(data_sent, DataSize::Bytes(1) + kPacketSize + 4 * kMinProbeSize);
 }
 
-TEST_P(TaskQueuePacedSenderTest, PacketBasedCoalescing) {
+TEST(TaskQueuePacedSenderTest, PacketBasedCoalescing) {
   const TimeDelta kFixedCoalescingWindow = TimeDelta::Millis(10);
   const int kPacketBasedHoldback = 5;
 
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
-  ScopedKeyValueConfig trials(GetParam());
+  ScopedKeyValueConfig trials;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              kFixedCoalescingWindow, kPacketBasedHoldback);
 
   // Set rates so one packet adds one ms of buffer level.
@@ -573,15 +549,15 @@
   time_controller.AdvanceTime(TimeDelta::Millis(1));
 }
 
-TEST_P(TaskQueuePacedSenderTest, FixedHoldBackHasPriorityOverPackets) {
+TEST(TaskQueuePacedSenderTest, FixedHoldBackHasPriorityOverPackets) {
   const TimeDelta kFixedCoalescingWindow = TimeDelta::Millis(2);
   const int kPacketBasedHoldback = 5;
 
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
-  ScopedKeyValueConfig trials(GetParam());
+  ScopedKeyValueConfig trials;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              kFixedCoalescingWindow, kPacketBasedHoldback);
 
   // Set rates so one packet adds one ms of buffer level.
@@ -620,15 +596,15 @@
   time_controller.AdvanceTime(kFixedCoalescingWindow);
 }
 
-TEST_P(TaskQueuePacedSenderTest, ProbingStopDuringSendLoop) {
+TEST(TaskQueuePacedSenderTest, ProbingStopDuringSendLoop) {
   // Set a low `min_probe_delta` to let probing finish during send loop.
   ScopedKeyValueConfig trials(
-      GetParam() + "WebRTC-Bwe-ProbingBehavior/min_probe_delta:100us/");
+      "WebRTC-Bwe-ProbingBehavior/min_probe_delta:100us/");
 
   GlobalSimulatedTimeController time_controller(Timestamp::Millis(1234));
   MockPacketRouter packet_router;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              PacingController::kMinSleepTime,
                              TaskQueuePacedSender::kNoPacketHoldback);
 
@@ -670,13 +646,13 @@
   time_controller.AdvanceTime(kPacketsPacedTime + TimeDelta::Millis(1));
 }
 
-TEST_P(TaskQueuePacedSenderTest, PostedPacketsNotSendFromRemovePacketsForSsrc) {
+TEST(TaskQueuePacedSenderTest, PostedPacketsNotSendFromRemovePacketsForSsrc) {
   static constexpr Timestamp kStartTime = Timestamp::Millis(1234);
   GlobalSimulatedTimeController time_controller(kStartTime);
-  ScopedKeyValueConfig trials(GetParam());
+  ScopedKeyValueConfig trials;
   MockPacketRouter packet_router;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              PacingController::kMinSleepTime,
                              TaskQueuePacedSender::kNoPacketHoldback);
 
@@ -712,13 +688,13 @@
   EXPECT_EQ(pacer.ExpectedQueueTime(), TimeDelta::Zero());
 }
 
-TEST_P(TaskQueuePacedSenderTest, Stats) {
+TEST(TaskQueuePacedSenderTest, Stats) {
   static constexpr Timestamp kStartTime = Timestamp::Millis(1234);
   GlobalSimulatedTimeController time_controller(kStartTime);
   MockPacketRouter packet_router;
-  ScopedKeyValueConfig trials(GetParam());
+  ScopedKeyValueConfig trials;
   TaskQueuePacedSender pacer(time_controller.GetClock(), &packet_router, trials,
-                             time_controller.GetTaskQueueFactory(),
+
                              PacingController::kMinSleepTime,
                              TaskQueuePacedSender::kNoPacketHoldback);