Closed Bug 1607139 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 21047 - [webnfc] Support writing embedded records

Categories

(Core :: DOM: Device Interfaces, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 21047 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/21047
Details from upstream follow.

Leon Han <leon.han@intel.com> wrote:

[webnfc] Support writing embedded records

This CL enables WebDevs to provide an NDEFMessageInit dictionary as
NDEFRecordInit#data, to create a ndef record whose payload is a ndef
message (thus we get embedded records), then serializes the payload ndef
message to bytes as payload when writing the record into a nfc tag.

The spec change:
https://github.com/w3c/web-nfc/pull/359

BUG=520391

Change-Id: I4120092d7a818d047f7e1d30ce891a8a84180b48

Reviewed-on: https://chromium-review.googlesource.com/1983512
WPT-Export-Revision: d11a93fc36c2aa08cbf7d0eac97f10ec521e9434

Component: web-platform-tests → DOM: Device Interfaces
Product: Testing → Core

CI Results

Ran 13 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 41 tests

Status Summary

Firefox

OK : 2
PASS: 39
FAIL: 51

Chrome

OK : 2
PASS: 24
FAIL: 27

Safari

OK : 2
FAIL: 51

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/web-nfc/NDEFRecord_constructor.https.html
NDEFRecord constructor without NDEFRecordInit#recordType field: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFRecord constructor with absolute-url record type: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with text record type and arrayBuffer data: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with empty record type and id: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with invalid external record type: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFRecord constructor should only accept mediaType for mime record type: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with external record type: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFRecord constructor with custom record ids: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with url record type: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor without init dict: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with record type string being treated as case sensitive: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with mime record type and json data: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with empty record type: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with mime record type and stream data: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with text record type and custom document language: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with unknown record type: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with text record type and string data: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with text record type, encoding, and lang: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with text record type and arrayBufferView data: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with null init dict: FAIL (Chrome: PASS, Safari: FAIL)
/web-nfc/NDEFWriter_push.https.html
Check that default NDEFPushOptions values are correctly set.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail if user permission is not granted.: FAIL (Chrome: PASS, Safari: FAIL)
Test that NDEFWriter.push succeeds when message is ArrayBuffer.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that recordType should be set to 'text' if NDEFRecordInit.record's recordType is undefined and NDEFRecordInit.record's data is DOMString.: FAIL
NDEFWriter.push should fail with NetworkError when NFC data transfer fails.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that NDEFWriter.push succeeds when message is DOMString.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that promise is rejected with TypeError if NDEFMessageSource is invalid.: FAIL (Chrome: PASS, Safari: FAIL)
NDEFWriter.push should replace all previously configured push operations.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should succeed when NFC HW is enabled: FAIL (Chrome: FAIL, Safari: FAIL)
Test that recordType should be set to 'mime' if NDEFRecordInit.record's recordType is undefined and NDEFRecordInit.record's data is not DOMString.: FAIL
NDEFWriter.push should fail when NFC HW is not supported.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail when NFC HW is disabled.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push NDEFMessage containing text, mime, unknown, url, absolute-url and external records with default NDEFPushOptions.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail if signal is not an AbortSignal.: FAIL (Chrome: PASS, Safari: FAIL)
NDEFWriter.push should fail if abort push request before push happends.: FAIL (Chrome: FAIL, Safari: FAIL)
Synchronously signaled abort.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail when there are NDEF records on the NFC device and NDEFPushOptions.overwrite is false.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should succeed to push data to an unformatted NFC device when the NDEFPushOptions.overwrite is false.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that mediaType should be set to 'application/octet-stream' if NDEFRecordInit.record's recordType is 'mime' and NDEFRecordInit.record's mediaType is undefined.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that promise is rejected with SyntaxError if NDEFMessageSource contains invalid records.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should ignore reading data when ignoreRead is true.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that WebNFC API is not accessible from iframe context.: FAIL (Chrome: PASS, Safari: FAIL)
Test that NDEFWriter.push succeeds when message is ArrayBufferView.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should read data when ignoreRead is false.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail with TypeError when invalid target value is provided.: FAIL (Chrome: PASS, Safari: FAIL)
NDEFWriter.push should fail if signal's aborted flag is set.: FAIL (Chrome: PASS, Safari: FAIL)
NDEFWriter.push should fail when the NFC device coming up does not expose NDEF technology.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should succeed to overwrite the existing data when the NDEFPushOptions.overwrite is true.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail if no implementation for NFC Mojo interface is available.: FAIL (Chrome: FAIL, Safari: FAIL)
Reject promise with NotSupportedError if NFC message size exceeds 32KB.: FAIL (Chrome: PASS, Safari: FAIL)
Check that provided NDEFPushOptions values are correctly converted.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push with 'empty' record should succeed.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push NDEFMessage containing embedded records.: FAIL (Chrome: FAIL, Safari: FAIL)

CI Results

Ran 13 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 41 tests

Status Summary

Firefox

OK : 2
PASS: 39
FAIL: 51

Chrome

OK : 2
PASS: 24
FAIL: 27

Safari

OK : 2
FAIL: 51

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/web-nfc/NDEFRecord_constructor.https.html
NDEFRecord constructor without NDEFRecordInit#recordType field: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFRecord constructor with absolute-url record type: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with text record type and arrayBuffer data: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with empty record type and id: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with invalid external record type: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFRecord constructor should only accept mediaType for mime record type: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with external record type: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFRecord constructor with custom record ids: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with url record type: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor without init dict: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with record type string being treated as case sensitive: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with mime record type and json data: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with empty record type: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with mime record type and stream data: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with text record type and custom document language: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with unknown record type: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with text record type and string data: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with text record type, encoding, and lang: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with text record type and arrayBufferView data: FAIL (Chrome: PASS, Safari: FAIL)
NDEFRecord constructor with null init dict: FAIL (Chrome: PASS, Safari: FAIL)
/web-nfc/NDEFWriter_push.https.html
Check that default NDEFPushOptions values are correctly set.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail if user permission is not granted.: FAIL (Chrome: PASS, Safari: FAIL)
Test that NDEFWriter.push succeeds when message is ArrayBuffer.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that recordType should be set to 'text' if NDEFRecordInit.record's recordType is undefined and NDEFRecordInit.record's data is DOMString.: FAIL
NDEFWriter.push should fail with NetworkError when NFC data transfer fails.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that NDEFWriter.push succeeds when message is DOMString.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that promise is rejected with TypeError if NDEFMessageSource is invalid.: FAIL (Chrome: PASS, Safari: FAIL)
NDEFWriter.push should replace all previously configured push operations.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should succeed when NFC HW is enabled: FAIL (Chrome: FAIL, Safari: FAIL)
Test that recordType should be set to 'mime' if NDEFRecordInit.record's recordType is undefined and NDEFRecordInit.record's data is not DOMString.: FAIL
NDEFWriter.push should fail when NFC HW is not supported.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail when NFC HW is disabled.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push NDEFMessage containing text, mime, unknown, url, absolute-url and external records with default NDEFPushOptions.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail if signal is not an AbortSignal.: FAIL (Chrome: PASS, Safari: FAIL)
NDEFWriter.push should fail if abort push request before push happends.: FAIL (Chrome: FAIL, Safari: FAIL)
Synchronously signaled abort.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail when there are NDEF records on the NFC device and NDEFPushOptions.overwrite is false.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should succeed to push data to an unformatted NFC device when the NDEFPushOptions.overwrite is false.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that mediaType should be set to 'application/octet-stream' if NDEFRecordInit.record's recordType is 'mime' and NDEFRecordInit.record's mediaType is undefined.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that promise is rejected with SyntaxError if NDEFMessageSource contains invalid records.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should ignore reading data when ignoreRead is true.: FAIL (Chrome: FAIL, Safari: FAIL)
Test that WebNFC API is not accessible from iframe context.: FAIL (Chrome: PASS, Safari: FAIL)
Test that NDEFWriter.push succeeds when message is ArrayBufferView.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should read data when ignoreRead is false.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail with TypeError when invalid target value is provided.: FAIL (Chrome: PASS, Safari: FAIL)
NDEFWriter.push should fail if signal's aborted flag is set.: FAIL (Chrome: PASS, Safari: FAIL)
NDEFWriter.push should fail when the NFC device coming up does not expose NDEF technology.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should succeed to overwrite the existing data when the NDEFPushOptions.overwrite is true.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push should fail if no implementation for NFC Mojo interface is available.: FAIL (Chrome: FAIL, Safari: FAIL)
Reject promise with NotSupportedError if NFC message size exceeds 32KB.: FAIL (Chrome: PASS, Safari: FAIL)
Check that provided NDEFPushOptions values are correctly converted.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push with 'empty' record should succeed.: FAIL (Chrome: FAIL, Safari: FAIL)
NDEFWriter.push NDEFMessage containing embedded records.: FAIL (Chrome: FAIL, Safari: FAIL)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2db59668acf8
[wpt PR 21047] - [webnfc] Support writing embedded records, a=testonly
https://hg.mozilla.org/integration/autoland/rev/b19c7c6d003c
[wpt PR 21047] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.