OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>MediaCapabilities.query()</title> |
| 3 <script src=/resources/testharness.js></script> |
| 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <script> |
| 6 |
| 7 promise_test(t => { |
| 8 return promise_rejects(t, new TypeError(), navigator.mediaCapabilities.query()
); |
| 9 }, "Test that query rejects if it doesn't get a configuration"); |
| 10 |
| 11 promise_test(t => { |
| 12 return promise_rejects(t, new TypeError(), navigator.mediaCapabilities.query({
})); |
| 13 }, "Test that query rejects if the MediaConfiguration isn't valid"); |
| 14 |
| 15 promise_test(t => { |
| 16 return navigator.mediaCapabilities.query({ |
| 17 type: 'file', |
| 18 video: { |
| 19 type: 'video/webm', |
| 20 width: 800, |
| 21 height: 600, |
| 22 bitrate: 3000, |
| 23 framerate: 24, |
| 24 }, |
| 25 audio: { |
| 26 type: 'audio/webm', |
| 27 }, |
| 28 }).then(ability => { |
| 29 assert_idl_attribute(ability, 'supported'); |
| 30 assert_idl_attribute(ability, 'smooth'); |
| 31 assert_idl_attribute(ability, 'powerEfficient'); |
| 32 }); |
| 33 }, "Test that query returns a valid MediaDecodingAbility objects"); |
| 34 |
| 35 </script> |
OLD | NEW |