зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1534027 [wpt PR 15695] - Update web-nfc nfc_hw_disabled-manual.https.html, a=testonly
Automatic update from web-platform-tests Update web-nfc nfc_hw_disabled-manual.https.html (#15695) -- wpt-commits: 2df046f3c0a859777b811cfbbe321c3547b7db4b wpt-pr: 15695
This commit is contained in:
Родитель
daf7f89b05
Коммит
69410a9865
|
@ -11,7 +11,7 @@
|
|||
<h2>Precondition</h2>
|
||||
<ol>
|
||||
<li>
|
||||
Disable the NFC Module.
|
||||
Disable the NFC module or run test on a device without NFC module.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
|
@ -21,12 +21,17 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
promise_test(t => {
|
||||
return promise_rejects(t, 'NotSupportedError', navigator.nfc.watch(noop));
|
||||
}, "Test that nfc.watch fails if NFC HW is disabled.");
|
||||
promise_test(async t => {
|
||||
const reader = new NFCReader();
|
||||
const readerWatcher = new EventWatcher(t, reader, ["reading", "error"]);
|
||||
reader.start();
|
||||
const event = await readerWatcher.wait_for("error");
|
||||
assert_equals(event.error.name, 'NotReadableError');
|
||||
}, "NFCReader.start should fail if NFC HW is disabled.");
|
||||
|
||||
promise_test(t => {
|
||||
return promise_rejects(t, 'NotSupportedError', navigator.nfc.push(test_text_data));
|
||||
}, "nfc.push should fail when NFC HW is disabled.");
|
||||
const writer = new NFCWriter();
|
||||
return promise_rejects(t, 'NotReadableError', writer.push(test_text_data));
|
||||
}, "NFCWriter.push should fail when NFC HW is disabled.");
|
||||
|
||||
</script>
|
||||
|
|
Загрузка…
Ссылка в новой задаче