| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/peer_connection_tracker.h" | 5 #include "content/renderer/media/peer_connection_tracker.h" |
| 6 | 6 |
| 7 #include "content/common/media/peer_connection_tracker_messages.h" | 7 #include "content/common/media/peer_connection_tracker_messages.h" |
| 8 #include "content/public/test/mock_render_thread.h" | 8 #include "content/public/test/mock_render_thread.h" |
| 9 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h" | 9 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h" |
| 10 #include "content/renderer/media/rtc_peer_connection_handler.h" | 10 #include "content/renderer/media/rtc_peer_connection_handler.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 TEST(PeerConnectionTrackerTest, OnSuspend) { | 81 TEST(PeerConnectionTrackerTest, OnSuspend) { |
| 82 PeerConnectionTracker tracker; | 82 PeerConnectionTracker tracker; |
| 83 // Initialization stuff. | 83 // Initialization stuff. |
| 84 MockPeerConnectionHandler pc_handler; | 84 MockPeerConnectionHandler pc_handler; |
| 85 MockSendTargetThread target_thread; | 85 MockSendTargetThread target_thread; |
| 86 webrtc::PeerConnectionInterface::RTCConfiguration config; | 86 webrtc::PeerConnectionInterface::RTCConfiguration config; |
| 87 blink::WebMediaConstraints constraints; | 87 blink::WebMediaConstraints constraints; |
| 88 tracker.OverrideSendTargetForTesting(&target_thread); | 88 tracker.OverrideSendTargetForTesting(&target_thread); |
| 89 EXPECT_CALL(target_thread, OnAddPeerConnection(_)); | 89 EXPECT_CALL(target_thread, OnAddPeerConnection(_)); |
| 90 tracker.RegisterPeerConnection(&pc_handler, config, constraints, nullptr); | 90 tracker.RegisterPeerConnection(&pc_handler, config, constraints, nullptr); |
| 91 // Back to the test. | |
| 92 #if defined(OS_ANDROID) | |
| 93 EXPECT_CALL(pc_handler, CloseClientPeerConnection()).Times(0); | |
| 94 #else | |
| 95 EXPECT_CALL(pc_handler, CloseClientPeerConnection()); | 91 EXPECT_CALL(pc_handler, CloseClientPeerConnection()); |
| 96 #endif | |
| 97 std::unique_ptr<IPC::Message> message(new PeerConnectionTracker_OnSuspend()); | 92 std::unique_ptr<IPC::Message> message(new PeerConnectionTracker_OnSuspend()); |
| 98 tracker.OnControlMessageReceived(*message.get()); | 93 tracker.OnControlMessageReceived(*message.get()); |
| 99 } | 94 } |
| 100 | 95 |
| 101 // TODO(hta): Write tests for the other tracking functions. | 96 // TODO(hta): Write tests for the other tracking functions. |
| 102 | 97 |
| 103 } // namespace | 98 } // namespace |
| OLD | NEW |