-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1896059 [wpt PR 46198] - Add tests for bytes() method on Body mix…
…in, a=testonly Automatic update from web-platform-tests Fetch: bytes() method on Body mixin For whatwg/fetch#1753. -- wpt-commits: 1b9332c3c8a84d34e38271d29518c204ab2cfb6e wpt-pr: 46198
- Loading branch information
1 parent
b71cae2
commit 22cf03f
Showing
6 changed files
with
42 additions
and
2 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
23 changes: 23 additions & 0 deletions
23
testing/web-platform/tests/fetch/api/response/response-blob-realm.any.js
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,23 @@ | ||
// META: title=realm of Response bytes() | ||
|
||
"use strict"; | ||
|
||
promise_test(async () => { | ||
await new Promise(resolve => { | ||
onload = resolve; | ||
}); | ||
|
||
let iframe = document.createElement("iframe"); | ||
document.body.appendChild(iframe); | ||
iframe.srcdoc = "<!doctype html>"; | ||
await new Promise(resolve => { | ||
iframe.onload = resolve; | ||
}); | ||
|
||
let otherRealm = iframe.contentWindow; | ||
|
||
let ab = await window.Response.prototype.bytes.call(new otherRealm.Response("")); | ||
|
||
assert_true(ab instanceof otherRealm.Uint8Array, "Uint8Array should be created in receiver's realm"); | ||
assert_false(ab instanceof Uint8Array, "Uint8Array should not be created in the bytes() methods's realm"); | ||
}, "realm of the Uint8Array from Response bytes()"); |
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