mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision 0cde5f6b37c9b3e3f9153eb1b172680e9aea9bf9
This commit is contained in:
parent
f142b1d1c7
commit
2575230dce
60 changed files with 924 additions and 268 deletions
|
@ -0,0 +1,45 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Web NFC Test: NFCWriter signal test</title>
|
||||
<link rel="author" title="Intel" href="http://www.intel.com"/>
|
||||
<link rel="help" href="https://w3c.github.io/web-nfc/"/>
|
||||
<meta name="timeout" content="long">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="resources/nfc_help.js"></script>
|
||||
<meta name="flags" content="interact">
|
||||
|
||||
<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(async t => {
|
||||
const writer = new NFCWriter();
|
||||
const reader = new NFCReader();
|
||||
const controller = new AbortController();
|
||||
|
||||
const p1 = writer.push(test_text_data, { signal: controller.signal });
|
||||
const p2 = writer.push(test_text_data);
|
||||
|
||||
// Even though push request is grantable, this abort should be processed synchronously.
|
||||
controller.abort();
|
||||
await promise_rejects(t, 'AbortError', p1);
|
||||
await p2;
|
||||
|
||||
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.data, test_text_data);
|
||||
}
|
||||
}, "Synchronously signaled abort.");
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue