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

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

Issue 2231863004: Add "exact" constraint evaluation to video picker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Guido's comments Created 4 years, 4 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 6
7 #include "content/renderer/media/media_stream_audio_processor_options.h" 7 #include "content/renderer/media/media_stream_audio_processor_options.h"
8 #include "content/renderer/media/media_stream_constraints_util.h" 8 #include "content/renderer/media/media_stream_constraints_util.h"
9 #include "content/renderer/media/media_stream_video_source.h" 9 #include "content/renderer/media/media_stream_video_source.h"
10 #include "content/renderer/media/mock_constraint_factory.h" 10 #include "content/renderer/media/mock_constraint_factory.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 const int test_value = 327; 82 const int test_value = 327;
83 83
84 constraint_factory.basic().width.setExact(test_value); 84 constraint_factory.basic().width.setExact(test_value);
85 blink::WebMediaConstraints constraints = 85 blink::WebMediaConstraints constraints =
86 constraint_factory.CreateWebMediaConstraints(); 86 constraint_factory.CreateWebMediaConstraints();
87 87
88 int value; 88 int value;
89 EXPECT_TRUE(GetConstraintValueAsInteger( 89 EXPECT_TRUE(GetConstraintValueAsInteger(
90 constraints, &blink::WebMediaTrackConstraintSet::width, &value)); 90 constraints, &blink::WebMediaTrackConstraintSet::width, &value));
91 EXPECT_EQ(test_value, value); 91 EXPECT_EQ(test_value, value);
92
93 // An exact value should also be reflected as min and max.
94 EXPECT_TRUE(GetConstraintMaxAsInteger(
95 constraints, &blink::WebMediaTrackConstraintSet::width, &value));
96 EXPECT_EQ(test_value, value);
97 EXPECT_TRUE(GetConstraintMinAsInteger(
98 constraints, &blink::WebMediaTrackConstraintSet::width, &value));
99 EXPECT_EQ(test_value, value);
92 } 100 }
93 101
94 } // namespace content 102 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_constraints_util.cc ('k') | content/renderer/media/media_stream_video_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698