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

Side by Side Diff: media/capture/video/fake_video_capture_device_unittest.cc

Issue 2164473002: ImageCapture: wire PhotoCapabilities' ISO, width, height and PhotoSettings' width and height (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheng@ comments Created 4 years, 5 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/capture/video/fake_video_capture_device.h" 5 #include "media/capture/video/fake_video_capture_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 image_capture_client_)); 313 image_capture_client_));
314 314
315 EXPECT_CALL(*image_capture_client_.get(), OnCorrectGetPhotoCapabilities()) 315 EXPECT_CALL(*image_capture_client_.get(), OnCorrectGetPhotoCapabilities())
316 .Times(1); 316 .Times(1);
317 device->GetPhotoCapabilities(std::move(scoped_get_callback)); 317 device->GetPhotoCapabilities(std::move(scoped_get_callback));
318 run_loop_.reset(new base::RunLoop()); 318 run_loop_.reset(new base::RunLoop());
319 run_loop_->Run(); 319 run_loop_->Run();
320 320
321 auto* capabilities = image_capture_client_->capabilities(); 321 auto* capabilities = image_capture_client_->capabilities();
322 ASSERT_TRUE(capabilities); 322 ASSERT_TRUE(capabilities);
323 EXPECT_EQ(100u, capabilities->iso->min);
324 EXPECT_EQ(100u, capabilities->iso->max);
325 EXPECT_EQ(100u, capabilities->iso->current);
326 EXPECT_EQ(capture_params.requested_format.frame_size.height(),
327 static_cast<int>(capabilities->height->current));
328 EXPECT_EQ(240u, capabilities->height->min);
329 EXPECT_EQ(1080u, capabilities->height->max);
330 EXPECT_EQ(capture_params.requested_format.frame_size.width(),
331 static_cast<int>(capabilities->width->current));
332 EXPECT_EQ(320u, capabilities->width->min);
333 EXPECT_EQ(1920u, capabilities->width->max);
323 EXPECT_EQ(100u, capabilities->zoom->min); 334 EXPECT_EQ(100u, capabilities->zoom->min);
324 EXPECT_EQ(400u, capabilities->zoom->max); 335 EXPECT_EQ(400u, capabilities->zoom->max);
325 EXPECT_GE(capabilities->zoom->current, capabilities->zoom->min); 336 EXPECT_GE(capabilities->zoom->current, capabilities->zoom->min);
326 EXPECT_GE(capabilities->zoom->max, capabilities->zoom->current); 337 EXPECT_GE(capabilities->zoom->max, capabilities->zoom->current);
327 EXPECT_EQ(mojom::FocusMode::UNAVAILABLE, capabilities->focus_mode); 338 EXPECT_EQ(mojom::FocusMode::UNAVAILABLE, capabilities->focus_mode);
328 339
329 // Set options: zoom to the maximum value. 340 // Set options: zoom to the maximum value.
330 const unsigned int max_zoom_value = capabilities->zoom->max; 341 const unsigned int max_zoom_value = capabilities->zoom->max;
331 VideoCaptureDevice::SetPhotoOptionsCallback scoped_set_callback( 342 VideoCaptureDevice::SetPhotoOptionsCallback scoped_set_callback(
332 base::Bind(&ImageCaptureClient::OnCorrectSetPhotoOptions, 343 base::Bind(&ImageCaptureClient::OnCorrectSetPhotoOptions,
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 420 }
410 } 421 }
411 422
412 INSTANTIATE_TEST_CASE_P(, 423 INSTANTIATE_TEST_CASE_P(,
413 FakeVideoCaptureDeviceCommandLineTest, 424 FakeVideoCaptureDeviceCommandLineTest,
414 Values(CommandLineTestData{"fps=-1", 5}, 425 Values(CommandLineTestData{"fps=-1", 5},
415 CommandLineTestData{"fps=29.97", 29.97f}, 426 CommandLineTestData{"fps=29.97", 29.97f},
416 CommandLineTestData{"fps=60", 60}, 427 CommandLineTestData{"fps=60", 60},
417 CommandLineTestData{"fps=1000", 60})); 428 CommandLineTestData{"fps=1000", 60}));
418 }; // namespace media 429 }; // namespace media
OLDNEW
« no previous file with comments | « media/capture/video/fake_video_capture_device.cc ('k') | media/mojo/interfaces/image_capture.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698