| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script src="../resources/testharness.js"></script> | 4 <script src="../resources/testharness.js"></script> |
| 5 <script src="../resources/testharnessreport.js"></script> | 5 <script src="../resources/testharnessreport.js"></script> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 test(function() { | 8 test(t => { |
| 9 assert_true('receiver' in navigator.presentation); | 9 assert_true('receiver' in navigator.presentation); |
| 10 assert_true('connectionList' in navigator.presentation.receiver); | 10 }, "Test that presentation.receiver is present.") |
| 11 }, "Test that the Presentation Receiver API is present.") | |
| 12 | 11 |
| 13 test(function() { | 12 test(t => { |
| 13 assert_equals(navigator.presentation.receiver, null); |
| 14 }, "Test that presentation.receiver returns null when the setting is not set."); |
| 15 |
| 16 test(t => { |
| 17 internals.settings.setPresentationReceiver(true); |
| 18 t.add_cleanup(_ => { internals.settings.setPresentationReceiver(false); }); |
| 19 |
| 20 assert_not_equals(navigator.presentation.receiver, null); |
| 21 }, "Test that presentation.receiver returns non-null when the setting is set."); |
| 22 |
| 23 test(t => { |
| 24 internals.settings.setPresentationReceiver(true); |
| 25 t.add_cleanup(_ => { internals.settings.setPresentationReceiver(false); }); |
| 26 |
| 14 assert_equals(typeof(navigator.presentation.receiver), "object"); | 27 assert_equals(typeof(navigator.presentation.receiver), "object"); |
| 28 |
| 29 assert_true('connectionList' in navigator.presentation.receiver); |
| 15 assert_equals(typeof(navigator.presentation.receiver.connectionList), "object"
); | 30 assert_equals(typeof(navigator.presentation.receiver.connectionList), "object"
); |
| 16 }, "Test the Presentation Receiver API property types."); | 31 }, "Test the Presentation Receiver API properties types and presence."); |
| 17 | 32 |
| 18 </script> | 33 </script> |
| 19 </body> | 34 </body> |
| 20 </html> | 35 </html> |
| OLD | NEW |