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

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

Issue 2757673005: Image Capture: MediaStreamTrack::applyConstraints() (Closed)
Patch Set: guidou@ and reillyg@ comments Created 3 years, 9 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: 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
new file mode 100644
index 0000000000000000000000000000000000000000..7751813d65e828697b31c7a6d157838f0f125f6b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-applyConstraints.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<body>
+<canvas id='canvas' width=10 height=10/>
+</body>
+<script>
+
+// This test verifies that MediaStreamTrack.applyConstraints() exists and that,
+// when called with no parameters, returns a Promise that is resolved. This
+// might not make sense: https://github.com/w3c/mediacapture-main/issues/438 .
+// Other tests go deeper.
+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();
+ assert_equals(stream.getAudioTracks().length, 0);
+ assert_equals(stream.getVideoTracks().length, 1);
+
+ var videoTrack = stream.getVideoTracks()[0];
+ assert_equals(typeof videoTrack.applyConstraints, 'function');
+
+ return videoTrack.applyConstraints();
+}, 'MediaStreamTrack.applyConstraints()');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698