Audio encoder tests: Create audio encoders the new way

Specifically, don't expect the ACM to be able to create encoders; we
have to give it an encoder that we make ourselves.

Bug: webrtc:8396
Change-Id: I032b12f3813af6ac3ea0dfb688006899dffe4855
Reviewed-on: https://webrtc-review.googlesource.com/94150
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24323}
diff --git a/modules/audio_coding/test/PacketLossTest.cc b/modules/audio_coding/test/PacketLossTest.cc
index c5cb396..da6ea1c 100644
--- a/modules/audio_coding/test/PacketLossTest.cc
+++ b/modules/audio_coding/test/PacketLossTest.cc
@@ -97,10 +97,13 @@
 }
 
 bool SenderWithFEC::SetFEC(bool enable_fec) {
-  if (_acm->SetCodecFEC(enable_fec) == 0) {
-    return true;
-  }
-  return false;
+  bool success = false;
+  _acm->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* enc) {
+    if (*enc && (*enc)->SetFec(enable_fec)) {
+      success = true;
+    }
+  });
+  return success;
 }
 
 bool SenderWithFEC::SetPacketLossRate(int expected_loss_rate) {