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

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

Issue 1729683002: Remove old-style constraints from Chrome internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CL ready to submit Created 4 years, 9 months 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
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "base/thread_task_runner_handle.h" 15 #include "base/thread_task_runner_handle.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "content/child/child_process.h" 17 #include "content/child/child_process.h"
18 #include "content/renderer/media/media_stream.h" 18 #include "content/renderer/media/media_stream.h"
19 #include "content/renderer/media/media_stream_audio_source.h" 19 #include "content/renderer/media/media_stream_audio_source.h"
20 #include "content/renderer/media/media_stream_source.h" 20 #include "content/renderer/media/media_stream_source.h"
21 #include "content/renderer/media/media_stream_video_track.h" 21 #include "content/renderer/media/media_stream_video_track.h"
22 #include "content/renderer/media/mock_data_channel_impl.h" 22 #include "content/renderer/media/mock_data_channel_impl.h"
23 #include "content/renderer/media/mock_media_stream_video_source.h" 23 #include "content/renderer/media/mock_media_stream_video_source.h"
24 #include "content/renderer/media/mock_peer_connection_impl.h" 24 #include "content/renderer/media/mock_peer_connection_impl.h"
25 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h" 25 #include "content/renderer/media/mock_web_rtc_peer_connection_handler_client.h"
26 #include "content/renderer/media/peer_connection_tracker.h" 26 #include "content/renderer/media/peer_connection_tracker.h"
27 #include "content/renderer/media/rtc_media_constraints.h"
28 #include "content/renderer/media/rtc_peer_connection_handler.h" 27 #include "content/renderer/media/rtc_peer_connection_handler.h"
29 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory. h" 28 #include "content/renderer/media/webrtc/mock_peer_connection_dependency_factory. h"
30 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h" 29 #include "content/renderer/media/webrtc/webrtc_local_audio_track_adapter.h"
31 #include "content/renderer/media/webrtc_local_audio_track.h" 30 #include "content/renderer/media/webrtc_local_audio_track.h"
32 #include "testing/gmock/include/gmock/gmock.h" 31 #include "testing/gmock/include/gmock/gmock.h"
33 #include "testing/gtest/include/gtest/gtest.h" 32 #include "testing/gtest/include/gtest/gtest.h"
34 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" 33 #include "third_party/WebKit/public/platform/WebMediaConstraints.h"
35 #include "third_party/WebKit/public/platform/WebMediaStream.h" 34 #include "third_party/WebKit/public/platform/WebMediaStream.h"
36 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h" 35 #include "third_party/WebKit/public/platform/WebMediaStreamSource.h"
37 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" 36 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 pc_handler_->observer()->OnDataChannel(remote_data_channel.get()); 366 pc_handler_->observer()->OnDataChannel(remote_data_channel.get());
368 367
369 base::RunLoop().RunUntilIdle(); 368 base::RunLoop().RunUntilIdle();
370 } 369 }
371 370
372 TEST_F(RTCPeerConnectionHandlerTest, DestructAllHandlers) { 371 TEST_F(RTCPeerConnectionHandlerTest, DestructAllHandlers) {
373 EXPECT_CALL(*mock_client_.get(), releasePeerConnectionHandler()) 372 EXPECT_CALL(*mock_client_.get(), releasePeerConnectionHandler())
374 .Times(1); 373 .Times(1);
375 RTCPeerConnectionHandler::DestructAllHandlers(); 374 RTCPeerConnectionHandler::DestructAllHandlers();
376 } 375 }
376
377 TEST_F(RTCPeerConnectionHandlerTest, CreateOffer) { 377 TEST_F(RTCPeerConnectionHandlerTest, CreateOffer) {
378 blink::WebRTCSessionDescriptionRequest request; 378 blink::WebRTCSessionDescriptionRequest request;
379 blink::WebMediaConstraints options; 379 blink::WebMediaConstraints options;
380 EXPECT_CALL(*mock_tracker_.get(), TrackCreateOffer(pc_handler_.get(), _)); 380 EXPECT_CALL(*mock_tracker_.get(), TrackCreateOffer(pc_handler_.get(), _));
381 381
382 // TODO(perkj): Can blink::WebRTCSessionDescriptionRequest be changed so 382 // TODO(perkj): Can blink::WebRTCSessionDescriptionRequest be changed so
383 // the |reqest| requestSucceeded can be tested? Currently the |request| object 383 // the |reqest| requestSucceeded can be tested? Currently the |request| object
384 // can not be initialized from a unit test. 384 // can not be initialized from a unit test.
385 EXPECT_FALSE(mock_peer_connection_->created_session_description() != NULL); 385 EXPECT_FALSE(mock_peer_connection_->created_session_description() != NULL);
386 pc_handler_->createOffer(request, options); 386 pc_handler_->createOffer(request, options);
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 EXPECT_CALL(*mock_tracker_.get(), 1028 EXPECT_CALL(*mock_tracker_.get(),
1029 TrackCreateDTMFSender(pc_handler_.get(), 1029 TrackCreateDTMFSender(pc_handler_.get(),
1030 testing::Ref(tracks[0]))); 1030 testing::Ref(tracks[0])));
1031 1031
1032 scoped_ptr<blink::WebRTCDTMFSenderHandler> sender( 1032 scoped_ptr<blink::WebRTCDTMFSenderHandler> sender(
1033 pc_handler_->createDTMFSender(tracks[0])); 1033 pc_handler_->createDTMFSender(tracks[0]));
1034 EXPECT_TRUE(sender.get()); 1034 EXPECT_TRUE(sender.get());
1035 } 1035 }
1036 1036
1037 } // namespace content 1037 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698