Index: content/browser/renderer_host/media/video_capture_controller_unittest.cc |
diff --git a/content/browser/renderer_host/media/video_capture_controller_unittest.cc b/content/browser/renderer_host/media/video_capture_controller_unittest.cc |
index 47c0c29786d9234d54828c40f114fd7a21b8666b..f381b262b53a8e4068adb95eb65e806688c8e80c 100644 |
--- a/content/browser/renderer_host/media/video_capture_controller_unittest.cc |
+++ b/content/browser/renderer_host/media/video_capture_controller_unittest.cc |
@@ -100,8 +100,9 @@ class MockVideoCaptureControllerEventHandler |
class MockVideoCaptureManager |
: public media_stream::VideoCaptureManager { |
public: |
- MockVideoCaptureManager() |
- : video_session_id_(kStartOpenSessionId) {} |
+ MockVideoCaptureManager(scoped_refptr<base::MessageLoopProxy> message_loop) |
+ : media_stream::VideoCaptureManager(message_loop), |
+ video_session_id_(kStartOpenSessionId) {} |
void Init() { |
device_name_.unique_id = "/dev/video0"; |
@@ -158,7 +159,10 @@ class VideoCaptureControllerTest : public testing::Test { |
io_thread_.reset(new BrowserThreadImpl(BrowserThread::IO, |
message_loop_.get())); |
- vcm_ = new MockVideoCaptureManager(); |
+ device_thread_.reset(new base::Thread("VideoCaptureControllerTestThread")); |
+ CHECK(device_thread_->Start()); |
+ |
+ vcm_ = new MockVideoCaptureManager(device_thread_->message_loop_proxy()); |
vcm_->Init(); |
controller_ = new VideoCaptureController(vcm_); |
controller_handler_.reset( |
@@ -167,11 +171,13 @@ class VideoCaptureControllerTest : public testing::Test { |
} |
virtual void TearDown() { |
+ device_thread_->Stop(); |
} |
scoped_ptr<MessageLoop> message_loop_; |
scoped_ptr<BrowserThreadImpl> file_thread_; |
scoped_ptr<BrowserThreadImpl> io_thread_; |
+ scoped_ptr<base::Thread> device_thread_; |
scoped_refptr<MockVideoCaptureManager> vcm_; |
scoped_ptr<MockVideoCaptureControllerEventHandler> controller_handler_; |
scoped_refptr<VideoCaptureController> controller_; |