-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
3,090 additions
and
394 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
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,2 @@ | ||
// META: script=/resources/idlharness-shadowrealm.js | ||
idl_test_shadowrealm(["encoding"], ["streams"]); |
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,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
2
test/fixtures/wpt/encoding/sharedarraybuffer.https.html.headers
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,2 @@ | ||
Cross-Origin-Opener-Policy:same-origin | ||
Cross-Origin-Embedder-Policy:require-corp |
107 changes: 107 additions & 0 deletions
107
test/fixtures/wpt/encoding/single-byte-decoder.window.js
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
test(() => { | ||
// Truncated sequences | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0])), "\uFFFD"); | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x9F])), "\uFFFD"); | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x9F, 0x92])), "\uFFFD"); | ||
|
||
// Errors near end-of-queue | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x9F, 0x41])), "\uFFFDA"); | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x41, 0x42])), "\uFFFDAB"); | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x41, 0xF0])), "\uFFFDA\uFFFD"); | ||
assert_equals(new TextDecoder().decode(new Uint8Array([0xF0, 0x8F, 0x92])), "\uFFFD\uFFFD\uFFFD"); | ||
}, "TextDecoder end-of-queue handling"); | ||
|
||
test(() => { | ||
const decoder = new TextDecoder(); | ||
decoder.decode(new Uint8Array([0xF0]), { stream: true }); | ||
assert_equals(decoder.decode(), "\uFFFD"); | ||
|
||
decoder.decode(new Uint8Array([0xF0]), { stream: true }); | ||
decoder.decode(new Uint8Array([0x9F]), { stream: true }); | ||
assert_equals(decoder.decode(), "\uFFFD"); | ||
|
||
decoder.decode(new Uint8Array([0xF0, 0x9F]), { stream: true }); | ||
assert_equals(decoder.decode(new Uint8Array([0x92])), "\uFFFD"); | ||
|
||
assert_equals(decoder.decode(new Uint8Array([0xF0, 0x9F]), { stream: true }), ""); | ||
assert_equals(decoder.decode(new Uint8Array([0x41]), { stream: true }), "\uFFFDA"); | ||
assert_equals(decoder.decode(), ""); | ||
|
||
assert_equals(decoder.decode(new Uint8Array([0xF0, 0x41, 0x42]), { stream: true }), "\uFFFDAB"); | ||
assert_equals(decoder.decode(), ""); | ||
|
||
assert_equals(decoder.decode(new Uint8Array([0xF0, 0x41, 0xF0]), { stream: true }), "\uFFFDA"); | ||
assert_equals(decoder.decode(), "\uFFFD"); | ||
|
||
assert_equals(decoder.decode(new Uint8Array([0xF0]), { stream: true }), ""); | ||
assert_equals(decoder.decode(new Uint8Array([0x8F]), { stream: true }), "\uFFFD\uFFFD"); | ||
assert_equals(decoder.decode(new Uint8Array([0x92]), { stream: true }), "\uFFFD"); | ||
assert_equals(decoder.decode(), ""); | ||
}, "TextDecoder end-of-queue handling using stream: true"); |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Function that sends an accesskey using the proper key combination depending on the browser and OS. | ||
* | ||
* This needs that the test imports the following scripts: | ||
* <script src="/resources/testdriver.js"></script> | ||
* <script src="/resources/testdriver-actions.js"></script> | ||
* <script src="/resources/testdriver-vendor.js"></script> | ||
*/ | ||
function pressAccessKey(accessKey){ | ||
let controlKey = '\uE009'; // left Control key | ||
let altKey = '\uE00A'; // left Alt key | ||
let optionKey = altKey; // left Option key | ||
let shiftKey = '\uE008'; // left Shift key | ||
// There are differences in using accesskey across browsers and OS's. | ||
// See: // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/accesskey | ||
let isMacOSX = navigator.userAgent.indexOf("Mac") != -1; | ||
let osAccessKey = isMacOSX ? [controlKey, optionKey] : [shiftKey, altKey]; | ||
let actions = new test_driver.Actions(); | ||
// Press keys. | ||
for (let key of osAccessKey) { | ||
actions = actions.keyDown(key); | ||
} | ||
actions = actions | ||
.keyDown(accessKey) | ||
.addTick() | ||
.keyUp(accessKey); | ||
osAccessKey.reverse(); | ||
for (let key of osAccessKey) { | ||
actions = actions.keyUp(key); | ||
} | ||
return actions.send(); | ||
} | ||
|
||
|
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,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>Blank Page</title> | ||
<script> | ||
window.onload = function(event) { | ||
// This is needed to ensure the onload event fires when this page is | ||
// opened as a popup. | ||
// See https://github.com/web-platform-tests/wpt/pull/18157 | ||
}; | ||
</script> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
Oops, something went wrong.