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

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

Issue 2804653003: Image Capture: make sure applyConstraints() only works for ImageCapture constraints (Closed)
Patch Set: LayoutTests 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/fast/imagecapture/MediaStreamTrack-getConstraints.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 7751813d65e828697b31c7a6d157838f0f125f6b..5164d490d7ea0aefacc3d3098f81c4b48045363b 100644
--- a/third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-applyConstraints.html
+++ b/third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-applyConstraints.html
@@ -26,4 +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 constraint.
+// TODO(mcasas): remove entirely after https://crbug.com/338503.
+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(
+ 'Only Image-Capture constraints supported (https://crbug.com/338503)',
+ 'NotSupportedError');
+
+ return promise_rejects(
+ t, expectedException,
+ videoTrack.applyConstraints({advanced : [ {width : 640} ]}));
+}, 'MediaStreamTrack.applyConstraints() with non Image-Capture constraint');
+
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-getConstraints.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698