diff --git a/testing/web-platform/tests/web-nfc/NDEFRecord_constructor.https.html b/testing/web-platform/tests/web-nfc/NDEFRecord_constructor.https.html index c62ea7b0d620..2da7ca91078a 100644 --- a/testing/web-platform/tests/web-nfc/NDEFRecord_constructor.https.html +++ b/testing/web-platform/tests/web-nfc/NDEFRecord_constructor.https.html @@ -13,9 +13,14 @@ test(() => { assert_throws(new TypeError, () => new NDEFRecord(null), - 'The record has neither type nor data.'); + 'NDEFRecordInit#recordType is a required field.'); }, 'NDEFRecord constructor with null init dict'); + test(() => { + assert_throws(new TypeError, () => new NDEFRecord({id: test_record_id, data: test_text_data}), + 'NDEFRecordInit#recordType is a required field.'); + }, 'NDEFRecord constructor without NDEFRecordInit#recordType field'); + test(() => { assert_throws(new TypeError, () => new NDEFRecord( createRecord('empty', test_text_data, test_record_id)), diff --git a/testing/web-platform/tests/web-nfc/NDEFWriter_push.https.html b/testing/web-platform/tests/web-nfc/NDEFWriter_push.https.html index 1bdbf0bb50b3..4ff0af8fb0b3 100644 --- a/testing/web-platform/tests/web-nfc/NDEFWriter_push.https.html +++ b/testing/web-platform/tests/web-nfc/NDEFWriter_push.https.html @@ -386,20 +386,6 @@ nfc_test(async (t, mockNFC) => { }); }, "NDEFWriter.push should replace all previously configured push operations."); -nfc_test(async (t, mockNFC) => { - const writer = new NDEFWriter(); - await writer.push({ records: [{ data: test_text_data}] }); - assertNDEFMessagesEqual(test_text_data, mockNFC.pushedMessage()); -}, "Test that recordType should be set to 'text' if NDEFRecordInit.record's \ -recordType is undefined and NDEFRecordInit.record's data is DOMString."); - -nfc_test(async (t, mockNFC) => { - const writer = new NDEFWriter(); - await writer.push({ records: [{ data: test_buffer_data}] }); - assertNDEFMessagesEqual(test_buffer_data, mockNFC.pushedMessage()); -}, "Test that recordType should be set to 'mime' if NDEFRecordInit.record's \ -recordType is undefined and NDEFRecordInit.record's data is not DOMString."); - nfc_test(async (t, mockNFC) => { const writer = new NDEFWriter(); await writer.push({ records: [{ recordType: "mime", data: test_buffer_data }] });