tree: 16b1870d6264b98f79d2133d0f0d3db5baad68ab [path history] [tgz]
  1. resources/
  2. idlharness.https.window-expected.txt
  3. idlharness.https.window.js
  4. META.yml
  5. NDEFMessage_constructor.https-expected.txt
  6. NDEFMessage_constructor.https.html
  7. NDEFRecord_constructor.https.html
  8. nfc_insecure_context.html
  9. NFCErrorEvent_constructor.https.html
  10. NFCReader-document-hidden-manual.https-expected.txt
  11. NFCReader-document-hidden-manual.https.html
  12. NFCReader_options.https.html
  13. NFCReader_scan.https.html
  14. NFCReader_scan_iframe.https.html
  15. NFCReadingEvent_constructor.https.html
  16. NFCWriter-document-hidden-manual.https-expected.txt
  17. NFCWriter-document-hidden-manual.https.html
  18. NFCWriter_push.https-expected.txt
  19. NFCWriter_push.https.html
  20. OWNERS
  21. README.md
third_party/blink/web_tests/external/wpt/web-nfc/README.md

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.
    setPushShouldTimeout(boolean result); // Sets flag to trigger the pending push to timeout.
    pushedMessage(); // Gets the pushed `NDEFMessageSource`.
    pushOptions(); // Gets the pushed `NFCPushOptions`.
  };

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.