diff options
author | hbos <hbos@webrtc.org> | 2015-12-01 02:13:33 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-01 10:13:40 +0000 |
commit | 0de97f1b748d8238fe3a7ad8d7afb2b6cb456a3e (patch) | |
tree | bca7047a7231830baba5f7a282dc8f2e38076433 /talk/media/webrtc | |
parent | ec192bdb64d689415c34b74e10fc7859404abbf4 (diff) | |
download | webrtc-0de97f1b748d8238fe3a7ad8d7afb2b6cb456a3e.tar.gz |
WebRtcVideoCapturer: SetCaptureState(CS_STOPPED) on Stop and ensure state changes in unittest.
Related to issues discussed in the referenced bug but does not solve that bug's main problem.
BUG=webrtc:4776
Review URL: https://codereview.webrtc.org/1485673003
Cr-Commit-Position: refs/heads/master@{#10852}
Diffstat (limited to 'talk/media/webrtc')
-rw-r--r-- | talk/media/webrtc/webrtcvideocapturer.cc | 1 | ||||
-rw-r--r-- | talk/media/webrtc/webrtcvideocapturer_unittest.cc | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/talk/media/webrtc/webrtcvideocapturer.cc b/talk/media/webrtc/webrtcvideocapturer.cc index 1454999fbd..ee4db5b1d2 100644 --- a/talk/media/webrtc/webrtcvideocapturer.cc +++ b/talk/media/webrtc/webrtcvideocapturer.cc @@ -350,6 +350,7 @@ void WebRtcVideoCapturer::Stop() { SetCaptureFormat(NULL); start_thread_ = nullptr; + SetCaptureState(CS_STOPPED); } bool WebRtcVideoCapturer::IsRunning() { diff --git a/talk/media/webrtc/webrtcvideocapturer_unittest.cc b/talk/media/webrtc/webrtcvideocapturer_unittest.cc index d560fc554e..85db32e7d2 100644 --- a/talk/media/webrtc/webrtcvideocapturer_unittest.cc +++ b/talk/media/webrtc/webrtcvideocapturer_unittest.cc @@ -111,6 +111,7 @@ TEST_F(WebRtcVideoCapturerTest, TestCapture) { capturer_->Stop(); EXPECT_FALSE(capturer_->IsRunning()); EXPECT_TRUE(capturer_->GetCaptureFormat() == NULL); + EXPECT_EQ_WAIT(cricket::CS_STOPPED, listener_.last_capture_state(), 1000); } TEST_F(WebRtcVideoCapturerTest, TestCaptureVcm) { |