OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <script> |
| 8 description("Tests navigator.getMediaDevices"); |
| 9 |
| 10 var devices = null; |
| 11 |
| 12 function devicesCallback(d) { |
| 13 devices = d; |
| 14 testPassed('Devices returned.'); |
| 15 shouldBe('devices.length', '3'); |
| 16 |
| 17 shouldBeGreaterThan('devices[0].deviceId.length', '0'); |
| 18 shouldBeGreaterThan('devices[1].deviceId.length', '0'); |
| 19 shouldBeGreaterThan('devices[2].deviceId.length', '0'); |
| 20 shouldNotBe('devices[0].deviceId', 'devices[1].deviceId'); |
| 21 shouldNotBe('devices[0].deviceId', 'devices[2].deviceId'); |
| 22 shouldNotBe('devices[1].deviceId', 'devices[2].deviceId'); |
| 23 |
| 24 shouldBeEqualToString('devices[0].kind', 'audioinput'); |
| 25 shouldBeEqualToString('devices[1].kind', 'audiooutput'); |
| 26 shouldBeEqualToString('devices[2].kind', 'videoinput'); |
| 27 |
| 28 shouldBeGreaterThan('devices[0].label.length', '0'); |
| 29 shouldBeGreaterThan('devices[1].label.length', '0'); |
| 30 shouldBeGreaterThan('devices[2].label.length', '0'); |
| 31 shouldNotBe('devices[0].label', 'devices[1].label'); |
| 32 shouldNotBe('devices[0].label', 'devices[2].label'); |
| 33 shouldNotBe('devices[1].label', 'devices[2].label'); |
| 34 |
| 35 shouldBeGreaterThan('devices[0].groupId.length', '0'); |
| 36 shouldBeGreaterThan('devices[1].groupId.length', '0'); |
| 37 shouldBeGreaterThan('devices[2].groupId.length', '0'); |
| 38 shouldBe('devices[0].groupId', 'devices[1].groupId'); |
| 39 shouldNotBe('devices[0].groupId', 'devices[2].groupId'); |
| 40 |
| 41 finishJSTest(); |
| 42 } |
| 43 |
| 44 shouldNotThrow("navigator.getMediaDevices(devicesCallback);"); |
| 45 testPassed('After getMediaDevices'); |
| 46 |
| 47 window.jsTestIsAsync = true; |
| 48 window.successfullyParsed = true; |
| 49 </script> |
| 50 </body> |
| 51 </html> |
OLD | NEW |