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

Unified Diff: content/test/data/media/webrtc_test_utilities.js

Issue 2347473004: Revert of Removed duplicated JS hasVideoInputDeviceOnSystem() test helper (Closed)
Patch Set: Created 4 years, 3 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 | « content/public/test/browser_test_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/data/media/webrtc_test_utilities.js
diff --git a/content/test/data/media/webrtc_test_utilities.js b/content/test/data/media/webrtc_test_utilities.js
index aa11a975912478108af4879dd16c6d35000788fe..d551b8a128906c1c54901e292ea26aff1064f3c3 100644
--- a/content/test/data/media/webrtc_test_utilities.js
+++ b/content/test/data/media/webrtc_test_utilities.js
@@ -263,3 +263,19 @@
}
}
+// Returns has-video-input-device to the test if there's a webcam available on
+// the system.
+function hasVideoInputDeviceOnSystem() {
+ MediaStreamTrack.getSources(function(devices) {
+ var hasVideoInputDevice = false;
+ devices.forEach(function(device) {
+ if (device.kind == 'video')
+ hasVideoInputDevice = true;
+ });
+
+ if (hasVideoInputDevice)
+ sendValueToTest('has-video-input-device');
+ else
+ sendValueToTest('no-video-input-devices');
+ });
+}
« no previous file with comments | « content/public/test/browser_test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698