| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "content/renderer/media/media_stream_impl.h" | 8 #include "content/renderer/media/media_stream_impl.h" |
| 9 #include "content/renderer/media/mock_media_stream_dependency_factory.h" | 9 #include "content/renderer/media/mock_media_stream_dependency_factory.h" |
| 10 #include "content/renderer/media/mock_media_stream_dispatcher.h" | 10 #include "content/renderer/media/mock_media_stream_dispatcher.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebPeerConne
ctionHandler.h" |
| 22 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
| 23 | 23 |
| 24 class MediaStreamImplUnderTest : public MediaStreamImpl { | 24 class MediaStreamImplUnderTest : public MediaStreamImpl { |
| 25 public: | 25 public: |
| 26 MediaStreamImplUnderTest(MediaStreamDispatcher* media_stream_dispatcher, | 26 MediaStreamImplUnderTest(MediaStreamDispatcher* media_stream_dispatcher, |
| 27 content::P2PSocketDispatcher* p2p_socket_dispatcher, | 27 content::P2PSocketDispatcher* p2p_socket_dispatcher, |
| 28 VideoCaptureImplManager* vc_manager, | 28 VideoCaptureImplManager* vc_manager, |
| 29 MediaStreamDependencyFactory* dependency_factory) | 29 MediaStreamDependencyFactory* dependency_factory) |
| 30 : MediaStreamImpl(NULL, media_stream_dispatcher, p2p_socket_dispatcher, | 30 : MediaStreamImpl(NULL, media_stream_dispatcher, p2p_socket_dispatcher, |
| 31 vc_manager, dependency_factory) { | 31 vc_manager, dependency_factory, NULL) { |
| 32 } | 32 } |
| 33 | 33 |
| 34 virtual void CompleteGetUserMediaRequest( | 34 virtual void CompleteGetUserMediaRequest( |
| 35 const WebKit::WebMediaStreamDescriptor& stream, | 35 const WebKit::WebMediaStreamDescriptor& stream, |
| 36 WebKit::WebUserMediaRequest* request) { | 36 WebKit::WebUserMediaRequest* request) { |
| 37 last_generated_stream_ = stream; | 37 last_generated_stream_ = stream; |
| 38 } | 38 } |
| 39 | 39 |
| 40 virtual WebKit::WebMediaStreamDescriptor GetMediaStream(const GURL& url) { | 40 virtual WebKit::WebMediaStreamDescriptor GetMediaStream(const GURL& url) { |
| 41 return last_generated_stream_; | 41 return last_generated_stream_; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 ms_impl_->StopLocalMediaStream(mixed_desc); | 156 ms_impl_->StopLocalMediaStream(mixed_desc); |
| 157 EXPECT_EQ(1, ms_dispatcher_->stop_stream_counter()); | 157 EXPECT_EQ(1, ms_dispatcher_->stop_stream_counter()); |
| 158 ms_impl_->StopLocalMediaStream(audio_desc); | 158 ms_impl_->StopLocalMediaStream(audio_desc); |
| 159 EXPECT_EQ(2, ms_dispatcher_->stop_stream_counter()); | 159 EXPECT_EQ(2, ms_dispatcher_->stop_stream_counter()); |
| 160 | 160 |
| 161 // Test that the MediaStreams are deleted if the owning WebFrame is deleted. | 161 // Test that the MediaStreams are deleted if the owning WebFrame is deleted. |
| 162 // In the unit test the owning frame is NULL. | 162 // In the unit test the owning frame is NULL. |
| 163 ms_impl_->FrameWillClose(NULL); | 163 ms_impl_->FrameWillClose(NULL); |
| 164 EXPECT_EQ(3, ms_dispatcher_->stop_stream_counter()); | 164 EXPECT_EQ(3, ms_dispatcher_->stop_stream_counter()); |
| 165 } | 165 } |
| OLD | NEW |