#include "base/run_loop.h"
#include "services/video_capture/test/mock_video_capture_device_test.h"
using testing::_;
namespace video_capture {
TEST_F(MockVideoCaptureDeviceTest, DeviceIsStoppedWhenDiscardingDeviceClient) {
{
base::RunLoop wait_loop;
EXPECT_CALL(mock_device_, DoStopAndDeAllocate()).WillOnce([&wait_loop]() {
wait_loop.Quit();
});
device_->Start(requested_settings_, std::move(mock_subscriber_));
mock_video_frame_handler_.reset();
wait_loop.Run();
}
{
base::RunLoop wait_loop;
wait_loop.RunUntilIdle();
}
}
}