servo/tests/wpt/web-platform-tests/web-nfc
2023-02-25 01:52:07 +00:00
..
resources Update web-platform-tests to revision b'c9f81de4242294a0d694ecd5a63155acfe6bf49a' 2023-02-25 01:52:07 +00:00
idlharness.https.window.js Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4' 2022-01-20 20:57:54 +09:00
META.yml Update web-platform-tests to revision d8b8e0b8efe993a37404d6c6fc75e16fdc16b7d8 2018-10-25 23:09:38 -04:00
NDEFMessage_constructor.https.window.js Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4' 2022-01-20 20:57:54 +09:00
NDEFMessage_recursion-limit.https.window.js Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4' 2022-01-20 20:57:54 +09:00
NDEFReader-make-read-only-document-hidden-manual.https.html Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4' 2022-01-20 20:57:54 +09:00
NDEFReader-read-document-hidden-manual.https.html Update web-platform-tests to revision 77f3f1533681dedef98a4c94c2abdb562d097002 2020-12-01 11:03:24 +00:00
NDEFReader-write-document-hidden-manual.https.html Update web-platform-tests to revision 77f3f1533681dedef98a4c94c2abdb562d097002 2020-12-01 11:03:24 +00:00
NDEFReader_make-read-only.https.window.js Update web-platform-tests to revision b'4a4653e088039aec186d6dc1d488120d77695c3a' 2022-12-11 01:19:52 +00:00
NDEFReader_scan.https.html Update web-platform-tests to revision b'4a4653e088039aec186d6dc1d488120d77695c3a' 2022-12-11 01:19:52 +00:00
NDEFReader_scan_iframe.https.html Update web-platform-tests to revision 77f3f1533681dedef98a4c94c2abdb562d097002 2020-12-01 11:03:24 +00:00
NDEFReader_write.https.html Update web-platform-tests to revision b'4a4653e088039aec186d6dc1d488120d77695c3a' 2022-12-11 01:19:52 +00:00
NDEFReadingEvent_constructor.https.window.js Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4' 2022-01-20 20:57:54 +09:00
NDEFRecord_constructor.https.window.js Update web-platform-tests to revision b'b728032f59a396243864b0f8584e7211e3632005' 2022-11-10 01:27:28 +00:00
nfc-prompt-manual.https.html Update web-platform-tests to revision 289878db3e356829bb7ae5699dd847f04a7acf58 2021-01-08 10:34:49 +00:00
nfc_insecure_context.html Update web-platform-tests to revision 77f3f1533681dedef98a4c94c2abdb562d097002 2020-12-01 11:03:24 +00:00
nfc_permission.https.window.js Update web-platform-tests to revision b'4a4653e088039aec186d6dc1d488120d77695c3a' 2022-12-11 01:19:52 +00:00
README.md Update web-platform-tests to revision b'ee6da9d71d0268d7fdb04e8e5b26858f46ee0cc4' 2022-01-20 20:57:54 +09: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.
    setPendingMakeReadOnlyCompleted(boolean result); // Sets if the pending makeReadOnly is completed.
    pushedMessage(); // Gets the pushed `NDEFMessageSource`.
    writeOptions(); // Gets the pushed `NDEFWriteOptions`.
    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.