| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // Weak reference to the mocked native peer connection implementation. | 327 // Weak reference to the mocked native peer connection implementation. |
| 328 MockPeerConnectionImpl* mock_peer_connection_; | 328 MockPeerConnectionImpl* mock_peer_connection_; |
| 329 }; | 329 }; |
| 330 | 330 |
| 331 TEST_F(RTCPeerConnectionHandlerTest, Destruct) { | 331 TEST_F(RTCPeerConnectionHandlerTest, Destruct) { |
| 332 EXPECT_CALL(*mock_tracker_.get(), UnregisterPeerConnection(pc_handler_.get())) | 332 EXPECT_CALL(*mock_tracker_.get(), UnregisterPeerConnection(pc_handler_.get())) |
| 333 .Times(1); | 333 .Times(1); |
| 334 pc_handler_.reset(NULL); | 334 pc_handler_.reset(NULL); |
| 335 } | 335 } |
| 336 | 336 |
| 337 TEST_F(RTCPeerConnectionHandlerTest, DestructAllHandlers) { | |
| 338 EXPECT_CALL(*mock_client_.get(), releasePeerConnectionHandler()) | |
| 339 .Times(1); | |
| 340 RTCPeerConnectionHandler::DestructAllHandlers(); | |
| 341 } | |
| 342 TEST_F(RTCPeerConnectionHandlerTest, CreateOffer) { | 337 TEST_F(RTCPeerConnectionHandlerTest, CreateOffer) { |
| 343 blink::WebRTCSessionDescriptionRequest request; | 338 blink::WebRTCSessionDescriptionRequest request; |
| 344 blink::WebMediaConstraints options; | 339 blink::WebMediaConstraints options; |
| 345 EXPECT_CALL(*mock_tracker_.get(), TrackCreateOffer(pc_handler_.get(), _)); | 340 EXPECT_CALL(*mock_tracker_.get(), TrackCreateOffer(pc_handler_.get(), _)); |
| 346 | 341 |
| 347 // TODO(perkj): Can blink::WebRTCSessionDescriptionRequest be changed so | 342 // TODO(perkj): Can blink::WebRTCSessionDescriptionRequest be changed so |
| 348 // the |reqest| requestSucceeded can be tested? Currently the |request| object | 343 // the |reqest| requestSucceeded can be tested? Currently the |request| object |
| 349 // can not be initialized from a unit test. | 344 // can not be initialized from a unit test. |
| 350 EXPECT_FALSE(mock_peer_connection_->created_session_description() != NULL); | 345 EXPECT_FALSE(mock_peer_connection_->created_session_description() != NULL); |
| 351 pc_handler_->createOffer(request, options); | 346 pc_handler_->createOffer(request, options); |
| (...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 994 EXPECT_CALL(*mock_tracker_.get(), | 989 EXPECT_CALL(*mock_tracker_.get(), |
| 995 TrackCreateDTMFSender(pc_handler_.get(), | 990 TrackCreateDTMFSender(pc_handler_.get(), |
| 996 testing::Ref(tracks[0]))); | 991 testing::Ref(tracks[0]))); |
| 997 | 992 |
| 998 scoped_ptr<blink::WebRTCDTMFSenderHandler> sender( | 993 scoped_ptr<blink::WebRTCDTMFSenderHandler> sender( |
| 999 pc_handler_->createDTMFSender(tracks[0])); | 994 pc_handler_->createDTMFSender(tracks[0])); |
| 1000 EXPECT_TRUE(sender.get()); | 995 EXPECT_TRUE(sender.get()); |
| 1001 } | 996 } |
| 1002 | 997 |
| 1003 } // namespace content | 998 } // namespace content |
| OLD | NEW |