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 0f8f0a947da5e9814d1528698cd77195ddc47ee3..5fd38113882b7c6bf7f9db219850291da9e4d2c6 100644 |
--- a/content/test/data/media/webrtc_test_utilities.js |
+++ b/content/test/data/media/webrtc_test_utilities.js |
@@ -213,3 +213,19 @@ function assertNotEquals(expected, actual) { |
} |
} |
+// 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'); |
+ }); |
+} |