https://github.com/web-platform-tests/wpt
Revision 383fd735a55bd21daef6a07430d8f6ce3852f30b authored by Kinuko Yasuda on 28 March 2018, 01:47:22 UTC, committed by Blink WPT Bot on 28 March 2018, 02:06:24 UTC
The reason for revert was the new navigation timing test expectations
(that got commited right before the original change) had a FAIL
expectation for the particular event order that this change was fixing.

Original change's description:
> Don't adjust the NavigationTimings on redirects
>
> We adjust the timings in WebDocumentLoaderImpl::UpdateNavigation(),
> shouldn't update in each AddRedirect() (which is called in a batch
> way after all the redirects are handled in the browser process with PlzNavigate,
> adjusting timings there with current timestamp is totally wrong)
>
> R=​ksakamoto,arthursonzogni
>
> Bug: 813889
> Change-Id: I3a57d3fdf1833c300feb5ee61737b64cece0946b
> Reviewed-on: https://chromium-review.googlesource.com/974673
> Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
> Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#546001}

Bug: 813889
Change-Id: I6f5c0ba1196fa1dd52225036820b29a95569ac21
Reviewed-on: https://chromium-review.googlesource.com/981913
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546365}
1 parent 62d7010
Raw File
Tip revision: 383fd735a55bd21daef6a07430d8f6ce3852f30b authored by Kinuko Yasuda on 28 March 2018, 01:47:22 UTC
Re-land: "Don't adjust the NavigationTimings on redirects"
Tip revision: 383fd73
textdecoder-byte-order-marks.html
<!DOCTYPE html>
<title>Encoding API: Byte-order marks</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>

var testCases = [
    {
        encoding: 'utf-8',
        bom: [0xEF, 0xBB, 0xBF],
        bytes: [0x7A, 0xC2, 0xA2, 0xE6, 0xB0, 0xB4, 0xF0, 0x9D, 0x84, 0x9E, 0xF4, 0x8F, 0xBF, 0xBD]
    },
    {
        encoding: 'utf-16le',
        bom: [0xff, 0xfe],
        bytes: [0x7A, 0x00, 0xA2, 0x00, 0x34, 0x6C, 0x34, 0xD8, 0x1E, 0xDD, 0xFF, 0xDB, 0xFD, 0xDF]
    },
    {
        encoding: 'utf-16be',
        bom: [0xfe, 0xff],
        bytes: [0x00, 0x7A, 0x00, 0xA2, 0x6C, 0x34, 0xD8, 0x34, 0xDD, 0x1E, 0xDB, 0xFF, 0xDF, 0xFD]
    }
];

var string = 'z\xA2\u6C34\uD834\uDD1E\uDBFF\uDFFD'; // z, cent, CJK water, G-Clef, Private-use character

testCases.forEach(function(t) {
    test(function() {

        var decoder = new TextDecoder(t.encoding);
        assert_equals(decoder.decode(new Uint8Array(t.bytes)), string,
                      'Sequence without BOM should decode successfully');

        assert_equals(decoder.decode(new Uint8Array(t.bom.concat(t.bytes))), string,
                      'Sequence with BOM should decode successfully (with no BOM present in output)');

        testCases.forEach(function(o) {
            if (o === t)
                return;

            assert_not_equals(decoder.decode(new Uint8Array(o.bom.concat(t.bytes))), string,
                              'Mismatching BOM should not be ignored - treated as garbage bytes.');
        });

    }, 'Byte-order marks: ' + t.encoding);
});

</script>
back to top