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

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

Issue 227743004: Added a kEchoCancellation constraint to turn off the audio processing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: added missing new unittest Created 6 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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 // Test that the source crops to the requested max width and 90 // Test that the source crops to the requested max width and
91 // height even though the camera delivers a larger frame. 91 // height even though the camera delivers a larger frame.
92 void TestSourceCropFrame(int capture_width, 92 void TestSourceCropFrame(int capture_width,
93 int capture_height, 93 int capture_height,
94 const blink::WebMediaConstraints& constraints, 94 const blink::WebMediaConstraints& constraints,
95 int expected_width, 95 int expected_width,
96 int expected_height) { 96 int expected_height) {
97 // Expect the source to start capture with the supported resolution. 97 // Expect the source to start capture with the supported resolution.
98 blink::WebMediaStreamTrack track = 98 blink::WebMediaStreamTrack track =
99 CreateTrackAndStartSource(constraints, capture_width, capture_height , 99 CreateTrackAndStartSource(constraints, capture_width, capture_height,
100 30); 100 30);
101 101
102 MockMediaStreamVideoSink sink; 102 MockMediaStreamVideoSink sink;
103 MediaStreamVideoSink::AddToVideoTrack(&sink, track); 103 MediaStreamVideoSink::AddToVideoTrack(&sink, track);
104 EXPECT_EQ(0, sink.number_of_frames()); 104 EXPECT_EQ(0, sink.number_of_frames());
105 105
106 scoped_refptr<media::VideoFrame> frame = 106 scoped_refptr<media::VideoFrame> frame =
107 media::VideoFrame::CreateBlackFrame(gfx::Size(capture_width, 107 media::VideoFrame::CreateBlackFrame(gfx::Size(capture_width,
108 capture_height)); 108 capture_height));
109 mock_source()->DeliverVideoFrame(frame); 109 mock_source()->DeliverVideoFrame(frame);
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( 466 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported(
467 MediaStreamVideoSource::kMaxAspectRatio)); 467 MediaStreamVideoSource::kMaxAspectRatio));
468 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported( 468 EXPECT_TRUE(MediaStreamVideoSource::IsConstraintSupported(
469 MediaStreamVideoSource::kMinAspectRatio)); 469 MediaStreamVideoSource::kMinAspectRatio));
470 470
471 EXPECT_FALSE(MediaStreamVideoSource::IsConstraintSupported( 471 EXPECT_FALSE(MediaStreamVideoSource::IsConstraintSupported(
472 "something unsupported")); 472 "something unsupported"));
473 } 473 }
474 474
475 } // namespace content 475 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698