servo/tests/wpt/web-platform-tests/web-nfc
2019-11-17 14:10:26 +00:00
..
resources Update web-platform-tests to revision 89aa3f42131cce5a77268ddaeb2fab8a2e29c2a6 2019-11-17 14:10:26 +00:00
idlharness.https.window.js Update web-platform-tests to revision eaf583ff9cfe4ce36b517ae3519e114948ba10c3 2019-11-11 13:36:10 +00:00
META.yml Update web-platform-tests to revision d8b8e0b8efe993a37404d6c6fc75e16fdc16b7d8 2018-10-25 23:09:38 -04:00
NDEFErrorEvent_constructor.https.html Update web-platform-tests to revision a3dd2ad02c65588ad280ceac378d82e9250d1045 2019-10-23 14:17:29 +00:00
NDEFMessage_constructor.https.html Update web-platform-tests to revision eaf583ff9cfe4ce36b517ae3519e114948ba10c3 2019-11-11 13:36:10 +00:00
NDEFReader-document-hidden-manual.https.html Update web-platform-tests to revision a3dd2ad02c65588ad280ceac378d82e9250d1045 2019-10-23 14:17:29 +00:00
NDEFReader_options.https.html Update web-platform-tests to revision eaf583ff9cfe4ce36b517ae3519e114948ba10c3 2019-11-11 13:36:10 +00:00
NDEFReader_scan.https.html Update web-platform-tests to revision eaf583ff9cfe4ce36b517ae3519e114948ba10c3 2019-11-11 13:36:10 +00:00
NDEFReader_scan_iframe.https.html Update web-platform-tests to revision a3dd2ad02c65588ad280ceac378d82e9250d1045 2019-10-23 14:17:29 +00:00
NDEFReadingEvent_constructor.https.html Update web-platform-tests to revision 70fdd27f4cecb8a5cae3dafa76ba05265531c9e2 2019-11-10 14:14:47 +00:00
NDEFRecord_constructor.https.html Update web-platform-tests to revision eaf583ff9cfe4ce36b517ae3519e114948ba10c3 2019-11-11 13:36:10 +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 89aa3f42131cce5a77268ddaeb2fab8a2e29c2a6 2019-11-17 14:10:26 +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 89aa3f42131cce5a77268ddaeb2fab8a2e29c2a6 2019-11-17 14:10:26 +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`.
    setIsNDEFTech(boolean isNDEF); // Sets if the NFC device exposes 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.