Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/LayoutTests/nfc/push.html

Issue 2524743002: [webnfc] Restrict NFC message size to 32KB (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698