Files
tubestation/testing/web-platform/tests/web-nfc/idlharness.https.window.js
Stephen McGruer 531b6c9d0b Bug 1678598 [wpt PR 26590] - Update interfaces/web-nfc.idl and test, a=testonly
Automatic update from web-platform-tests
Update interfaces/web-nfc.idl and test (#26590)

Closes https://github.com/web-platform-tests/wpt/pull/26589
--

wpt-commits: fa166854c39cfab7f1709a1ef3a1b0bb2003d6d9
wpt-pr: 26590
2020-11-30 20:05:44 +00:00

31 lines
700 B
JavaScript

// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
// META: timeout=long
'use strict';
// https://w3c.github.io/web-nfc/
const record = {
recordType: "text",
data: "Hello World",
id: "/custom/path"
};
const message = {
url: "/custom/path",
records: [record]
};
idl_test(
['web-nfc'],
['html', 'dom', 'WebIDL'],
idl_array => {
idl_array.add_objects({
NDEFReader: ['new NDEFReader();'],
NDEFRecord: [`new NDEFRecord(${JSON.stringify(record)});`],
NDEFMessage: [`new NDEFMessage(${JSON.stringify(message)});`],
NDEFReadingEvent: [`new NDEFReadingEvent("reading", { message: ${JSON.stringify(message)} })`],
});
}
);