Index: LayoutTests/fast/mediastream/getMediaDevices.html |
diff --git a/LayoutTests/fast/mediastream/getMediaDevices.html b/LayoutTests/fast/mediastream/getMediaDevices.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1790394d31f4477944a1ba9c0bed735559289a10 |
--- /dev/null |
+++ b/LayoutTests/fast/mediastream/getMediaDevices.html |
@@ -0,0 +1,51 @@ |
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
+<html> |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<script> |
+description("Tests navigator.getMediaDevices"); |
+ |
+var devices = null; |
+ |
+function devicesCallback(d) { |
+ devices = d; |
+ testPassed('Devices returned.'); |
+ shouldBe('devices.length', '3'); |
+ |
+ shouldBeGreaterThan('devices[0].deviceId.length', '0'); |
+ shouldBeGreaterThan('devices[1].deviceId.length', '0'); |
+ shouldBeGreaterThan('devices[2].deviceId.length', '0'); |
+ shouldNotBe('devices[0].deviceId', 'devices[1].deviceId'); |
+ shouldNotBe('devices[0].deviceId', 'devices[2].deviceId'); |
+ shouldNotBe('devices[1].deviceId', 'devices[2].deviceId'); |
+ |
+ shouldBeEqualToString('devices[0].kind', 'audioinput'); |
+ shouldBeEqualToString('devices[1].kind', 'audiooutput'); |
+ shouldBeEqualToString('devices[2].kind', 'videoinput'); |
+ |
+ shouldBeGreaterThan('devices[0].label.length', '0'); |
+ shouldBeGreaterThan('devices[1].label.length', '0'); |
+ shouldBeGreaterThan('devices[2].label.length', '0'); |
+ shouldNotBe('devices[0].label', 'devices[1].label'); |
+ shouldNotBe('devices[0].label', 'devices[2].label'); |
+ shouldNotBe('devices[1].label', 'devices[2].label'); |
+ |
+ shouldBeGreaterThan('devices[0].groupId.length', '0'); |
+ shouldBeGreaterThan('devices[1].groupId.length', '0'); |
+ shouldBeGreaterThan('devices[2].groupId.length', '0'); |
+ shouldBe('devices[0].groupId', 'devices[1].groupId'); |
+ shouldNotBe('devices[0].groupId', 'devices[2].groupId'); |
+ |
+ finishJSTest(); |
+} |
+ |
+shouldNotThrow("navigator.getMediaDevices(devicesCallback);"); |
+testPassed('After getMediaDevices'); |
+ |
+window.jsTestIsAsync = true; |
+window.successfullyParsed = true; |
+</script> |
+</body> |
+</html> |