Skip to content

Add support for SharedArrayBuffers in Dart testing #61043

@srujzs

Description

@srujzs

Specifically, we would need to support the following headers (we're already running in a secure context, so we just need to be cross-origin isolated):

Cross-Origin-Opener-Policy
Cross-Origin-Embedder-Policy

https://developer.mozilla.org/en-US/docs/Web/API/Window/crossOriginIsolated

These are the prerequisites to use SharedArrayBuffers: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements

I did an initial attempt by adding these headers here:

response.headers.set("Access-Control-Allow-Origin", "*");
, but this makes the test driver timeout. The test still runs, but the driver never completes. This is likely because Cross-Origin-Opener-Policy: same-origin means that the window's opener is always null:
if (window != window.parent) {
, so we can never tell the driver the test has completed. Maybe we should have the driver listen for messages on the opened window instead of listening for messages on itself?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-infrastructureUse area-infrastructure for SDK infrastructure issues, like continuous integration bot changes.area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-infrastructureinternal techdebt or infrastructure issues affecting the web team specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions