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

Unified Diff: third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getConstraints.html

Issue 2569233002: Make naked values in constraint behave right in "advanced" (Closed)
Patch Set: Update layout test for getConstraints 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getConstraints.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getConstraints.html b/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getConstraints.html
index 3390376326f32d849013dc66bf0ff03c2fc05b16..f0abf960b31e375c9f2514b1682dded625e01606 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getConstraints.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getConstraints.html
@@ -64,14 +64,14 @@ promise_test(function() {
// These constraints are syntactically valid, but may cause rejection.
// They are included in an "advanced" constraint.
const ignorableConstraintSet = {
- volume: { exact: 1.0 },
- sampleRate: { exact: 42 },
- sampleSize: { exact: 3 },
- echoCancellation: { exact: false },
- latency: { exact: 0.22 },
- channelCount: { exact: 2 },
- deviceId: { exact: ["foo", "fooz"] },
- groupId: { exact: ["bar", "baz"] }
+ volume: { ideal: 1.0 },
+ sampleRate: { ideal: 42 },
+ sampleSize: { ideal: 3 },
+ echoCancellation: { ideal: false },
+ latency: { ideal: 0.22 },
+ channelCount: { ideal: 2 },
+ deviceId: { ideal: ["foo", "fooz"] },
+ groupId: { ideal: ["bar", "baz"] }
};
let complexConstraints = complexConstraintSet;
complexConstraints.advanced = [ ignorableConstraintSet ];
@@ -86,6 +86,12 @@ promise_test(function() {
}, 'All valid keys are returned for complex constraints');
// Syntax tests for constraints.
+// These work by putting the constraints into an advanced constraint
+// (so that they can be ignored), calling getUserMedia, and then
+// inspecting the constraints.
+// In advanced constraints, naked values mean "exact", and "exact" values
+// are thus unwrapped, which is the opposite behavior from the "basic"
+// constraint set (outside advanced).
function constraintSyntaxTestWithChange(name, constraints, expected_result) {
promise_test(function() {
@@ -106,29 +112,29 @@ function constraintSyntaxTest(name, constraints) {
}
constraintSyntaxTest('Simple integer', { height: 42 });
-constraintSyntaxTest('Exact integer', { height: { exact: 42 }});
+constraintSyntaxTest('Ideal integer', { height: { ideal: 42 }});
constraintSyntaxTest('Min/max integer', { height: { min: 42, max: 43 }});
-constraintSyntaxTestWithChange('Ideal unwrapped integer',
- { height: { ideal: 42 } }, { height: 42 });
+constraintSyntaxTestWithChange('Exact unwrapped integer',
+ { height: { exact: 42 } }, { height: 42 });
constraintSyntaxTest('Simple double', { aspectRatio: 1.5 });
-constraintSyntaxTest('Exact double', { aspectRatio: { exact: 1.5 }});
+constraintSyntaxTest('Ideal double', { aspectRatio: { ideal: 1.5 }});
constraintSyntaxTest('Min/max double', { aspectRatio: { min: 1.5, max: 2.0 }});
-constraintSyntaxTestWithChange('Ideal unwrapped double',
- { aspectRatio: { ideal: 1.5 } }, { aspectRatio: 1.5 });
+constraintSyntaxTestWithChange('Exact unwrapped double',
+ { aspectRatio: { exact: 1.5 } }, { aspectRatio: 1.5 });
constraintSyntaxTest('Simple String', { facingMode: "user1" });
-constraintSyntaxTest('Exact String', { facingMode: { exact: "user2" }});
-constraintSyntaxTest('Multiple String in Brackets', { facingMode: { exact: ["user3", "left3"]}});
+constraintSyntaxTest('Ideal String', { facingMode: { ideal: "user2" }});
+constraintSyntaxTest('Multiple String in Brackets', { facingMode: { ideal: ["user3", "left3"]}});
constraintSyntaxTest('Multiple Bracketed Naked String', { facingMode: ["user4", "left4"] });
constraintSyntaxTestWithChange('Single Bracketed string unwrapped',
{ 'facingMode': ["user5"]}, { facingMode: "user5" });
constraintSyntaxTest('Both Ideal and Exact string', { facingMode: { ideal: "user6", exact: "left6" }});
constraintSyntaxTest('Simple boolean', { echoCancellation: true });
-constraintSyntaxTest('Exact boolean', { echoCancellation: { exact: true }});
-constraintSyntaxTestWithChange('Ideal unwrapped boolean',
- { echoCancellation: { ideal: true } }, { echoCancellation: true });
+constraintSyntaxTest('Ideal boolean', { echoCancellation: { ideal: true }});
+constraintSyntaxTestWithChange('Exact unwrapped boolean',
+ { echoCancellation: { exact: true } }, { echoCancellation: true });
</script>
</body>
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698