blob: ef2697113330135cbaee4e2505ee57a6fd5118fd [file] [log] [blame]
<!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>