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

Side by Side Diff: content/renderer/media/media_stream_video_capturer_source_unittest.cc

Issue 2787773002: Add GetPreferredFormats method to media::VideoCapturerSource. (Closed)
Patch Set: rebase Created 3 years, 8 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 "content/renderer/media/media_stream_video_capturer_source.h" 5 #include "content/renderer/media/media_stream_video_capturer_source.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 24 matching lines...) Expand all
35 .WillByDefault(WithArgs<3>( 35 .WillByDefault(WithArgs<3>(
36 Invoke(this, &MockVideoCapturerSource::EnumerateDeviceFormats))); 36 Invoke(this, &MockVideoCapturerSource::EnumerateDeviceFormats)));
37 } 37 }
38 38
39 MOCK_METHOD0(RequestRefreshFrame, void()); 39 MOCK_METHOD0(RequestRefreshFrame, void());
40 MOCK_METHOD4(GetCurrentSupportedFormats, 40 MOCK_METHOD4(GetCurrentSupportedFormats,
41 void(int max_requested_width, 41 void(int max_requested_width,
42 int max_requested_height, 42 int max_requested_height,
43 double max_requested_frame_rate, 43 double max_requested_frame_rate,
44 const VideoCaptureDeviceFormatsCB& callback)); 44 const VideoCaptureDeviceFormatsCB& callback));
45 MOCK_METHOD0(GetPreferredFormats, media::VideoCaptureFormats());
45 MOCK_METHOD3(StartCapture, 46 MOCK_METHOD3(StartCapture,
46 void(const media::VideoCaptureParams& params, 47 void(const media::VideoCaptureParams& params,
47 const VideoCaptureDeliverFrameCB& new_frame_callback, 48 const VideoCaptureDeliverFrameCB& new_frame_callback,
48 const RunningCallback& running_callback)); 49 const RunningCallback& running_callback));
49 MOCK_METHOD0(StopCapture, void()); 50 MOCK_METHOD0(StopCapture, void());
50 51
51 void EnumerateDeviceFormats(const VideoCaptureDeviceFormatsCB& callback) { 52 void EnumerateDeviceFormats(const VideoCaptureDeviceFormatsCB& callback) {
52 media::VideoCaptureFormat kFormatSmall(gfx::Size(640, 480), 30.0, 53 media::VideoCaptureFormat kFormatSmall(gfx::Size(640, 480), 30.0,
53 media::PIXEL_FORMAT_I420); 54 media::PIXEL_FORMAT_I420);
54 media::VideoCaptureFormat kFormatLarge(gfx::Size(1920, 1080), 30.0, 55 media::VideoCaptureFormat kFormatLarge(gfx::Size(1920, 1080), 30.0,
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 run_loop.Run(); 397 run_loop.Run();
397 fake_sink.DisconnectFromTrack(); 398 fake_sink.DisconnectFromTrack();
398 EXPECT_EQ(reference_capture_time, capture_time); 399 EXPECT_EQ(reference_capture_time, capture_time);
399 double metadata_value; 400 double metadata_value;
400 EXPECT_TRUE(metadata.GetDouble(media::VideoFrameMetadata::FRAME_RATE, 401 EXPECT_TRUE(metadata.GetDouble(media::VideoFrameMetadata::FRAME_RATE,
401 &metadata_value)); 402 &metadata_value));
402 EXPECT_EQ(30.0, metadata_value); 403 EXPECT_EQ(30.0, metadata_value);
403 } 404 }
404 405
405 } // namespace content 406 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698