diff --git a/pc/track_media_info_map_unittest.cc b/pc/track_media_info_map_unittest.cc
index 0adfbf3..affb363 100644
--- a/pc/track_media_info_map_unittest.cc
+++ b/pc/track_media_info_map_unittest.cc
@@ -33,6 +33,8 @@
 #include "test/gmock.h"
 #include "test/gtest.h"
 
+using ::testing::ElementsAre;
+
 namespace webrtc {
 
 namespace {
@@ -104,9 +106,7 @@
   TrackMediaInfoMapTest() : TrackMediaInfoMapTest(true) {}
 
   explicit TrackMediaInfoMapTest(bool use_real_video_track)
-      : voice_media_info_(new cricket::VoiceMediaInfo()),
-        video_media_info_(new cricket::VideoMediaInfo()),
-        local_audio_track_(AudioTrack::Create("LocalAudioTrack", nullptr)),
+      : local_audio_track_(AudioTrack::Create("LocalAudioTrack", nullptr)),
         remote_audio_track_(AudioTrack::Create("RemoteAudioTrack", nullptr)),
         local_video_track_(use_real_video_track
                                ? CreateVideoTrack("LocalVideoTrack")
@@ -115,15 +115,6 @@
                                 ? CreateVideoTrack("RemoteVideoTrack")
                                 : CreateMockVideoTrack("LocalVideoTrack")) {}
 
-  ~TrackMediaInfoMapTest() {
-    // If we have a map the ownership has been passed to the map, only delete if
-    // `CreateMap` has not been called.
-    if (!map_) {
-      delete voice_media_info_;
-      delete video_media_info_;
-    }
-  }
-
   void AddRtpSenderWithSsrcs(std::initializer_list<uint32_t> ssrcs,
                              MediaStreamTrackInterface* local_track) {
     rtc::scoped_refptr<MockRtpSenderInternal> rtp_sender = CreateMockRtpSender(
@@ -140,7 +131,7 @@
         voice_sender_info.local_stats.push_back(cricket::SsrcSenderInfo());
         voice_sender_info.local_stats[i++].ssrc = ssrc;
       }
-      voice_media_info_->senders.push_back(voice_sender_info);
+      voice_media_info_.senders.push_back(voice_sender_info);
     } else {
       cricket::VideoSenderInfo video_sender_info;
       size_t i = 0;
@@ -148,8 +139,8 @@
         video_sender_info.local_stats.push_back(cricket::SsrcSenderInfo());
         video_sender_info.local_stats[i++].ssrc = ssrc;
       }
-      video_media_info_->senders.push_back(video_sender_info);
-      video_media_info_->aggregated_senders.push_back(video_sender_info);
+      video_media_info_.senders.push_back(video_sender_info);
+      video_media_info_.aggregated_senders.push_back(video_sender_info);
     }
   }
 
@@ -169,7 +160,7 @@
         voice_receiver_info.local_stats.push_back(cricket::SsrcReceiverInfo());
         voice_receiver_info.local_stats[i++].ssrc = ssrc;
       }
-      voice_media_info_->receivers.push_back(voice_receiver_info);
+      voice_media_info_.receivers.push_back(voice_receiver_info);
     } else {
       cricket::VideoReceiverInfo video_receiver_info;
       size_t i = 0;
@@ -177,25 +168,26 @@
         video_receiver_info.local_stats.push_back(cricket::SsrcReceiverInfo());
         video_receiver_info.local_stats[i++].ssrc = ssrc;
       }
-      video_media_info_->receivers.push_back(video_receiver_info);
+      video_media_info_.receivers.push_back(video_receiver_info);
     }
   }
 
-  void CreateMap() {
-    RTC_DCHECK(!map_);
-    map_.reset(new TrackMediaInfoMap(
-        std::unique_ptr<cricket::VoiceMediaInfo>(voice_media_info_),
-        std::unique_ptr<cricket::VideoMediaInfo>(video_media_info_),
-        rtp_senders_, rtp_receivers_));
+  // Copies the current state of `voice_media_info_` and `video_media_info_`
+  // into the map.
+  void InitializeMap() {
+    map_.Initialize(voice_media_info_, video_media_info_, rtp_senders_,
+                    rtp_receivers_);
   }
 
- protected:
+ private:
   rtc::AutoThread main_thread_;
-  cricket::VoiceMediaInfo* voice_media_info_;
-  cricket::VideoMediaInfo* video_media_info_;
+  cricket::VoiceMediaInfo voice_media_info_;
+  cricket::VideoMediaInfo video_media_info_;
+
+ protected:
   std::vector<rtc::scoped_refptr<RtpSenderInternal>> rtp_senders_;
   std::vector<rtc::scoped_refptr<RtpReceiverInternal>> rtp_receivers_;
-  std::unique_ptr<TrackMediaInfoMap> map_;
+  TrackMediaInfoMap map_;
   rtc::scoped_refptr<AudioTrack> local_audio_track_;
   rtc::scoped_refptr<AudioTrack> remote_audio_track_;
   rtc::scoped_refptr<VideoTrackInterface> local_video_track_;
@@ -209,34 +201,32 @@
   AddRtpReceiverWithSsrcs({2}, remote_audio_track_.get());
   AddRtpSenderWithSsrcs({3}, local_video_track_.get());
   AddRtpReceiverWithSsrcs({4}, remote_video_track_.get());
-  CreateMap();
+  InitializeMap();
 
   // Local audio track <-> RTP audio sender
-  ASSERT_TRUE(map_->GetVoiceSenderInfos(*local_audio_track_));
-  EXPECT_EQ(
-      *map_->GetVoiceSenderInfos(*local_audio_track_),
-      std::vector<cricket::VoiceSenderInfo*>({&voice_media_info_->senders[0]}));
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVoiceSenderInfos(*local_audio_track_));
+  EXPECT_THAT(*map_.GetVoiceSenderInfos(*local_audio_track_),
+              ElementsAre(&map_.voice_media_info()->senders[0]));
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->senders[0]),
             local_audio_track_.get());
 
   // Remote audio track <-> RTP audio receiver
-  EXPECT_EQ(map_->GetVoiceReceiverInfo(*remote_audio_track_),
-            &voice_media_info_->receivers[0]);
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->receivers[0]),
+  EXPECT_EQ(map_.GetVoiceReceiverInfo(*remote_audio_track_),
+            &map_.voice_media_info()->receivers[0]);
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->receivers[0]),
             remote_audio_track_.get());
 
   // Local video track <-> RTP video sender
-  ASSERT_TRUE(map_->GetVideoSenderInfos(*local_video_track_));
-  EXPECT_EQ(
-      *map_->GetVideoSenderInfos(*local_video_track_),
-      std::vector<cricket::VideoSenderInfo*>({&video_media_info_->senders[0]}));
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVideoSenderInfos(*local_video_track_));
+  EXPECT_THAT(*map_.GetVideoSenderInfos(*local_video_track_),
+              ElementsAre(&map_.video_media_info()->senders[0]));
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->senders[0]),
             local_video_track_.get());
 
   // Remote video track <-> RTP video receiver
-  EXPECT_EQ(map_->GetVideoReceiverInfo(*remote_video_track_),
-            &video_media_info_->receivers[0]);
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->receivers[0]),
+  EXPECT_EQ(map_.GetVideoReceiverInfo(*remote_video_track_),
+            &map_.video_media_info()->receivers[0]);
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->receivers[0]),
             remote_video_track_.get());
 }
 
@@ -245,12 +235,12 @@
   AddRtpSenderWithSsrcs({}, local_video_track_.get());
   AddRtpReceiverWithSsrcs({}, remote_audio_track_.get());
   AddRtpReceiverWithSsrcs({}, remote_video_track_.get());
-  CreateMap();
+  InitializeMap();
 
-  EXPECT_FALSE(map_->GetVoiceSenderInfos(*local_audio_track_));
-  EXPECT_FALSE(map_->GetVideoSenderInfos(*local_video_track_));
-  EXPECT_FALSE(map_->GetVoiceReceiverInfo(*remote_audio_track_));
-  EXPECT_FALSE(map_->GetVideoReceiverInfo(*remote_video_track_));
+  EXPECT_FALSE(map_.GetVoiceSenderInfos(*local_audio_track_));
+  EXPECT_FALSE(map_.GetVideoSenderInfos(*local_video_track_));
+  EXPECT_FALSE(map_.GetVoiceReceiverInfo(*remote_audio_track_));
+  EXPECT_FALSE(map_.GetVideoReceiverInfo(*remote_video_track_));
 }
 
 TEST_F(TrackMediaInfoMapTest,
@@ -259,56 +249,52 @@
   AddRtpReceiverWithSsrcs({2}, remote_audio_track_.get());
   AddRtpSenderWithSsrcs({1}, local_video_track_.get());
   AddRtpReceiverWithSsrcs({2}, remote_video_track_.get());
-  CreateMap();
+  InitializeMap();
 
   // Local audio track <-> RTP audio sender
-  ASSERT_TRUE(map_->GetVoiceSenderInfos(*local_audio_track_));
-  EXPECT_EQ(
-      *map_->GetVoiceSenderInfos(*local_audio_track_),
-      std::vector<cricket::VoiceSenderInfo*>({&voice_media_info_->senders[0]}));
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVoiceSenderInfos(*local_audio_track_));
+  EXPECT_THAT(*map_.GetVoiceSenderInfos(*local_audio_track_),
+              ElementsAre(&map_.voice_media_info()->senders[0]));
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->senders[0]),
             local_audio_track_.get());
 
   // Remote audio track <-> RTP audio receiver
-  EXPECT_EQ(map_->GetVoiceReceiverInfo(*remote_audio_track_),
-            &voice_media_info_->receivers[0]);
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->receivers[0]),
+  EXPECT_EQ(map_.GetVoiceReceiverInfo(*remote_audio_track_),
+            &map_.voice_media_info()->receivers[0]);
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->receivers[0]),
             remote_audio_track_.get());
 
   // Local video track <-> RTP video sender
-  ASSERT_TRUE(map_->GetVideoSenderInfos(*local_video_track_));
-  EXPECT_EQ(
-      *map_->GetVideoSenderInfos(*local_video_track_),
-      std::vector<cricket::VideoSenderInfo*>({&video_media_info_->senders[0]}));
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVideoSenderInfos(*local_video_track_));
+  EXPECT_THAT(*map_.GetVideoSenderInfos(*local_video_track_),
+              ElementsAre(&map_.video_media_info()->senders[0]));
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->senders[0]),
             local_video_track_.get());
 
   // Remote video track <-> RTP video receiver
-  EXPECT_EQ(map_->GetVideoReceiverInfo(*remote_video_track_),
-            &video_media_info_->receivers[0]);
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->receivers[0]),
+  EXPECT_EQ(map_.GetVideoReceiverInfo(*remote_video_track_),
+            &map_.video_media_info()->receivers[0]);
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->receivers[0]),
             remote_video_track_.get());
 }
 
 TEST_F(TrackMediaInfoMapTest, SingleMultiSsrcSenderPerTrack) {
   AddRtpSenderWithSsrcs({1, 2}, local_audio_track_.get());
   AddRtpSenderWithSsrcs({3, 4}, local_video_track_.get());
-  CreateMap();
+  InitializeMap();
 
   // Local audio track <-> RTP audio senders
-  ASSERT_TRUE(map_->GetVoiceSenderInfos(*local_audio_track_));
-  EXPECT_EQ(
-      *map_->GetVoiceSenderInfos(*local_audio_track_),
-      std::vector<cricket::VoiceSenderInfo*>({&voice_media_info_->senders[0]}));
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVoiceSenderInfos(*local_audio_track_));
+  EXPECT_THAT(*map_.GetVoiceSenderInfos(*local_audio_track_),
+              ElementsAre(&map_.voice_media_info()->senders[0]));
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->senders[0]),
             local_audio_track_.get());
 
   // Local video track <-> RTP video senders
-  ASSERT_TRUE(map_->GetVideoSenderInfos(*local_video_track_));
-  EXPECT_EQ(
-      *map_->GetVideoSenderInfos(*local_video_track_),
-      std::vector<cricket::VideoSenderInfo*>({&video_media_info_->senders[0]}));
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVideoSenderInfos(*local_video_track_));
+  EXPECT_THAT(*map_.GetVideoSenderInfos(*local_video_track_),
+              ElementsAre(&map_.video_media_info()->senders[0]));
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->senders[0]),
             local_video_track_.get());
 }
 
@@ -317,28 +303,26 @@
   AddRtpSenderWithSsrcs({2}, local_audio_track_.get());
   AddRtpSenderWithSsrcs({3}, local_video_track_.get());
   AddRtpSenderWithSsrcs({4}, local_video_track_.get());
-  CreateMap();
+  InitializeMap();
 
   // Local audio track <-> RTP audio senders
-  ASSERT_TRUE(map_->GetVoiceSenderInfos(*local_audio_track_));
-  EXPECT_EQ(
-      *map_->GetVoiceSenderInfos(*local_audio_track_),
-      std::vector<cricket::VoiceSenderInfo*>(
-          {&voice_media_info_->senders[0], &voice_media_info_->senders[1]}));
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVoiceSenderInfos(*local_audio_track_));
+  EXPECT_THAT(*map_.GetVoiceSenderInfos(*local_audio_track_),
+              ElementsAre(&map_.voice_media_info()->senders[0],
+                          &map_.voice_media_info()->senders[1]));
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->senders[0]),
             local_audio_track_.get());
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->senders[1]),
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->senders[1]),
             local_audio_track_.get());
 
   // Local video track <-> RTP video senders
-  ASSERT_TRUE(map_->GetVideoSenderInfos(*local_video_track_));
-  EXPECT_EQ(
-      *map_->GetVideoSenderInfos(*local_video_track_),
-      std::vector<cricket::VideoSenderInfo*>(
-          {&video_media_info_->senders[0], &video_media_info_->senders[1]}));
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVideoSenderInfos(*local_video_track_));
+  EXPECT_THAT(*map_.GetVideoSenderInfos(*local_video_track_),
+              ElementsAre(&map_.video_media_info()->senders[0],
+                          &map_.video_media_info()->senders[1]));
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->senders[0]),
             local_video_track_.get());
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->senders[1]),
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->senders[1]),
             local_video_track_.get());
 }
 
@@ -347,28 +331,26 @@
   AddRtpSenderWithSsrcs({3, 4}, local_audio_track_.get());
   AddRtpSenderWithSsrcs({5, 6}, local_video_track_.get());
   AddRtpSenderWithSsrcs({7, 8}, local_video_track_.get());
-  CreateMap();
+  InitializeMap();
 
   // Local audio track <-> RTP audio senders
-  ASSERT_TRUE(map_->GetVoiceSenderInfos(*local_audio_track_));
-  EXPECT_EQ(
-      *map_->GetVoiceSenderInfos(*local_audio_track_),
-      std::vector<cricket::VoiceSenderInfo*>(
-          {&voice_media_info_->senders[0], &voice_media_info_->senders[1]}));
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVoiceSenderInfos(*local_audio_track_));
+  EXPECT_THAT(*map_.GetVoiceSenderInfos(*local_audio_track_),
+              ElementsAre(&map_.voice_media_info()->senders[0],
+                          &map_.voice_media_info()->senders[1]));
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->senders[0]),
             local_audio_track_.get());
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->senders[1]),
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->senders[1]),
             local_audio_track_.get());
 
   // Local video track <-> RTP video senders
-  ASSERT_TRUE(map_->GetVideoSenderInfos(*local_video_track_));
-  EXPECT_EQ(
-      *map_->GetVideoSenderInfos(*local_video_track_),
-      std::vector<cricket::VideoSenderInfo*>(
-          {&video_media_info_->senders[0], &video_media_info_->senders[1]}));
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVideoSenderInfos(*local_video_track_));
+  EXPECT_THAT(*map_.GetVideoSenderInfos(*local_video_track_),
+              ElementsAre(&map_.video_media_info()->senders[0],
+                          &map_.video_media_info()->senders[1]));
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->senders[0]),
             local_video_track_.get());
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->senders[1]),
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->senders[1]),
             local_video_track_.get());
 }
 
@@ -378,34 +360,32 @@
   AddRtpReceiverWithSsrcs({1}, remote_audio_track_.get());
   AddRtpSenderWithSsrcs({2}, local_video_track_.get());
   AddRtpReceiverWithSsrcs({2}, remote_video_track_.get());
-  CreateMap();
+  InitializeMap();
 
   // Local audio track <-> RTP audio senders
-  ASSERT_TRUE(map_->GetVoiceSenderInfos(*local_audio_track_));
-  EXPECT_EQ(
-      *map_->GetVoiceSenderInfos(*local_audio_track_),
-      std::vector<cricket::VoiceSenderInfo*>({&voice_media_info_->senders[0]}));
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVoiceSenderInfos(*local_audio_track_));
+  EXPECT_THAT(*map_.GetVoiceSenderInfos(*local_audio_track_),
+              ElementsAre(&map_.voice_media_info()->senders[0]));
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->senders[0]),
             local_audio_track_.get());
 
   // Remote audio track <-> RTP audio receiver
-  EXPECT_EQ(map_->GetVoiceReceiverInfo(*remote_audio_track_),
-            &voice_media_info_->receivers[0]);
-  EXPECT_EQ(map_->GetAudioTrack(voice_media_info_->receivers[0]),
+  EXPECT_EQ(map_.GetVoiceReceiverInfo(*remote_audio_track_),
+            &map_.voice_media_info()->receivers[0]);
+  EXPECT_EQ(map_.GetAudioTrack(map_.voice_media_info()->receivers[0]),
             remote_audio_track_.get());
 
   // Local video track <-> RTP video senders
-  ASSERT_TRUE(map_->GetVideoSenderInfos(*local_video_track_));
-  EXPECT_EQ(
-      *map_->GetVideoSenderInfos(*local_video_track_),
-      std::vector<cricket::VideoSenderInfo*>({&video_media_info_->senders[0]}));
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->senders[0]),
+  ASSERT_TRUE(map_.GetVideoSenderInfos(*local_video_track_));
+  EXPECT_THAT(*map_.GetVideoSenderInfos(*local_video_track_),
+              ElementsAre(&map_.video_media_info()->senders[0]));
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->senders[0]),
             local_video_track_.get());
 
   // Remote video track <-> RTP video receiver
-  EXPECT_EQ(map_->GetVideoReceiverInfo(*remote_video_track_),
-            &video_media_info_->receivers[0]);
-  EXPECT_EQ(map_->GetVideoTrack(video_media_info_->receivers[0]),
+  EXPECT_EQ(map_.GetVideoReceiverInfo(*remote_video_track_),
+            &map_.video_media_info()->receivers[0]);
+  EXPECT_EQ(map_.GetVideoTrack(map_.video_media_info()->receivers[0]),
             remote_video_track_.get());
 }
 
@@ -414,22 +394,22 @@
   AddRtpReceiverWithSsrcs({2}, remote_audio_track_.get());
   AddRtpSenderWithSsrcs({3}, local_video_track_.get());
   AddRtpReceiverWithSsrcs({4}, remote_video_track_.get());
-  CreateMap();
-  EXPECT_TRUE(map_->GetVoiceSenderInfoBySsrc(1));
-  EXPECT_TRUE(map_->GetVoiceReceiverInfoBySsrc(2));
-  EXPECT_TRUE(map_->GetVideoSenderInfoBySsrc(3));
-  EXPECT_TRUE(map_->GetVideoReceiverInfoBySsrc(4));
-  EXPECT_FALSE(map_->GetVoiceSenderInfoBySsrc(2));
-  EXPECT_FALSE(map_->GetVoiceSenderInfoBySsrc(1024));
+  InitializeMap();
+  EXPECT_TRUE(map_.GetVoiceSenderInfoBySsrc(1));
+  EXPECT_TRUE(map_.GetVoiceReceiverInfoBySsrc(2));
+  EXPECT_TRUE(map_.GetVideoSenderInfoBySsrc(3));
+  EXPECT_TRUE(map_.GetVideoReceiverInfoBySsrc(4));
+  EXPECT_FALSE(map_.GetVoiceSenderInfoBySsrc(2));
+  EXPECT_FALSE(map_.GetVoiceSenderInfoBySsrc(1024));
 }
 
 TEST_F(TrackMediaInfoMapTest, GetAttachmentIdByTrack) {
   AddRtpSenderWithSsrcs({1}, local_audio_track_.get());
-  CreateMap();
+  InitializeMap();
   EXPECT_EQ(rtp_senders_[0]->AttachmentId(),
-            map_->GetAttachmentIdByTrack(local_audio_track_.get()));
+            map_.GetAttachmentIdByTrack(local_audio_track_.get()));
   EXPECT_EQ(absl::nullopt,
-            map_->GetAttachmentIdByTrack(local_video_track_.get()));
+            map_.GetAttachmentIdByTrack(local_video_track_.get()));
 }
 
 // Death tests.
@@ -447,7 +427,7 @@
   AddRtpReceiverWithSsrcs({2}, remote_audio_track_.get());
   AddRtpReceiverWithSsrcs({3}, remote_video_track_.get());
   AddRtpReceiverWithSsrcs({4}, remote_video_track_.get());
-  EXPECT_DEATH(CreateMap(), "");
+  EXPECT_DEATH(InitializeMap(), "");
 }
 
 TEST_F(TrackMediaInfoMapDeathTest, MultipleMultiSsrcReceiversPerTrack) {
@@ -455,7 +435,7 @@
   AddRtpReceiverWithSsrcs({3, 4}, remote_audio_track_.get());
   AddRtpReceiverWithSsrcs({5, 6}, remote_video_track_.get());
   AddRtpReceiverWithSsrcs({7, 8}, remote_video_track_.get());
-  EXPECT_DEATH(CreateMap(), "");
+  EXPECT_DEATH(InitializeMap(), "");
 }
 
 #endif  // RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
