mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision 78f764c05c229883e87ad135c7153051a66e2851
This commit is contained in:
parent
55347aa39f
commit
bf84a079f9
1983 changed files with 58006 additions and 31437 deletions
|
@ -21,20 +21,18 @@
|
|||
|
||||
setup({ explicit_timeout: true });
|
||||
|
||||
promise_test(t => {
|
||||
return navigator.nfc.push(test_buffer_data)
|
||||
.then(() => {
|
||||
return new Promise(resolve => {
|
||||
navigator.nfc.watch(message => resolve(message))
|
||||
}).then((message) => {
|
||||
for (let record of message.records) {
|
||||
assert_equals(record.recordType, "opaque");
|
||||
assert_equals(record.mediaType, "application/octet-stream");
|
||||
assert_array_equals(new Uint8Array(record.data),
|
||||
new Uint8Array(test_buffer_data));
|
||||
}
|
||||
});
|
||||
});
|
||||
}, "Test that nfc.push succeeds when message is ArrayBuffer.");
|
||||
promise_test(async t => {
|
||||
const writer = new NFCWriter();
|
||||
const reader = new NFCReader();
|
||||
await writer.push(test_buffer_data);
|
||||
const readerWatcher = new EventWatcher(t, reader, ["reading", "error"]);
|
||||
reader.start();
|
||||
const event = await readerWatcher.wait_for("reading");
|
||||
for (let record of event.message.records) {
|
||||
assert_equals(record.recordType, "opaque");
|
||||
assert_equals(record.mediaType, "application/octet-stream");
|
||||
assert_array_equals(new Uint8Array(record.data), new Uint8Array(test_buffer_data));
|
||||
}
|
||||
}, "Test that NFCWriter.push succeeds when message is ArrayBuffer.");
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue