| <!DOCTYPE html> | |
| <script src="utils.js"></script> | |
| <title>getBattery should fail in a fenced frame</title> | |
| <script> | |
| async function init() { // Needed in order to use top-level await. | |
| const [uuid] = parseKeylist(); | |
| try { | |
| await navigator.getBattery(); | |
| writeValueToServer(uuid, 'Expected an exception but the call succeeded'); | |
| } catch (err) { | |
| writeValueToServer(uuid, err.name); | |
| } | |
| } | |
| init(); | |
| </script> | |
| </html> |