-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #53221 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Filip Skokan <[email protected]>
- Loading branch information
1 parent
0f23553
commit 09e2191
Showing
8 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
spec: https://w3c.github.io/FileAPI/ | ||
suggested_reviewers: | ||
- inexorabletash | ||
- zqzhang | ||
- jdm | ||
- mkruisselbrink | ||
- annevk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// META: title=Blob bytes() | ||
// META: script=../support/Blob.js | ||
'use strict'; | ||
|
||
promise_test(async () => { | ||
const input_arr = new TextEncoder().encode("PASS"); | ||
const blob = new Blob([input_arr]); | ||
const uint8array = await blob.bytes(); | ||
assert_true(uint8array instanceof Uint8Array); | ||
assert_equals_typed_array(uint8array, input_arr); | ||
}, "Blob.bytes()") | ||
|
||
promise_test(async () => { | ||
const input_arr = new TextEncoder().encode(""); | ||
const blob = new Blob([input_arr]); | ||
const uint8array = await blob.bytes(); | ||
assert_true(uint8array instanceof Uint8Array); | ||
assert_equals_typed_array(uint8array, input_arr); | ||
}, "Blob.bytes() empty Blob data") | ||
|
||
promise_test(async () => { | ||
const input_arr = new TextEncoder().encode("\u08B8\u000a"); | ||
const blob = new Blob([input_arr]); | ||
const uint8array = await blob.bytes(); | ||
assert_equals_typed_array(uint8array, input_arr); | ||
}, "Blob.bytes() non-ascii input") | ||
|
||
promise_test(async () => { | ||
const input_arr = [8, 241, 48, 123, 151]; | ||
const typed_arr = new Uint8Array(input_arr); | ||
const blob = new Blob([typed_arr]); | ||
const uint8array = await blob.bytes(); | ||
assert_equals_typed_array(uint8array, typed_arr); | ||
}, "Blob.bytes() non-unicode input") | ||
|
||
promise_test(async () => { | ||
const input_arr = new TextEncoder().encode("PASS"); | ||
const blob = new Blob([input_arr]); | ||
const uint8array_results = await Promise.all([blob.bytes(), | ||
blob.bytes(), blob.bytes()]); | ||
for (let uint8array of uint8array_results) { | ||
assert_true(uint8array instanceof Uint8Array); | ||
assert_equals_typed_array(uint8array, input_arr); | ||
} | ||
}, "Blob.bytes() concurrent reads") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters