1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
7 #include "third_party/blink/renderer/modules/peerconnection/mock_peer_connection_dependency_factory.h"
8 #include "third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_client.h"
9 #include "third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h"
10 
11 namespace blink {
12 
13 class PeerConnectionDependencyFactoryTest : public ::testing::Test {
14  public:
SetUp()15   void SetUp() override {
16     dependency_factory_.reset(new blink::MockPeerConnectionDependencyFactory());
17   }
18 
19  protected:
20   std::unique_ptr<blink::MockPeerConnectionDependencyFactory>
21       dependency_factory_;
22 };
23 
TEST_F(PeerConnectionDependencyFactoryTest,CreateRTCPeerConnectionHandler)24 TEST_F(PeerConnectionDependencyFactoryTest, CreateRTCPeerConnectionHandler) {
25   MockRTCPeerConnectionHandlerClient client_jsep;
26   std::unique_ptr<RTCPeerConnectionHandlerPlatform> pc_handler(
27       dependency_factory_->CreateRTCPeerConnectionHandler(
28           &client_jsep, blink::scheduler::GetSingleThreadTaskRunnerForTesting(),
29           /*force_encoded_audio_insertable_streams=*/false,
30           /*force_encoded_video_insertable_streams=*/false));
31   EXPECT_TRUE(pc_handler);
32 }
33 
34 }  // namespace blink
35