Skip to content

Commit

Permalink
[WebNFC] Distinguish between NFC not available and not enabled
Browse files Browse the repository at this point in the history
Following spec change at w3c/web-nfc#237, this
CL allows web developers to distinguish when NFC is not available and
when it's disabled by user preference.

Bug: 520391
Change-Id: I3927d855edef1b1cf9b2036a0b4991745b962e04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1751948
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Rijubrata Bhaumik <rijubrata.bhaumik@intel.com>
Cr-Commit-Position: refs/heads/master@{#686762}
  • Loading branch information
beaufortfrancois authored and chromium-wpt-export-bot committed Aug 14, 2019
1 parent 0ca74f4 commit 33a1cca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web-nfc/nfc_hw_disabled-manual.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ <h2>Precondition</h2>
const readerWatcher = new EventWatcher(t, reader, ["reading", "error"]);
reader.start();
const event = await readerWatcher.wait_for("error");
assert_equals(event.error.name, 'NotReadableError');
assert_equals(event.error.name, 'NotSupportedError');
}, "NFCReader.start should fail if NFC HW is disabled.");

promise_test(t => {
const writer = new NFCWriter();
return promise_rejects(t, 'NotReadableError', writer.push(test_text_data));
return promise_rejects(t, 'NotSupportedError', writer.push(test_text_data));
}, "NFCWriter.push should fail when NFC HW is disabled.");

</script>

0 comments on commit 33a1cca

Please sign in to comment.