servo/tests/wpt/web-platform-tests/web-nfc
2019-12-20 11:10:50 +00:00
..
resources Update web-platform-tests to revision fa41b43ac93bc2fdc2427a4378dc3754d483cdda 2019-12-10 11:06:32 +00:00
idlharness.https.window.js Update web-platform-tests to revision fa41b43ac93bc2fdc2427a4378dc3754d483cdda 2019-12-10 11:06:32 +00:00
META.yml Update web-platform-tests to revision d8b8e0b8efe993a37404d6c6fc75e16fdc16b7d8 2018-10-25 23:09:38 -04:00
NDEFMessage_constructor.https.html Update web-platform-tests to revision fa41b43ac93bc2fdc2427a4378dc3754d483cdda 2019-12-10 11:06:32 +00:00
NDEFReader-document-hidden-manual.https.html Update web-platform-tests to revision f0cb9071aea5ce5b641fcba5f362a0796bdc70bc 2019-11-23 13:39:46 +00:00
NDEFReader_scan.https.html Update web-platform-tests to revision 256b4685b8e702c14ed854347f23f4979edbfc8e 2019-12-20 11:10:50 +00:00
NDEFReader_scan_filter.https.html Update web-platform-tests to revision fa41b43ac93bc2fdc2427a4378dc3754d483cdda 2019-12-10 11:06:32 +00:00
NDEFReader_scan_iframe.https.html Update web-platform-tests to revision f0cb9071aea5ce5b641fcba5f362a0796bdc70bc 2019-11-23 13:39:46 +00:00
NDEFReadingEvent_constructor.https.html Update web-platform-tests to revision fa41b43ac93bc2fdc2427a4378dc3754d483cdda 2019-12-10 11:06:32 +00:00
NDEFRecord_constructor.https.html Update web-platform-tests to revision 1268bd5901289acc95b1a576f108bdf382d82e44 2019-12-19 10:58:13 +00:00
NDEFWriter-document-hidden-manual.https.html Update web-platform-tests to revision a3dd2ad02c65588ad280ceac378d82e9250d1045 2019-10-23 14:17:29 +00:00
NDEFWriter_push.https.html Update web-platform-tests to revision 256b4685b8e702c14ed854347f23f4979edbfc8e 2019-12-20 11:10:50 +00:00
nfc_insecure_context.html Update web-platform-tests to revision a3dd2ad02c65588ad280ceac378d82e9250d1045 2019-10-23 14:17:29 +00:00
README.md Update web-platform-tests to revision 256b4685b8e702c14ed854347f23f4979edbfc8e 2019-12-20 11:10:50 +00:00

The nfc-helpers.js requires an implementation of the WebNFCTest interfaces, which should emulate platform Web NFC backends.

The WebNFCTest interface is defined as:

  class NFCTestChromium {
    initialize();  // Sets up the testing environment.
    async reset(); // Frees the resources.
    getMockNFC(); // Returns `MockNFC` interface.
  };

  class MockNFC {
    setHWStatus(number status); // Sets the hardware status.
    setReadingMessage(NDEFMessageInit message); // Sets message that is used to deliver NFC reading updates.
    setPendingPushCompleted(boolean result); // Sets if the pending push is completed.
    pushedMessage(); // Gets the pushed `NDEFMessageSource`.
    pushOptions(); // Gets the pushed `NDEFPushOptions`.
    simulateNonNDEFTagDiscovered(); // Simulates that the NFC device discovered does not expose NDEF technology.
    setIsFormattedTag(boolean isFormatted); // Sets if the NFC tag has formatted NDEF message.
  };

The Chromium implementation of the WebNFCTest interface is located in nfc-mock.js.

Other browser vendors should provide their own implementations of the WebNFCTest interfaces.