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

Unified Diff: third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp

Issue 1605513002: Remove MockConstraints (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed RTCPeerConnection test Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
index 39fac457fd7c4a97d9e9e19b84159eb537c2b912..ee8148fb7b52fc73a0bb5768f49e01e67328534b 100644
--- a/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/MediaConstraintsImpl.cpp
@@ -354,7 +354,10 @@ static void parseOldStyleNames(const WebVector<WebMediaConstraint>& oldNames, We
result.googPayloadPadding.setExact(toBoolean(constraint.m_value));
} else if (constraint.m_name.equals(kTestConstraint1)
|| constraint.m_name.equals(kTestConstraint2)) {
- // These constraints are only for testing parsing. Ignore them.
+ // These constraints are only for testing parsing.
+ // Values 0 and 1 are legal, all others are a ConstraintError.
+ if (!constraint.m_value.equals("0") && !constraint.m_value.equals("1"))
+ errorState.throwConstraintError("Illegal value for constraint", constraint.m_name);
} else {
// TODO(hta): UMA stats for unknown constraints passed.
// https://crbug.com/576613
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698