mirror of
https://github.com/servo/servo.git
synced 2025-08-30 01:28:21 +01:00
Update web-platform-tests to revision dc5cbf088edcdb266541d4e5a76149a2c6e716a0
This commit is contained in:
parent
1d40075f03
commit
079092dfea
2381 changed files with 90360 additions and 17722 deletions
|
@ -0,0 +1,79 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Verify the coversion of various types of BufferSource</title>
|
||||
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
|
||||
<link rel="help" href="http://w3c.github.io/IndexedDB/#key-construct">
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
let binary = new ArrayBuffer(0);
|
||||
let key = IDBKeyRange.lowerBound(binary).lower;
|
||||
|
||||
assert_true(key instanceof ArrayBuffer);
|
||||
assert_equals(key.byteLength, 0);
|
||||
assert_equals(key.byteLength, binary.byteLength);
|
||||
}, "Empty ArrayBuffer");
|
||||
|
||||
test(function() {
|
||||
let binary = new ArrayBuffer(4);
|
||||
let dataView = new DataView(binary);
|
||||
dataView.setUint32(0, 1234567890);
|
||||
|
||||
let key = IDBKeyRange.lowerBound(binary).lower;
|
||||
|
||||
assert_true(key instanceof ArrayBuffer);
|
||||
assert_equals(key.byteLength, 4);
|
||||
assert_equals(dataView.getUint32(0), new DataView(key).getUint32(0));
|
||||
}, "ArrayBuffer");
|
||||
|
||||
test(function() {
|
||||
let binary = new ArrayBuffer(4);
|
||||
let dataView = new DataView(binary);
|
||||
dataView.setUint32(0, 1234567890);
|
||||
|
||||
let key = IDBKeyRange.lowerBound(dataView).lower;
|
||||
|
||||
assert_true(key instanceof ArrayBuffer);
|
||||
assert_equals(key.byteLength, 4);
|
||||
assert_equals(dataView.getUint32(0), new DataView(key).getUint32(0));
|
||||
}, "DataView");
|
||||
|
||||
test(function() {
|
||||
let binary = new ArrayBuffer(4);
|
||||
let dataView = new DataView(binary);
|
||||
let int8Array = new Int8Array(binary);
|
||||
int8Array.set([16, -32, 64, -128]);
|
||||
|
||||
let key = IDBKeyRange.lowerBound(int8Array).lower;
|
||||
let keyInInt8Array = new Int8Array(key);
|
||||
|
||||
assert_true(key instanceof ArrayBuffer);
|
||||
assert_equals(key.byteLength, 4);
|
||||
for(let i = 0; i < int8Array.length; i++) {
|
||||
assert_equals(keyInInt8Array[i], int8Array[i]);
|
||||
}
|
||||
}, "TypedArray(Int8Array)");
|
||||
|
||||
test(function() {
|
||||
let binary = new ArrayBuffer(4);
|
||||
let dataView = new DataView(binary);
|
||||
let int8Array = new Int8Array(binary);
|
||||
int8Array.set([16, -32, 64, -128]);
|
||||
|
||||
let key = IDBKeyRange.lowerBound([int8Array]).lower;
|
||||
|
||||
assert_true(key instanceof Array);
|
||||
assert_true(key[0] instanceof ArrayBuffer);
|
||||
assert_equals(key[0].byteLength, 4);
|
||||
|
||||
let keyInInt8Array = new Int8Array(key[0]);
|
||||
|
||||
for(let i = 0; i < int8Array.length; i++) {
|
||||
assert_equals(keyInInt8Array[i], int8Array[i]);
|
||||
}
|
||||
}, "Array of TypedArray(Int8Array)");
|
||||
</script>
|
||||
|
||||
<div id=log></div>
|
27
tests/wpt/web-platform-tests/IndexedDB/idbfactory_cmp3.htm
Normal file
27
tests/wpt/web-platform-tests/IndexedDB/idbfactory_cmp3.htm
Normal file
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>IDBFactory.cmp() - compared keys in different types</title>
|
||||
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
|
||||
<link rel="help" href="http://w3c.github.io/IndexedDB/#key-construct">
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(indexedDB.cmp([0], new Uint8Array([0])), 1, "Array > Binary");
|
||||
}, "Array v.s. Binary");
|
||||
|
||||
test(function() {
|
||||
assert_equals(indexedDB.cmp(new Uint8Array([0]), "0"), 1, "Binary > String");
|
||||
}, "Binary v.s. String");
|
||||
|
||||
test(function() {
|
||||
assert_equals(indexedDB.cmp("", new Date(0)), 1, "String > Date");
|
||||
}, "String v.s. Date");
|
||||
|
||||
test(function() {
|
||||
assert_equals(indexedDB.cmp(new Date(0), 0), 1, "Date > Number");
|
||||
}, "Date v.s. Number");
|
||||
</script>
|
||||
|
||||
<div id=log></div>
|
40
tests/wpt/web-platform-tests/IndexedDB/idbfactory_cmp4.htm
Normal file
40
tests/wpt/web-platform-tests/IndexedDB/idbfactory_cmp4.htm
Normal file
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>IDBFactory.cmp() - comparison of binary keys</title>
|
||||
<link rel="author" title="Mozilla" href="https://www.mozilla.org">
|
||||
<link rel="help" href="http://w3c.github.io/IndexedDB/#key-construct">
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(indexedDB.cmp(new Int8Array([-1]), new Uint8Array([0])), 1,
|
||||
"255(-1) shall be larger than 0");
|
||||
}, "Compare in unsigned octet values (in the range [0, 255])");
|
||||
|
||||
test(function() {
|
||||
assert_equals(indexedDB.cmp(
|
||||
new Uint8Array([255, 254, 253]),
|
||||
new Uint8Array([255, 253, 254])),
|
||||
1,
|
||||
"[255, 254, 253] shall be larger than [255, 253, 254]");
|
||||
}, "Compare values in then same length");
|
||||
|
||||
test(function() {
|
||||
assert_equals(indexedDB.cmp(
|
||||
new Uint8Array([255, 254]),
|
||||
new Uint8Array([255, 253, 254])),
|
||||
1,
|
||||
"[255, 254] shall be larger than [255, 253, 254]");
|
||||
}, "Compare values in different lengths");
|
||||
|
||||
test(function() {
|
||||
assert_equals(indexedDB.cmp(
|
||||
new Uint8Array([255, 253, 254]),
|
||||
new Uint8Array([255, 253])),
|
||||
1,
|
||||
"[255, 253, 254] shall be larger than [255, 253]");
|
||||
}, "Compare when the values in the range of their minimal length are the same");
|
||||
</script>
|
||||
|
||||
<div id=log></div>
|
|
@ -83,6 +83,7 @@ interface IDBDatabase : EventTarget {
|
|||
IDBTransaction transaction ((DOMString or sequence<DOMString>) storeNames, optional IDBTransactionMode mode = "readonly");
|
||||
void close ();
|
||||
attribute EventHandler onabort;
|
||||
attribute EventHandler onclose;
|
||||
attribute EventHandler onerror;
|
||||
attribute EventHandler onversionchange;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue