| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Request A Bluetooth Device On An Insecure Origin</title> | 2 <title>Request A Bluetooth Device On An Insecure Origin</title> |
| 3 <script src="/resources/testharness.js"></script> | 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharness-helpers.js"></script> | |
| 5 <script src="/resources/testharnessreport.js"></script> | 4 <script src="/resources/testharnessreport.js"></script> |
| 6 <script src="/resources/get-host-info.js"></script> | 5 <script src="/resources/get-host-info.js"></script> |
| 7 <script> | 6 <script> |
| 8 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { | 7 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) { |
| 9 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.p
athname; | 8 window.location = get_host_info().UNAUTHENTICATED_ORIGIN + window.location.p
athname; |
| 10 } else { | 9 } else { |
| 11 promise_test(function() { | 10 promise_test(function(test) { |
| 12 return assert_promise_rejects(navigator.bluetooth.requestDevice({ | 11 return promise_rejects(test, 'SecurityError', |
| 13 filters: [{services: ['generic_access']}] | 12 navigator.bluetooth.requestDevice({ |
| 14 }), | 13 filters: [{services: ['generic_access']}] |
| 15 'SecurityError'); | 14 })); |
| 16 }, "Requires secure context before user gesture"); | 15 }, "Requires secure context before user gesture"); |
| 17 } | 16 } |
| 18 </script> | 17 </script> |
| OLD | NEW |