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

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

Issue 10108016: Refactored MediaStreamImpl to be a RenderViewObserver as the other delegates in RenderViewImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed messed up MockMediaStreamImpl. Created 8 years, 8 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 | Annotate | Revision Log
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 <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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698