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}
This commit is contained in:
hbos 2015-12-01 02:13:33 -08:00 committed by Commit bot
parent ec192bdb64
commit 0de97f1b74
2 changed files with 2 additions and 0 deletions

View File

@ -350,6 +350,7 @@ void WebRtcVideoCapturer::Stop() {
SetCaptureFormat(NULL);
start_thread_ = nullptr;
SetCaptureState(CS_STOPPED);
}
bool WebRtcVideoCapturer::IsRunning() {

View File

@ -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) {