Re: [web-nfc] Fix #592: scan rejects prior scan (#611)

To be clear, here are [web platform tests](https://github.com/web-platform-tests/wpt/blob/master/web-nfc/NDEFReader_scan.https.html) for this issue:

```js

nfc_test(async (t, mockNFC) => {
  const ndef = new NDEFReader();
  const promise1 = ndef.scan();
  const promise2 = promise_rejects_dom(t, 'InvalidStateError', ndef.scan());
  await promise1;
  await promise2;
}, "Test that NDEFReader.scan rejects if there is already an ongoing scan.");

nfc_test(async (t, mockNFC) => {
  const ndef = new NDEFReader();
  const controller = new AbortController();
  await ndef.scan({signal : controller.signal});
  controller.abort();
  await ndef.scan();
}, "Test that NDEFReader.scan can be started after the previous scan is aborted.");
```

-- 
GitHub Notification of comment by beaufortfrancois
Please view or discuss this issue at https://github.com/w3c/web-nfc/pull/611#issuecomment-740626574 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 8 December 2020 13:42:41 UTC