OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/message_loop.h" | 5 #include "base/message_loop.h" |
6 #include "content/renderer/media/video_capture_impl.h" | 6 #include "content/renderer/media/video_capture_impl.h" |
7 #include "testing/gmock/include/gmock/gmock.h" | 7 #include "testing/gmock/include/gmock/gmock.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 using ::testing::_; | 10 using ::testing::_; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 : VideoCaptureImpl(id, ml_proxy, filter) { | 60 : VideoCaptureImpl(id, ml_proxy, filter) { |
61 } | 61 } |
62 virtual ~MockVideoCaptureImpl() {} | 62 virtual ~MockVideoCaptureImpl() {} |
63 | 63 |
64 MOCK_METHOD1(Send, void(IPC::Message* message)); | 64 MOCK_METHOD1(Send, void(IPC::Message* message)); |
65 }; | 65 }; |
66 | 66 |
67 VideoCaptureImplTest() { | 67 VideoCaptureImplTest() { |
68 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_IO)); | 68 message_loop_.reset(new MessageLoop(MessageLoop::TYPE_IO)); |
69 message_loop_proxy_ = | 69 message_loop_proxy_ = |
70 base::MessageLoopProxy::CreateForCurrentThread().get(); | 70 base::MessageLoopProxy::current().get(); |
71 | 71 |
72 message_filter_ = new MockVideoCaptureMessageFilter; | 72 message_filter_ = new MockVideoCaptureMessageFilter; |
73 session_id_ = 1; | 73 session_id_ = 1; |
74 | 74 |
75 video_capture_impl_ = new MockVideoCaptureImpl(session_id_, | 75 video_capture_impl_ = new MockVideoCaptureImpl(session_id_, |
76 message_loop_proxy_, | 76 message_loop_proxy_, |
77 message_filter_); | 77 message_filter_); |
78 | 78 |
79 video_capture_impl_->device_id_ = 2; | 79 video_capture_impl_->device_id_ = 2; |
80 } | 80 } |
(...skipping 27 matching lines...) Expand all Loading... |
108 | 108 |
109 video_capture_impl_->StartCapture(client.get(), capability); | 109 video_capture_impl_->StartCapture(client.get(), capability); |
110 message_loop_->RunAllPending(); | 110 message_loop_->RunAllPending(); |
111 | 111 |
112 EXPECT_CALL(*client, OnStopped(_)) | 112 EXPECT_CALL(*client, OnStopped(_)) |
113 .WillOnce(Return()); | 113 .WillOnce(Return()); |
114 | 114 |
115 video_capture_impl_->StopCapture(client.get()); | 115 video_capture_impl_->StopCapture(client.get()); |
116 message_loop_->RunAllPending(); | 116 message_loop_->RunAllPending(); |
117 } | 117 } |
OLD | NEW |