| 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/media_stream_extra_data.h" | 10 #include "content/renderer/media/media_stream_extra_data.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 void SetUp() { | 41 void SetUp() { |
| 42 mock_client_.reset(new WebKit::MockWebPeerConnectionHandlerClient()); | 42 mock_client_.reset(new WebKit::MockWebPeerConnectionHandlerClient()); |
| 43 mock_dependency_factory_.reset( | 43 mock_dependency_factory_.reset( |
| 44 new MockMediaStreamDependencyFactory(NULL)); | 44 new MockMediaStreamDependencyFactory(NULL)); |
| 45 mock_dependency_factory_->CreatePeerConnectionFactory(NULL, | 45 mock_dependency_factory_->CreatePeerConnectionFactory(NULL, |
| 46 NULL, | 46 NULL, |
| 47 NULL, | 47 NULL, |
| 48 NULL, | 48 NULL, |
| 49 NULL, |
| 49 NULL); | 50 NULL); |
| 50 pc_handler_.reset( | 51 pc_handler_.reset( |
| 51 new PeerConnectionHandlerUnderTest(mock_client_.get(), | 52 new PeerConnectionHandlerUnderTest(mock_client_.get(), |
| 52 mock_dependency_factory_.get())); | 53 mock_dependency_factory_.get())); |
| 53 | 54 |
| 54 WebKit::WebString server_config( | 55 WebKit::WebString server_config( |
| 55 WebKit::WebString::fromUTF8("STUN stun.l.google.com:19302")); | 56 WebKit::WebString::fromUTF8("STUN stun.l.google.com:19302")); |
| 56 WebKit::WebString username; | 57 WebKit::WebString username; |
| 57 pc_handler_->initialize(server_config, username); | 58 pc_handler_->initialize(server_config, username); |
| 58 | 59 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 EXPECT_EQ(stream_label, mock_peer_connection_->stream_label()); | 193 EXPECT_EQ(stream_label, mock_peer_connection_->stream_label()); |
| 193 EXPECT_TRUE(mock_peer_connection_->stream_changes_committed()); | 194 EXPECT_TRUE(mock_peer_connection_->stream_changes_committed()); |
| 194 | 195 |
| 195 pc_handler_->stop(); | 196 pc_handler_->stop(); |
| 196 EXPECT_FALSE(pc_handler_->native_peer_connection()); | 197 EXPECT_FALSE(pc_handler_->native_peer_connection()); |
| 197 // PC handler is expected to be deleted when stop calls | 198 // PC handler is expected to be deleted when stop calls |
| 198 // MediaStreamImpl::ClosePeerConnection. We own and delete it here instead of | 199 // MediaStreamImpl::ClosePeerConnection. We own and delete it here instead of |
| 199 // in the mock. | 200 // in the mock. |
| 200 pc_handler_.reset(); | 201 pc_handler_.reset(); |
| 201 } | 202 } |
| OLD | NEW |