Re: [beacon-tests] Add Beacon tests http://www.w3.org/TR/beacon/ (#4024)

low audio response on y/t


On Thu, Oct 27, 2016 at 11:48 AM, Ilya Grigorik <notifications@github.com>
wrote:

> *@igrigorik* commented on this pull request.
> ------------------------------
>
> In beacon/beacon-error.js
> <https://github.com/w3c/web-platform-tests/pull/4024>:
>
> > +    importScripts("/common/utils.js");
> +    importScripts("beacon-common.js?pipe=sub");
> +}
> +
> +test(function() {
> +    // Payload that should cause sendBeacon to return false because it exceeds the maximum payload size.
> +    var exceedPayload = Array(maxPayloadSize + 1).fill('z').join("");
> +
> +    var success = navigator.sendBeacon("http://doesnotmatter", exceedPayload);
> +    assert_false(success, "calling 'navigator.sendBeacon()' with payload size exceeding the maximum size must fail");
> +}, "Verify calling 'navigator.sendBeacon()' with a large payload returns 'false'.");
> +
> +test(function() {
> +    var invalidUrl = "http://invalid:url";
> +    // http://osgvsowi/7877590 - Fetch consistently throws TypeMismatchError instead of TypeError
> +    assert_throws("TypeMismatchError", function() { navigator.sendBeacon(invalidUrl, smallPayload); },
>
> Fetch will throw a TypeError if it fails to parse the URL, correct? Given
> that all three implementations are different.. does it make sense to align
> with Fetch and spec that?
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/w3c/web-platform-tests/pull/4024>, or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AR0zPDfLjYKwMhH9VInX2SioGJhR4DzPks5q4OPkgaJpZM4KbSOv>
> .
>


View on GitHub: https://github.com/w3c/web-platform-tests/pull/4024#issuecomment-256725697

Received on Thursday, 27 October 2016 23:51:04 UTC