OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../resources/testharness.js"></script> | 2 <script src="../resources/testharness.js"></script> |
3 <script src="../resources/testharnessreport.js"></script> | 3 <script src="../resources/testharnessreport.js"></script> |
4 <script src="../resources/mojo-helpers.js"></script> | 4 <script src="../resources/mojo-helpers.js"></script> |
5 <script src="resources/nfc-helpers.js"></script> | 5 <script src="resources/nfc-helpers.js"></script> |
6 <script> | 6 <script> |
7 | 7 |
8 'use strict'; | 8 'use strict'; |
9 | 9 |
10 const invalid_messages = | 10 const invalid_messages = |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 .then(() => { navigator.nfc.cancelPush }); | 143 .then(() => { navigator.nfc.cancelPush }); |
144 }, 'nfc.cancelPush should succeed if there is pending push operation.'); | 144 }, 'nfc.cancelPush should succeed if there is pending push operation.'); |
145 | 145 |
146 nfc_test(nfc => { | 146 nfc_test(nfc => { |
147 nfc.mockNFC.setPendingPushCompleted(false); | 147 nfc.mockNFC.setPendingPushCompleted(false); |
148 let promise = navigator.nfc.push(test_text_data, { timeout: 100 }); | 148 let promise = navigator.nfc.push(test_text_data, { timeout: 100 }); |
149 navigator.nfc.cancelPush(); | 149 navigator.nfc.cancelPush(); |
150 return assertRejectsWithError(promise, 'AbortError'); | 150 return assertRejectsWithError(promise, 'AbortError'); |
151 }, 'nfc.cancelPush should reject pending promise with AbortError.') | 151 }, 'nfc.cancelPush should reject pending promise with AbortError.') |
152 | 152 |
| 153 nfc_test(nfc => { |
| 154 return assertRejectsWithError( |
| 155 navigator.nfc.push(new ArrayBuffer(32 * 1024 + 1)), |
| 156 'NotSupportedError'); |
| 157 }, 'Reject promise with NotSupportedError if NFC message size exceeds 32KB.'); |
| 158 |
153 </script> | 159 </script> |
OLD | NEW |