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

Side by Side Diff: content/renderer/media/peer_connection_handler_jsep_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 23 matching lines...) Expand all
34 virtual ~MockVideoRendererWrapper() {} 34 virtual ~MockVideoRendererWrapper() {}
35 }; 35 };
36 36
37 } // namespace webrtc 37 } // namespace webrtc
38 38
39 TEST(PeerConnectionHandlerJsepTest, Basic) { 39 TEST(PeerConnectionHandlerJsepTest, Basic) {
40 MessageLoop loop; 40 MessageLoop loop;
41 41
42 scoped_ptr<WebKit::MockWebPeerConnection00HandlerClient> mock_client( 42 scoped_ptr<WebKit::MockWebPeerConnection00HandlerClient> mock_client(
43 new WebKit::MockWebPeerConnection00HandlerClient()); 43 new WebKit::MockWebPeerConnection00HandlerClient());
44 scoped_refptr<MockMediaStreamImpl> mock_ms_impl(new MockMediaStreamImpl()); 44 scoped_ptr<MockMediaStreamImpl> mock_ms_impl(new MockMediaStreamImpl());
45 scoped_ptr<MockMediaStreamDependencyFactory> mock_dependency_factory( 45 scoped_ptr<MockMediaStreamDependencyFactory> mock_dependency_factory(
46 new MockMediaStreamDependencyFactory()); 46 new MockMediaStreamDependencyFactory());
47 mock_dependency_factory->CreatePeerConnectionFactory(NULL, 47 mock_dependency_factory->CreatePeerConnectionFactory(NULL,
48 NULL, 48 NULL,
49 NULL, 49 NULL,
50 NULL, 50 NULL,
51 NULL); 51 NULL);
52 scoped_ptr<PeerConnectionHandlerJsep> pc_handler( 52 scoped_ptr<PeerConnectionHandlerJsep> pc_handler(
53 new PeerConnectionHandlerJsep(mock_client.get(), 53 new PeerConnectionHandlerJsep(mock_client.get(),
54 mock_ms_impl.get(), 54 mock_ms_impl.get(),
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 // Stop. 223 // Stop.
224 pc_handler->stop(); 224 pc_handler->stop();
225 EXPECT_FALSE(pc_handler->native_peer_connection_.get()); 225 EXPECT_FALSE(pc_handler->native_peer_connection_.get());
226 226
227 // PC handler is expected to be deleted when stop calls 227 // PC handler is expected to be deleted when stop calls
228 // MediaStreamImpl::ClosePeerConnection. We own and delete it here instead of 228 // MediaStreamImpl::ClosePeerConnection. We own and delete it here instead of
229 // in the mock. 229 // in the mock.
230 pc_handler.reset(); 230 pc_handler.reset();
231 } 231 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698