Skip to content

Commit

Permalink
Fix sharedarraybuffer.html web_tests
Browse files Browse the repository at this point in the history
Move the test to WPT and use a crossOriginIsolated context to allow
constructing SharedArrayBuffer.

Bug: 1194557
Change-Id: I4661a6c1b54479779367f0cb273dcd4f5fe3cf34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2845404
Commit-Queue: Arthur Sonzogni <[email protected]>
Reviewed-by: Antonio Sartori <[email protected]>
Cr-Commit-Position: refs/heads/master@{#875204}
  • Loading branch information
ArthurSonzogni authored and chromium-wpt-export-bot committed Apr 22, 2021
1 parent ff952d5 commit f0100ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions encoding/sharedarraybuffer.https.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>

test(() => {
const decoder = new TextDecoder('utf-8');
const buffer = new SharedArrayBuffer(4);
assert_throws_js(TypeError, () => {
decoder.decode(new Uint8Array(buffer));
}, 'constructing TextDecoder with SharedArrayBuffer view should throw');
}, 'decoding SharedArrayBuffer');

</script>
2 changes: 2 additions & 0 deletions encoding/sharedarraybuffer.https.html.headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Cross-Origin-Opener-Policy:same-origin
Cross-Origin-Embedder-Policy:require-corp

0 comments on commit f0100ca

Please sign in to comment.