mirror of
https://github.com/servo/servo.git
synced 2025-08-09 23:45:35 +01:00
Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326
This commit is contained in:
parent
462c272380
commit
1f531f66ea
5377 changed files with 174916 additions and 84369 deletions
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Web NFC Test: push ArrayBuffer message</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com"/>
|
||||
<link rel="help" href="https://w3c.github.io/web-nfc/"/>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/nfc_help.js"></script>
|
||||
<meta name="flags" content="interact">
|
||||
<meta name="timeout" content="long">
|
||||
|
||||
<p>Tap an NFC tag to the test device with NFC support.</p>
|
||||
|
||||
<p>Note: All the actions need to be done in 60 seconds, otherwise it will get TIMEOUT.</p>
|
||||
|
||||
<div id="log"></div>
|
||||
|
||||
<script>
|
||||
|
||||
"use strict";
|
||||
|
||||
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.");
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue