Skip to content

FileAPI: handle host endianness in Blob constructor TypedArray tests - #63714

Merged
jdm merged 1 commit into
web-platform-tests:masterfrom
abhayagarwal-dev:fix-blob-typedarrays-endianness
Oct 15, 2026
Merged

jdm merged 1 commit into
web-platform-tests:masterfrom
abhayagarwal-dev:fix-blob-typedarrays-endianness

Conversation

@abhayagarwal-dev

@abhayagarwal-dev abhayagarwal-dev commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

TypedArrays store data using host-native byte order.
On big-endian architectures (e.g. s390x / ppc64 AIX), TypedArray byte sequences read as a Blob produce different byte orders than on little-endian architectures.

This PR dynamically asserts the expected string based on host endianness so the tests pass across all platforms.

Before (in Big-Endian machine):

    [UNEXPECTED_FAILURE][FAIL] Passing typed arrays as elements of the blobParts array should work.
    assert_equals: expected "PASSPASSPASSPASSPASSPASSPASS" but got "PASSPASSAPSSAPSSSSAPSSAPSSAP"
        at Test.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/support/Blob.js:16:5)
        at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    Command: /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/out/Release/node  /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/wpt/test-blob.js 'Blob-constructor.any.js'
    

    
    [UNEXPECTED_FAILURE][FAIL] Passing a Float64Array as element of the blobParts array should work.
    assert_equals: expected "PASSPASS" but got "SSAPSSAP"
        at Test.<anonymous> (/home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/fixtures/wpt/FileAPI/support/Blob.js:16:5)
        at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    Command: /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/out/Release/node  /home/iojs/build/workspace/node-test-commit-aix/nodes/aix72-ppc64/test/wpt/test-blob.js 'Blob-constructor.any.js'
    Files: 2/2 ran, 0 passed, 0 skipped, 0 expected failures, 2 unexpected failures, 0 unexpected passes
Subtests: 138 passed, 0 skipped, 0 expected failures, 8 unexpected failures, 0 unexpected passes

After(In Big-Endian machine):

Files: 2/2 ran, 2 passed, 0 skipped, 0 expected failures, 0 unexpected failures, 0 unexpected passes
Subtests: 146 passed, 0 skipped, 0 expected failures, 0 unexpected failures, 0 unexpected passes

References

@jdm
jdm enabled auto-merge (rebase) October 15, 2026 13:59
auto-merge was automatically disabled October 15, 2026 14:18

Pull request was closed

@abhayagarwal-dev
abhayagarwal-dev requested a review from jdm October 15, 2026 14:22
@jdm
jdm enabled auto-merge (rebase) October 15, 2026 14:23
@jdm
jdm merged commit 5878c7a into web-platform-tests:master Oct 15, 2026
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants