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

Unified Diff: third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-applyConstraints.html

Issue 2819233002: Image Capture: Reject applyConstraints() if passed an unsupported constraint (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/imagecapture/MediaStreamTrack-applyConstraints.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-applyConstraints.html
diff --git a/third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-applyConstraints.html b/third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-applyConstraints.html
index 5164d490d7ea0aefacc3d3098f81c4b48045363b..af1e92b2c7ade661a442e3320b563fc9548ee555 100644
--- a/third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-applyConstraints.html
+++ b/third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-applyConstraints.html
@@ -26,6 +26,26 @@ promise_test(function(t) {
return videoTrack.applyConstraints();
}, 'MediaStreamTrack.applyConstraints()');
+// This test verifies that applyConstraints() rejects the returned Promise if
+// passed a non-supported image-capture constraint (https://crbug.com/711694).
+promise_test(function(t) {
+ var canvas = document.getElementById('canvas');
+ var context = canvas.getContext("2d");
+ context.fillStyle = "red";
+ context.fillRect(0, 0, 10, 10);
+
+ var stream = canvas.captureStream();
+ var videoTrack = stream.getVideoTracks()[0];
+
+ var expectedException =
+ new DOMException('Unsupported constraint(s)', 'NotSupportedError');
+
+ // Use e.g. |torch| as an example of unsupported constraint.
+ assert_false("torch" in videoTrack.getCapabilities());
+ return promise_rejects(
+ t, expectedException,
+ videoTrack.applyConstraints({advanced : [ {torch : true} ]}));
+}, 'MediaStreamTrack.applyConstraints() with unsupported constraint');
// This test verifies that applyConstraints() rejects the returned Promise if
// passed a non-supported constraint.
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/imagecapture/MediaStreamTrack-applyConstraints.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698