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

Unified Diff: third_party/WebKit/LayoutTests/nfc/push.html

Issue 2836063004: [webnfc] Nfc.push method must reject promise with TypeError (Closed)
Patch Set: Created 3 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/nfc/NFC.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/nfc/push.html
diff --git a/third_party/WebKit/LayoutTests/nfc/push.html b/third_party/WebKit/LayoutTests/nfc/push.html
index 44301eedee11b2df9cfedee5e5a13112eab41fb6..59c95a1bb40357900143af388ff7e80a132f0512 100644
--- a/third_party/WebKit/LayoutTests/nfc/push.html
+++ b/third_party/WebKit/LayoutTests/nfc/push.html
@@ -9,6 +9,9 @@
const invalid_messages =
[
+ // Invalid NFCPushMessage type
+ undefined,
+
// NFCMessage.data: should have at least 1 valid record.
// https://w3c.github.io/web-nfc/#the-push-method - Step 8.
createMessage([{}]),
@@ -56,18 +59,13 @@ const invalid_messages =
];
nfc_test(nfc => {
- return assertRejectsWithError(navigator.nfc.push(undefined),
- 'TypeMismatchError');
-}, 'Test that passing undefined to nfc.push would raise TypeMismatchError.');
-
-nfc_test(nfc => {
let promises = [];
invalid_messages.forEach(message => {
promises.push(
- assertRejectsWithError(navigator.nfc.push(message), 'SyntaxError'));
+ assertRejectsWithError(navigator.nfc.push(message), 'TypeError'));
});
return Promise.all(promises)
-}, 'Test that promise is rejected with SyntaxError if NFCMessage is invalid.');
+}, 'Test that promise is rejected with TypeError if NFCMessage is invalid.');
nfc_test(nfc => {
nfc.mockNFC.setHWStatus(NFCHWStatus.DISABLED);
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/nfc/NFC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698