Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: content/renderer/media/rtc_peer_connection_handler_unittest.cc

Issue 1442063002: Revert of Fix leak of RTCPeerConnectionHandler if PeerConnection.close() is called from js. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/media/rtc_peer_connection_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_peer_connection_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698