<!DOCTYPE HTML>
<script src="../../../../resources/js-test.js"></script>
<script>
description("Exercising the Beacon API");

shouldBeTrue("Object.getPrototypeOf(navigator).hasOwnProperty('sendBeacon')");
shouldBeEqualToString("typeof navigator.sendBeacon", "function");
shouldThrow("navigator.sendBeacon()");
shouldThrow("navigator.sendBeacon('http://foo:-80/')");
shouldThrow("navigator.sendBeacon('javascript:alert(1);')");

if (window.SharedArrayBuffer) {
  shouldThrow("navigator.sendBeacon('http://foo:-80/', new Uint8Array(new SharedArrayBuffer(10)))");
}

</script>
