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

Unified Diff: third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html

Issue 2590193002: Add FacingMode to MediaStreamTrack.getSettings() (Closed)
Patch Set: Layout test, with TODO Created 3 years, 11 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/mediastream/MediaStreamTrack-getSettings.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html b/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html
index 424cd3c4ed2c2fc4e4435624212cdab68881b72e..39da4ac828a35b69cd441ef627bc6d70a83ffaae 100644
--- a/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html
+++ b/third_party/WebKit/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html
@@ -33,4 +33,33 @@ promise_test(function() {
});
}, 'A video track returns frame rate');
+promise_test(function() {
+ return navigator.mediaDevices.getUserMedia(
+ {video: {facingMode: {exact: "user"}}})
+ .then(function(s) {
+ assert_unreached();
+ })
+ .catch(function(e) {
+ assert_equals(e.name, 'Error');
+ });
+}, 'With no fake device, asking for user-facing device rejects');
+
+promise_test(function() {
+ return internals.addFakeDevice({kind: "video"},
+ {facingMode: {exact: "user"}})
+ .then(function() {
+ navigator.mediaDevices.getUserMedia({video: {facingMode: {exact: "user"}}})
+ })
+ .then(function(s) {
+ settings = s.getVideoTracks()[0].getSettings();
+ assert_equals(settings.facingMode, "user");
+ })
+ .catch(function(e) {
+ console.log('Fake devices are not functional yet.');
+ // TODO(hta): Finish creation of fake devices. Until then, accept failure.
+ // crbug.com/678561
+ assert_equals(e.name, 'TypeError', "Check crbug.com/678561");
+ });
+}, 'With a fake user-facing device, facing mode is matched')
+
</script>

Powered by Google App Engine
This is Rietveld 408576698