Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include <string> | |
| 6 | |
| 7 #include "base/memory/scoped_ptr.h" | |
| 8 #include "base/message_loop.h" | |
| 9 #include "base/utf_string_conversions.h" | |
| 10 #include "content/renderer/media/media_stream_impl.h" | |
| 11 #include "content/renderer/media/mock_media_stream_dependency_factory.h" | |
| 12 #include "content/renderer/media/mock_media_stream_dispatcher.h" | |
| 13 #include "content/renderer/media/mock_web_peer_connection_handler_client.h" | |
| 14 #include "content/renderer/media/video_capture_impl_manager.h" | |
| 15 #include "content/renderer/p2p/socket_dispatcher.h" | |
| 16 #include "testing/gtest/include/gtest/gtest.h" | |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPeerConnectionHand ler.h" | |
| 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | |
| 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | |
|
scherkus (not reviewing)
2011/11/09 02:29:10
WebSecurityOrigin comes before WebString
Henrik Grunell
2011/11/09 20:36:04
Done.
| |
| 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | |
| 21 | |
| 22 TEST(MediaStreamImplTest, Basic) { | |
| 23 MessageLoop loop; | |
| 24 | |
| 25 // Create our test object. | |
| 26 scoped_ptr<MockMediaStreamDispatcher> ms_dispatcher( | |
| 27 new MockMediaStreamDispatcher()); | |
| 28 scoped_ptr<content::P2PSocketDispatcher> p2p_socket_dispatcher( | |
| 29 new content::P2PSocketDispatcher(NULL)); | |
| 30 scoped_refptr<VideoCaptureImplManager> vc_manager( | |
| 31 new VideoCaptureImplManager()); | |
| 32 MockMediaStreamDependencyFactory* dependency_factory = | |
| 33 new MockMediaStreamDependencyFactory(); | |
| 34 scoped_refptr<MediaStreamImpl> ms_impl(new MediaStreamImpl( | |
| 35 ms_dispatcher.get(), | |
| 36 p2p_socket_dispatcher.get(), | |
| 37 vc_manager.get(), | |
| 38 dependency_factory)); | |
| 39 | |
| 40 // TODO(grunell): Add tests when the interfaces in WebKit has landed. | |
|
scherkus (not reviewing)
2011/11/09 02:29:10
haven't the interfaces landed?
Henrik Grunell
2011/11/09 20:36:04
No, not all. I believe I gave the links before to
| |
| 41 | |
| 42 WebKit::MockWebPeerConnectionHandlerClient client; | |
| 43 ms_impl->CreatePeerConnectionHandler(&client); | |
| 44 EXPECT_TRUE(ms_impl->peer_connection_handler_.get()); | |
| 45 | |
| 46 ms_impl->ClosePeerConnection(); | |
| 47 EXPECT_FALSE(ms_impl->peer_connection_handler_.get()); | |
| 48 } | |
| OLD | NEW |