Bug 1573764 [wpt PR 18416] - [WebNFC] Distinguish between NFC not available and not enabled, a=testonly

Automatic update from web-platform-tests
[WebNFC] Distinguish between NFC not available and not enabled

Following spec change at https://github.com/w3c/web-nfc/issues/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}

--

wpt-commits: 33a1ccaeb68cb1c02498a320b94cf7fd20708869
wpt-pr: 18416
This commit is contained in:
François Beaufort 2019-08-15 14:23:26 +00:00 коммит произвёл moz-wptsync-bot
Родитель fc4bd40893
Коммит 1151316245
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -26,12 +26,12 @@ promise_test(async t => {
const readerWatcher = new EventWatcher(t, reader, ["reading", "error"]); const readerWatcher = new EventWatcher(t, reader, ["reading", "error"]);
reader.start(); reader.start();
const event = await readerWatcher.wait_for("error"); 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."); }, "NFCReader.start should fail if NFC HW is disabled.");
promise_test(t => { promise_test(t => {
const writer = new NFCWriter(); 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."); }, "NFCWriter.push should fail when NFC HW is disabled.");
</script> </script>