Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1117)

Unified Diff: content/browser/renderer_host/media/media_stream_dispatcher_host_unittest.cc

Issue 2606983002: Media Capture Depth Stream Extensions API: focal length and depth range. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 4ed80f946402f91723bf1340c55b1d146ec6d63f..3da5d86ae0422c937a9e2fbe2b2ca2b831baa096 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
@@ -476,6 +476,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.
+ 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 MediaStreamDevice::CameraCalibration& calibration =
+ host_->video_devices_[0].device.camera_calibration;
+ EXPECT_TRUE(calibration.valid);
+ 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.

Powered by Google App Engine
This is Rietveld 408576698