Index: content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc |
diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc b/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc |
index 1db3b4fc14d922510e5453937be904b04461d0fc..cbc09ac4e609cf1ade412ff33a4d3033872b5253 100644 |
--- a/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc |
+++ b/content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc |
@@ -469,6 +469,31 @@ TEST_F(MediaStreamDispatcherHostTest, GenerateStreamWithAudioAndVideo) { |
EXPECT_EQ(host_->video_devices_.size(), 1u); |
} |
+TEST_F(MediaStreamDispatcherHostTest, GenerateStreamWithDepthVideo) { |
+ // Video device on index 1 is depth video capture device. |
mcasas
2017/01/11 23:18:20
Because of the '<=' in FakeVCDFactory, this commen
aleksandar.stojiljkovic
2017/01/12 14:13:59
I added more comments to this method, explaining 2
|
+ physical_video_devices_.clear(); |
+ video_capture_device_factory_->set_number_of_devices(2); |
+ video_capture_device_factory_->GetDeviceDescriptors(&physical_video_devices_); |
+ StreamControls controls(true, true); |
+ std::string source_id = content::GetHMACForMediaDeviceID( |
+ browser_context_.GetResourceContext()->GetMediaDeviceIDSalt(), origin_, |
+ physical_video_devices_[1].device_id); |
+ controls.video.device_id = source_id; |
+ |
+ SetupFakeUI(true); |
+ GenerateStreamAndWaitForResult(kRenderId, kPageRequestId, controls); |
+ |
+ EXPECT_EQ(host_->audio_devices_.size(), 1u); |
+ EXPECT_EQ(host_->video_devices_.size(), 1u); |
+ const base::Optional<CameraCalibration> calibration = |
+ host_->video_devices_[0].device.camera_calibration; |
+ EXPECT_TRUE(calibration); |
+ EXPECT_EQ(calibration->focal_length_x, 135.0); |
+ EXPECT_EQ(calibration->focal_length_y, 135.6); |
+ EXPECT_EQ(calibration->depth_near, 0.0); |
+ EXPECT_EQ(calibration->depth_far, 65.535); |
+} |
+ |
// This test generates two streams with video only using the same render frame |
// id. The same capture device with the same device and session id is expected |
// to be used. |