Add TimeController to the CreatePeerConnectionE2EQualityTestFixture API

Add TimeController to the CreatePeerConnectionE2EQualityTestFixture
method as a first step to make PC level framework compatible with
TimeController abstraction.

Bug: webrtc:11743
Change-Id: I69305abc880059bf9fe1d4f2e3b7c10cf35417db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178485
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31607}
diff --git a/api/BUILD.gn b/api/BUILD.gn
index b48dad3..560cabc 100644
--- a/api/BUILD.gn
+++ b/api/BUILD.gn
@@ -465,6 +465,7 @@
     deps = [
       ":audio_quality_analyzer_api",
       ":peer_connection_quality_test_fixture_api",
+      ":time_controller",
       ":video_quality_analyzer_api",
       "../test/pc/e2e:peerconnection_quality_test",
     ]
diff --git a/api/test/create_peerconnection_quality_test_fixture.cc b/api/test/create_peerconnection_quality_test_fixture.cc
index 1e027bf..4bf127d 100644
--- a/api/test/create_peerconnection_quality_test_fixture.cc
+++ b/api/test/create_peerconnection_quality_test_fixture.cc
@@ -13,6 +13,7 @@
 #include <memory>
 #include <utility>
 
+#include "api/test/time_controller.h"
 #include "test/pc/e2e/peer_connection_quality_test.h"
 
 namespace webrtc {
@@ -28,5 +29,16 @@
       std::move(video_quality_analyzer));
 }
 
+std::unique_ptr<PeerConnectionE2EQualityTestFixture>
+CreatePeerConnectionE2EQualityTestFixture(
+    std::string test_case_name,
+    TimeController& /*time_controller*/,
+    std::unique_ptr<AudioQualityAnalyzerInterface> audio_quality_analyzer,
+    std::unique_ptr<VideoQualityAnalyzerInterface> video_quality_analyzer) {
+  return std::make_unique<PeerConnectionE2EQualityTest>(
+      std::move(test_case_name), std::move(audio_quality_analyzer),
+      std::move(video_quality_analyzer));
+}
+
 }  // namespace webrtc_pc_e2e
 }  // namespace webrtc
diff --git a/api/test/create_peerconnection_quality_test_fixture.h b/api/test/create_peerconnection_quality_test_fixture.h
index 9d9d0ef..dc0e42d 100644
--- a/api/test/create_peerconnection_quality_test_fixture.h
+++ b/api/test/create_peerconnection_quality_test_fixture.h
@@ -15,12 +15,14 @@
 
 #include "api/test/audio_quality_analyzer_interface.h"
 #include "api/test/peerconnection_quality_test_fixture.h"
+#include "api/test/time_controller.h"
 #include "api/test/video_quality_analyzer_interface.h"
 
 namespace webrtc {
 namespace webrtc_pc_e2e {
 
 // API is in development. Can be changed/removed without notice.
+
 // Create test fixture to establish test call between Alice and Bob.
 // During the test Alice will be caller and Bob will answer the call.
 // |test_case_name| is a name of test case, that will be used for all metrics
@@ -32,6 +34,20 @@
     std::unique_ptr<AudioQualityAnalyzerInterface> audio_quality_analyzer,
     std::unique_ptr<VideoQualityAnalyzerInterface> video_quality_analyzer);
 
+// Create test fixture to establish test call between Alice and Bob.
+// During the test Alice will be caller and Bob will answer the call.
+// |test_case_name| is a name of test case, that will be used for all metrics
+// reporting.
+// |time_controller| is used to manage all rtc::Thread's and TaskQueue
+// instances. Instance of |time_controller| have to outlive created fixture.
+// Returns a non-null PeerConnectionE2EQualityTestFixture instance.
+std::unique_ptr<PeerConnectionE2EQualityTestFixture>
+CreatePeerConnectionE2EQualityTestFixture(
+    std::string test_case_name,
+    TimeController& time_controller,
+    std::unique_ptr<AudioQualityAnalyzerInterface> audio_quality_analyzer,
+    std::unique_ptr<VideoQualityAnalyzerInterface> video_quality_analyzer);
+
 }  // namespace webrtc_pc_e2e
 }  // namespace webrtc