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 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "content/renderer/media/media_stream_extra_data.h" | 9 #include "content/renderer/media/media_stream_extra_data.h" |
10 #include "content/renderer/media/mock_media_stream_dependency_factory.h" | 10 #include "content/renderer/media/mock_media_stream_dependency_factory.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 }; | 36 }; |
37 | 37 |
38 class PeerConnectionHandlerJsepTest : public ::testing::Test { | 38 class PeerConnectionHandlerJsepTest : public ::testing::Test { |
39 public: | 39 public: |
40 PeerConnectionHandlerJsepTest() : mock_peer_connection_(NULL) { | 40 PeerConnectionHandlerJsepTest() : mock_peer_connection_(NULL) { |
41 } | 41 } |
42 | 42 |
43 void SetUp() { | 43 void SetUp() { |
44 mock_client_.reset(new WebKit::MockWebPeerConnection00HandlerClient()); | 44 mock_client_.reset(new WebKit::MockWebPeerConnection00HandlerClient()); |
45 mock_dependency_factory_.reset( | 45 mock_dependency_factory_.reset( |
46 new MockMediaStreamDependencyFactory(NULL)); | 46 new MockMediaStreamDependencyFactory()); |
47 mock_dependency_factory_->CreatePeerConnectionFactory(NULL, | 47 mock_dependency_factory_->EnsurePeerConnectionFactory(); |
48 NULL, | |
49 NULL, | |
50 NULL, | |
51 NULL); | |
52 pc_handler_.reset( | 48 pc_handler_.reset( |
53 new PeerConnectionHandlerJsepUnderTest(mock_client_.get(), | 49 new PeerConnectionHandlerJsepUnderTest(mock_client_.get(), |
54 mock_dependency_factory_.get())); | 50 mock_dependency_factory_.get())); |
55 | 51 |
56 WebKit::WebString server_config( | 52 WebKit::WebString server_config( |
57 WebKit::WebString::fromUTF8("STUN stun.l.google.com:19302")); | 53 WebKit::WebString::fromUTF8("STUN stun.l.google.com:19302")); |
58 WebKit::WebString username; | 54 WebKit::WebString username; |
59 pc_handler_->initialize(server_config, username); | 55 pc_handler_->initialize(server_config, username); |
60 | 56 |
61 mock_peer_connection_ = pc_handler_->native_peer_connection(); | 57 mock_peer_connection_ = pc_handler_->native_peer_connection(); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 talk_base::scoped_refptr<webrtc::MediaStreamInterface> stream_2( | 296 talk_base::scoped_refptr<webrtc::MediaStreamInterface> stream_2( |
301 AddRemoteMockMediaStream(stream_label_2, video_track_label_2, | 297 AddRemoteMockMediaStream(stream_label_2, video_track_label_2, |
302 audio_track_label_2)); | 298 audio_track_label_2)); |
303 | 299 |
304 pc_handler_->OnAddStream(stream_1); | 300 pc_handler_->OnAddStream(stream_1); |
305 EXPECT_EQ(stream_label_1, mock_client_->stream_label()); | 301 EXPECT_EQ(stream_label_1, mock_client_->stream_label()); |
306 | 302 |
307 pc_handler_->OnAddStream(stream_2); | 303 pc_handler_->OnAddStream(stream_2); |
308 EXPECT_EQ(stream_label_2, mock_client_->stream_label()); | 304 EXPECT_EQ(stream_label_2, mock_client_->stream_label()); |
309 } | 305 } |
OLD | NEW |