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" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 { | 51 { |
52 WebKit::WebMediaStreamDescriptor copy_2(copy_1); | 52 WebKit::WebMediaStreamDescriptor copy_2(copy_1); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 TEST(PeerConnectionHandlerTest, Basic) { | 56 TEST(PeerConnectionHandlerTest, Basic) { |
57 MessageLoop loop; | 57 MessageLoop loop; |
58 | 58 |
59 scoped_ptr<WebKit::MockWebPeerConnectionHandlerClient> mock_client( | 59 scoped_ptr<WebKit::MockWebPeerConnectionHandlerClient> mock_client( |
60 new WebKit::MockWebPeerConnectionHandlerClient()); | 60 new WebKit::MockWebPeerConnectionHandlerClient()); |
61 scoped_refptr<MockMediaStreamImpl> mock_ms_impl(new MockMediaStreamImpl()); | 61 scoped_ptr<MockMediaStreamImpl> mock_ms_impl(new MockMediaStreamImpl()); |
62 scoped_ptr<MockMediaStreamDependencyFactory> mock_dependency_factory( | 62 scoped_ptr<MockMediaStreamDependencyFactory> mock_dependency_factory( |
63 new MockMediaStreamDependencyFactory()); | 63 new MockMediaStreamDependencyFactory()); |
64 mock_dependency_factory->CreatePeerConnectionFactory(NULL, | 64 mock_dependency_factory->CreatePeerConnectionFactory(NULL, |
65 NULL, | 65 NULL, |
66 NULL, | 66 NULL, |
67 NULL, | 67 NULL, |
68 NULL); | 68 NULL); |
69 scoped_ptr<PeerConnectionHandler> pc_handler( | 69 scoped_ptr<PeerConnectionHandler> pc_handler( |
70 new PeerConnectionHandler(mock_client.get(), | 70 new PeerConnectionHandler(mock_client.get(), |
71 mock_ms_impl.get(), | 71 mock_ms_impl.get(), |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 EXPECT_EQ(stream_label, mock_peer_connection->stream_label()); | 147 EXPECT_EQ(stream_label, mock_peer_connection->stream_label()); |
148 EXPECT_TRUE(mock_peer_connection->stream_changes_committed()); | 148 EXPECT_TRUE(mock_peer_connection->stream_changes_committed()); |
149 | 149 |
150 pc_handler->stop(); | 150 pc_handler->stop(); |
151 EXPECT_FALSE(pc_handler->native_peer_connection_.get()); | 151 EXPECT_FALSE(pc_handler->native_peer_connection_.get()); |
152 // PC handler is expected to be deleted when stop calls | 152 // PC handler is expected to be deleted when stop calls |
153 // MediaStreamImpl::ClosePeerConnection. We own and delete it here instead of | 153 // MediaStreamImpl::ClosePeerConnection. We own and delete it here instead of |
154 // in the mock. | 154 // in the mock. |
155 pc_handler.reset(); | 155 pc_handler.reset(); |
156 } | 156 } |
OLD | NEW |