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/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "content/renderer/media/mock_media_stream_dependency_factory.h" | 10 #include "content/renderer/media/mock_media_stream_dependency_factory.h" |
11 #include "content/renderer/media/mock_media_stream_impl.h" | 11 #include "content/renderer/media/mock_media_stream_impl.h" |
12 #include "content/renderer/media/mock_web_peer_connection_handler_client.h" | 12 #include "content/renderer/media/mock_web_peer_connection_handler_client.h" |
13 #include "content/renderer/media/mock_peer_connection_impl.h" | 13 #include "content/renderer/media/mock_peer_connection_impl.h" |
14 #include "content/renderer/media/peer_connection_handler.h" | 14 #include "content/renderer/media/peer_connection_handler.h" |
15 #include "content/renderer/media/rtc_video_decoder.h" | 15 #include "content/renderer/media/rtc_video_decoder.h" |
16 #include "jingle/glue/thread_wrapper.h" | 16 #include "jingle/glue/thread_wrapper.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "third_party/libjingle/source/talk/app/webrtc/peerconnection.h" | 18 #include "third_party/libjingle/source/talk/app/webrtcv1/peerconnection.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amDescriptor.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amDescriptor.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amSource.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebMediaStre
amSource.h" |
21 | 21 |
22 TEST(PeerConnectionHandlerTest, Basic) { | 22 TEST(PeerConnectionHandlerTest, Basic) { |
23 MessageLoop loop; | 23 MessageLoop loop; |
24 | 24 |
25 scoped_ptr<WebKit::MockWebPeerConnectionHandlerClient> mock_client( | 25 scoped_ptr<WebKit::MockWebPeerConnectionHandlerClient> mock_client( |
26 new WebKit::MockWebPeerConnectionHandlerClient()); | 26 new WebKit::MockWebPeerConnectionHandlerClient()); |
27 scoped_refptr<MockMediaStreamImpl> mock_ms_impl(new MockMediaStreamImpl()); | 27 scoped_refptr<MockMediaStreamImpl> mock_ms_impl(new MockMediaStreamImpl()); |
28 scoped_ptr<MockMediaStreamDependencyFactory> mock_dependency_factory( | 28 scoped_ptr<MockMediaStreamDependencyFactory> mock_dependency_factory( |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 pc_handler->processPendingStreams(pendingAddStreams, pendingRemoveStreams); | 115 pc_handler->processPendingStreams(pendingAddStreams, pendingRemoveStreams); |
116 EXPECT_EQ(label, mock_ms_impl->video_label()); | 116 EXPECT_EQ(label, mock_ms_impl->video_label()); |
117 EXPECT_EQ(label, mock_peer_connection->stream_id()); | 117 EXPECT_EQ(label, mock_peer_connection->stream_id()); |
118 EXPECT_TRUE(mock_peer_connection->video_stream()); | 118 EXPECT_TRUE(mock_peer_connection->video_stream()); |
119 EXPECT_TRUE(mock_peer_connection->connected()); | 119 EXPECT_TRUE(mock_peer_connection->connected()); |
120 EXPECT_TRUE(mock_peer_connection->video_capture_set()); | 120 EXPECT_TRUE(mock_peer_connection->video_capture_set()); |
121 | 121 |
122 pc_handler->stop(); | 122 pc_handler->stop(); |
123 pc_handler.reset(); | 123 pc_handler.reset(); |
124 } | 124 } |
OLD | NEW |