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

Unified Diff: components/test_runner/mock_web_user_media_client.cc

Issue 1608073002: Revert of Remove MockConstraints (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: components/test_runner/mock_web_user_media_client.cc
diff --git a/components/test_runner/mock_web_user_media_client.cc b/components/test_runner/mock_web_user_media_client.cc
index a5f8bdcbe76c7fdb72b5835db62261d0f31376fe..4197a268e105f418bf8698d1ac58a536989f57ca 100644
--- a/components/test_runner/mock_web_user_media_client.cc
+++ b/components/test_runner/mock_web_user_media_client.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/macros.h"
+#include "components/test_runner/mock_constraints.h"
#include "components/test_runner/web_test_delegate.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
#include "third_party/WebKit/public/platform/WebMediaDeviceInfo.h"
@@ -145,6 +146,22 @@
return;
}
+ WebMediaConstraints constraints = request.audioConstraints();
+ WebString failed_constraint;
+ if (!constraints.isNull() &&
+ !MockConstraints::VerifyConstraints(constraints, &failed_constraint)) {
+ delegate_->PostTask(new UserMediaRequestConstraintFailedTask(
+ this, request, failed_constraint));
+ return;
+ }
+ constraints = request.videoConstraints();
+ if (!constraints.isNull() &&
+ !MockConstraints::VerifyConstraints(constraints, &failed_constraint)) {
+ delegate_->PostTask(new UserMediaRequestConstraintFailedTask(
+ this, request, failed_constraint));
+ return;
+ }
+
WebMediaStream stream;
stream.initialize(WebVector<WebMediaStreamTrack>(),
WebVector<WebMediaStreamTrack>());
« no previous file with comments | « components/test_runner/mock_constraints.cc ('k') | components/test_runner/mock_webrtc_peer_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698