Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Audio Output Devices</title> | 4 <title>Audio Output Devices</title> |
| 5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <video id="testVideo"></video> | 9 <audio id="testAudio"></audio> |
| 10 <script> | 10 <script> |
| 11 // Tests that the setSinkId() Promise rejects with a NotSupportedError, | 11 // Tests that the setSinkId() Promise rejects with a NotSupportedError, |
| 12 // because the functionality has not been implemented yet. | 12 // because the functionality has not been implemented yet. |
| 13 promise_test(function() { | 13 promise_test(function() { |
| 14 var video = document.getElementById('testVideo'); | 14 var audio = document.getElementById('testAudio'); |
| 15 assert_not_equals(video, null); | 15 assert_not_equals(audio, null); |
| 16 | 16 |
| 17 assert_idl_attribute(video, 'setSinkId'); | 17 assert_idl_attribute(audio, 'setSinkId'); |
| 18 assert_equals(typeof video.setSinkId, 'function'); | 18 assert_equals(typeof audio.setSinkId, 'function'); |
| 19 assert_idl_attribute(video, 'sinkId'); | 19 assert_idl_attribute(audio, 'sinkId'); |
| 20 assert_equals(video.sinkId, ''); | 20 assert_equals(audio.sinkId, ''); |
| 21 | 21 |
| 22 return video.setSinkId('').then(function() { | 22 return audio.setSinkId('').then(function() { |
| 23 assert_unreached('setSinkId() should not be implemented yet!'); | 23 return audio.setSinkId('xxx'); |
| 24 }, function(error) { | 24 }, function(error) { |
| 25 assert_equals(error.name, 'NotSupportedError'); | 25 assert_unreached('setSinkId() should have succeeded!'); |
|
Mike West
2015/06/18 06:30:49
Can you also assert that the sink ID has the corre
| |
| 26 }). then(function() { | |
| 27 assert_unreached('setSinkId() should have failed!'); | |
| 28 }, function(error) { | |
| 26 return Promise.resolve(); | 29 return Promise.resolve(); |
| 27 }); | 30 }) |
| 28 }, 'setSinkId() test'); | 31 }, 'setSinkId() test'); |
| 29 </script> | 32 </script> |
| 30 </body> | 33 </body> |
| 31 </html> | 34 </html> |
| 32 | 35 |
| OLD | NEW |