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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/imagecapture/MediaStreamTrack-getConstraints.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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src=../../resources/testharness.js></script> 2 <script src=../../resources/testharness.js></script>
3 <script src=../../resources/testharnessreport.js></script> 3 <script src=../../resources/testharnessreport.js></script>
4 <body> 4 <body>
5 <canvas id='canvas' width=10 height=10/> 5 <canvas id='canvas' width=10 height=10/>
6 </body> 6 </body>
7 <script> 7 <script>
8 8
9 const constraints = { whiteBalanceMode : "manual", 9 const constraints = { whiteBalanceMode : "manual",
10 exposureMode : "continuous", 10 exposureMode : "continuous",
(...skipping 30 matching lines...) Expand all
41 // service in this Layout Test, but |constraintsIn| should be cached. 41 // service in this Layout Test, but |constraintsIn| should be cached.
42 videoTrack.applyConstraints(constraintsIn) 42 videoTrack.applyConstraints(constraintsIn)
43 .then(() => { /* ignore */ }) 43 .then(() => { /* ignore */ })
44 .catch((e) => { /* ignore */ }) 44 .catch((e) => { /* ignore */ })
45 .then(() => { 45 .then(() => {
46 const constraintsOut = videoTrack.getConstraints(); 46 const constraintsOut = videoTrack.getConstraints();
47 assert_object_equals(constraintsOut, constraintsIn, "constraints"); 47 assert_object_equals(constraintsOut, constraintsIn, "constraints");
48 t.done(); 48 t.done();
49 }); 49 });
50 50
51 // Clear constraints by sending an empty constraint set.
52 videoTrack.applyConstraints({})
53 .then(() => {
54 const constraintsOut = videoTrack.getConstraints();
55 assert_object_equals(constraintsOut, {}, "constraints");
56 t.done();
57 });
51 }); 58 });
52 }; 59 };
53 60
54 // Send each line of |constraints| in turn and then the whole dictionary. 61 // Send each line of |constraints| in turn and then the whole dictionary.
55 for (key in constraints) { 62 for (key in constraints) {
56 var one_constraint = {}; 63 var one_constraint = {};
57 one_constraint[key] = constraints[key]; 64 one_constraint[key] = constraints[key];
58 generate_tests( 65 generate_tests(
59 makeAsyncTest, 66 makeAsyncTest,
60 [[ 'MediaStreamTrack.getConstraints(), key: ' + key, one_constraint ]]); 67 [[ 'MediaStreamTrack.getConstraints(), key: ' + key, one_constraint ]]);
61 } 68 }
62 69
63 generate_tests(makeAsyncTest, [[ 70 generate_tests(makeAsyncTest, [[
64 'MediaStreamTrack.getConstraints(), complete ', constraints 71 'MediaStreamTrack.getConstraints(), complete ', constraints
65 ]]); 72 ]]);
66 73
67 </script> 74 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698