| <!DOCTYPE HTML> |
| <script src="/js-test-resources/testharness.js"></script> |
| <script src="/js-test-resources/testharnessreport.js"></script> |
| <script> |
| test(() => { |
| // Note: the limit used must be same as Settings#maxBeaconTransmission. |
| // First beacon request should go through, but with a zero allowance for |
| // any subsequent requests. Which must fail. |
| let payload = new Uint8Array(64 * 1024); |
| let result = navigator.sendBeacon("resources/blank.txt", payload); |
| assert_true(result); |
| result = navigator.sendBeacon("resources/blank.txt", payload); |
| assert_false(result); |
| }, "navigator.sendBeacon() with a payload size greater than " + |
| "remaining transfer allowance should fail."); |
| </script> |
| </html> |