mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision 3f3849c5d05f9350fad0b06d3bb3ae30d7e18d14
This commit is contained in:
parent
9a7e2663e8
commit
f767403c00
310 changed files with 8134 additions and 895 deletions
|
@ -6,6 +6,7 @@ const test_number_data = 42;
|
|||
const test_json_data = {level: 1, score: 100, label: 'Game'};
|
||||
const test_url_data = "https://w3c.github.io/web-nfc";
|
||||
const test_buffer_data = new ArrayBuffer(test_text_byte_array.length);
|
||||
const test_buffer_view = new Uint8Array(test_buffer_data).set(test_text_byte_array);
|
||||
|
||||
function noop() {};
|
||||
|
||||
|
@ -55,14 +56,14 @@ function assertWebNDEFMessagesEqual(a, b) {
|
|||
let recordB = b.records[i];
|
||||
assert_equals(recordA.recordType, recordB.recordType);
|
||||
assert_equals(recordA.mediaType, recordB.mediaType);
|
||||
if (recordA.data instanceof ArrayBuffer) {
|
||||
assert_array_equals(new Uint8Array(recordA.data),
|
||||
new Uint8Array(recordB.data));
|
||||
} else if (typeof recordA.data === 'object') {
|
||||
assert_object_equals(recordA.data, recordB.data);
|
||||
} else if (typeof recordA.data === 'number'
|
||||
|| typeof recordA.data === 'string') {
|
||||
assert_true(recordA.data == recordB.data);
|
||||
if (recordA.data() instanceof ArrayBuffer) {
|
||||
assert_array_equals(new Uint8Array(recordA.data()),
|
||||
new Uint8Array(recordB.data()));
|
||||
} else if (typeof recordA.data() === 'object') {
|
||||
assert_object_equals(recordA.data(), recordB.data());
|
||||
} else if (typeof recordA.data() === 'number'
|
||||
|| typeof recordA.data() === 'string') {
|
||||
assert_true(recordA.data() == recordB.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue