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

Side by Side Diff: third_party/WebKit/LayoutTests/imagecapture/MediaStreamTrack-applyConstraints-getSettings.html

Issue 2819653003: 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 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 <script src="../resources/mojo-helpers.js"></script> 4 <script src="../resources/mojo-helpers.js"></script>
5 <script src="resources/mock-imagecapture.js"></script> 5 <script src="resources/mock-imagecapture.js"></script>
6 <body> 6 <body>
7 <canvas id='canvas' width=10 height=10/> 7 <canvas id='canvas' width=10 height=10/>
8 </body> 8 </body>
9 <script> 9 <script>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 }, 45 },
46 error => { 46 error => {
47 assert_unreached("Error creating MockImageCapture: " + error); 47 assert_unreached("Error creating MockImageCapture: " + error);
48 }) 48 })
49 .then(() => { 49 .then(() => {
50 // |stream| must be created _after_ |mock| is constructed to give the 50 // |stream| must be created _after_ |mock| is constructed to give the
51 // latter time to override the bindings. 51 // latter time to override the bindings.
52 var stream = canvas.captureStream(); 52 var stream = canvas.captureStream();
53 videoTrack = stream.getVideoTracks()[0]; 53 videoTrack = stream.getVideoTracks()[0];
54 54
55 // |videoTrack|s capabilities, just like the actual capture, is a process
56 // kicked right after creation, we introduce a small delay to allow for
Reilly Grant (use Gerrit) 2017/04/14 19:46:17 same here
mcasas 2017/04/14 21:21:27 Done.
57 // those to be collected.
58 // TODO(mcasas): this shouldn't be needed, https://crbug.com/711524.
59 return new Promise((resolve) => setTimeout(resolve, 100));
60 })
61 .then(function() {
55 return videoTrack.applyConstraints(constraints); 62 return videoTrack.applyConstraints(constraints);
56 }) 63 })
57 .then(function() { 64 .then(function() {
58 65
59 settings = videoTrack.getSettings(); 66 settings = videoTrack.getSettings();
60 assert_equals(typeof settings, 'object'); 67 assert_equals(typeof settings, 'object');
61 68
62 assert_equals(constraints.advanced[0].whiteBalanceMode, 69 assert_equals(constraints.advanced[0].whiteBalanceMode,
63 settings.whiteBalanceMode, 'whiteBalanceMode'); 70 settings.whiteBalanceMode, 'whiteBalanceMode');
64 assert_equals(constraints.advanced[0].exposureMode, settings.exposureMode, 71 assert_equals(constraints.advanced[0].exposureMode, settings.exposureMode,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 105
99 t.done(); 106 t.done();
100 }) 107 })
101 .catch(error => { 108 .catch(error => {
102 assert_unreached("Error applying constraints: " + error.message); 109 assert_unreached("Error applying constraints: " + error.message);
103 }); 110 });
104 111
105 }, 'exercises an applyConstraints() - getSettings() cycle'); 112 }, 'exercises an applyConstraints() - getSettings() cycle');
106 113
107 </script> 114 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698