| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <link rel="stylesheet" href="../js/resources/js-test-style.css"> | 4 <link rel="stylesheet" href="../js/resources/js-test-style.css"> |
| 5 <script src="../js/resources/js-test-pre.js"></script> | 5 <script src="../js/resources/js-test-pre.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <p id="description"></p> | 8 <p id="description"></p> |
| 9 <div id="console"></div> | 9 <div id="console"></div> |
| 10 <script> | 10 <script> |
| 11 description("Tests webkitGetUserMedia."); | 11 description("Tests webkitGetUserMedia."); |
| 12 | 12 |
| 13 var stream; | 13 var stream; |
| 14 var errorArg; |
| 14 | 15 |
| 15 function error() { | 16 function error() { |
| 16 testFailed('Error callback called.'); | 17 testFailed('Error callback called.'); |
| 17 finishJSTest(); | 18 finishJSTest(); |
| 18 } | 19 } |
| 19 | 20 |
| 20 function gotStreamInError(s) { | 21 function gotStreamInError(s) { |
| 21 testFailed('Stream generated.'); | 22 testFailed('Stream generated.'); |
| 22 finishJSTest(); | 23 finishJSTest(); |
| 23 } | 24 } |
| 24 | 25 |
| 25 function gotStream5(s) { | 26 function gotStream5(s) { |
| 26 stream = s; | 27 stream = s; |
| 27 testPassed('Stream generated.'); | 28 testPassed('Stream generated.'); |
| 28 shouldBe('stream.getAudioTracks().length', '1'); | 29 shouldBe('stream.getAudioTracks().length', '1'); |
| 29 shouldBe('stream.getVideoTracks().length', '1'); | 30 shouldBe('stream.getVideoTracks().length', '1'); |
| 30 finishJSTest(); | 31 finishJSTest(); |
| 31 } | 32 } |
| 32 | 33 |
| 33 function error1() { | 34 function error1(e) { |
| 35 errorArg = e; |
| 34 testPassed('Error callback called.'); | 36 testPassed('Error callback called.'); |
| 37 shouldBeEqualToString('errorArg.name', 'ConstraintNotSatisfiedError'); |
| 38 shouldBeEqualToString('errorArg.constraintName', 'valid_but_unsupported_1'); |
| 35 | 39 |
| 36 shouldNotThrow("navigator.webkitGetUserMedia({audio:{mandatory:{'valid_and_s
upported_1':1}, optional:[{'valid_but_unsupported_1':0}]}, video:true}, gotStrea
m5, error);"); | 40 shouldNotThrow("navigator.webkitGetUserMedia({audio:{mandatory:{'valid_and_s
upported_1':1}, optional:[{'valid_but_unsupported_1':0}]}, video:true}, gotStrea
m5, error);"); |
| 37 } | 41 } |
| 38 | 42 |
| 39 function gotStream4(s) { | 43 function gotStream4(s) { |
| 40 stream = s; | 44 stream = s; |
| 41 testPassed('Stream generated.'); | 45 testPassed('Stream generated.'); |
| 42 shouldBe('stream.getAudioTracks().length', '1'); | 46 shouldBe('stream.getAudioTracks().length', '1'); |
| 43 shouldBe('stream.getVideoTracks().length', '1'); | 47 shouldBe('stream.getVideoTracks().length', '1'); |
| 44 | 48 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 74 | 78 |
| 75 shouldThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, err
or);") | 79 shouldThrow("navigator.webkitGetUserMedia({audio:false, video:false}, error, err
or);") |
| 76 shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream1, error);")
; | 80 shouldNotThrow("navigator.webkitGetUserMedia({audio:true}, gotStream1, error);")
; |
| 77 | 81 |
| 78 window.jsTestIsAsync = true; | 82 window.jsTestIsAsync = true; |
| 79 window.successfullyParsed = true; | 83 window.successfullyParsed = true; |
| 80 </script> | 84 </script> |
| 81 <script src="../js/resources/js-test-post.js"></script> | 85 <script src="../js/resources/js-test-post.js"></script> |
| 82 </body> | 86 </body> |
| 83 </html> | 87 </html> |
| OLD | NEW |