mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
Update web-platform-tests to revision 51b8e0940e87eda1f843a48d847d653b9a22c8c4
This commit is contained in:
parent
ea8aed1ba9
commit
a7b57c1cbf
53 changed files with 1764 additions and 337 deletions
|
@ -26,6 +26,10 @@ function toMojoNDEFRecord(record) {
|
|||
nfcRecord.recordType = record.recordType;
|
||||
nfcRecord.mediaType = record.mediaType;
|
||||
nfcRecord.id = record.id;
|
||||
if (record.recordType == 'text') {
|
||||
nfcRecord.encoding = record.encoding == null? 'utf-8': record.encoding;
|
||||
nfcRecord.lang = record.lang == null? 'en': record.lang;
|
||||
}
|
||||
nfcRecord.data = toByteArray(record.data);
|
||||
if (record.data != null && record.data.records !== undefined) {
|
||||
// |record.data| may be an NDEFMessageInit, i.e. the payload is a message.
|
||||
|
@ -72,6 +76,17 @@ function compareNDEFRecords(providedRecord, receivedRecord) {
|
|||
|
||||
assert_not_equals(providedRecord.recordType, 'empty');
|
||||
|
||||
if (providedRecord.recordType == 'text') {
|
||||
assert_equals(
|
||||
providedRecord.encoding == null? 'utf-8': providedRecord.encoding,
|
||||
receivedRecord.encoding);
|
||||
assert_equals(providedRecord.lang == null? 'en': providedRecord.lang,
|
||||
receivedRecord.lang);
|
||||
} else {
|
||||
assert_equals(null, receivedRecord.encoding);
|
||||
assert_equals(null, receivedRecord.lang);
|
||||
}
|
||||
|
||||
assert_array_equals(toByteArray(providedRecord.data),
|
||||
new Uint8Array(receivedRecord.data));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue