mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Update web-platform-tests to revision b'468d01bbd84da2babf265c6af46947be68713440'
This commit is contained in:
parent
35e95f55a1
commit
58e8ee674b
9438 changed files with 266112 additions and 106976 deletions
|
@ -15,34 +15,34 @@ test(function() {
|
|||
}, "Float64Array (too long)")
|
||||
}, "Float arrays")
|
||||
|
||||
var arrays = {
|
||||
'Int8Array': Int8Array,
|
||||
'Int16Array': Int16Array,
|
||||
'Int32Array': Int32Array,
|
||||
'Uint8Array': Uint8Array,
|
||||
'Uint8ClampedArray': Uint8ClampedArray,
|
||||
'Uint16Array': Uint16Array,
|
||||
'Uint32Array': Uint32Array,
|
||||
};
|
||||
const arrays = [
|
||||
'Int8Array',
|
||||
'Int16Array',
|
||||
'Int32Array',
|
||||
'BigInt64Array',
|
||||
'Uint8Array',
|
||||
'Uint8ClampedArray',
|
||||
'Uint16Array',
|
||||
'Uint32Array',
|
||||
'BigUint64Array',
|
||||
];
|
||||
|
||||
test(function() {
|
||||
for (var array in arrays) {
|
||||
assert_equals(self.crypto.getRandomValues(new arrays[array](8)).constructor,
|
||||
arrays[array], "crypto.getRandomValues(new " + array + "(8))")
|
||||
}
|
||||
}, "Integer array")
|
||||
for (const array of arrays) {
|
||||
const ctor = globalThis[array];
|
||||
|
||||
test(function() {
|
||||
for (var array in arrays) {
|
||||
var maxlength = 65536 / (arrays[array].BYTES_PER_ELEMENT);
|
||||
test(function() {
|
||||
assert_equals(self.crypto.getRandomValues(new ctor(8)).constructor,
|
||||
ctor, "crypto.getRandomValues(new " + array + "(8))")
|
||||
}, "Integer array: " + array);
|
||||
|
||||
test(function() {
|
||||
const maxlength = 65536 / ctor.BYTES_PER_ELEMENT;
|
||||
assert_throws_dom("QuotaExceededError", function() {
|
||||
self.crypto.getRandomValues(new arrays[array](maxlength + 1))
|
||||
self.crypto.getRandomValues(new ctor(maxlength + 1))
|
||||
}, "crypto.getRandomValues length over 65536")
|
||||
}
|
||||
}, "Large length")
|
||||
}, "Large length: " + array);
|
||||
|
||||
test(function() {
|
||||
for (var array in arrays) {
|
||||
assert_true(self.crypto.getRandomValues(new arrays[array](0)).length == 0)
|
||||
}
|
||||
}, "Null arrays")
|
||||
test(function() {
|
||||
assert_true(self.crypto.getRandomValues(new ctor(0)).length == 0)
|
||||
}, "Null arrays: " + array);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue