Bug 1597561 [wpt PR 20308] - Follow NDEFScanOptions dictionary spec, a=testonly

Automatic update from web-platform-tests
Follow NDEFScanOptions dictionary spec

NDEFScanOptions dictionary spec was changed.
So we should follow new spec for it.
I updated the dictionary.

Bug: 520391,1001507
Change-Id: I427b572e597bd55c719c18922b92c6419b473a22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1921930
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Rijubrata Bhaumik <rijubrata.bhaumik@intel.com>
Commit-Queue: Byoungkwon Ko <codeimpl@gmail.com>
Cr-Commit-Position: refs/heads/master@{#717623}

--

wpt-commits: 8e98be7324cb0d839041cca41e9a22869c1e5347
wpt-pr: 20308
This commit is contained in:
byoungkwon ko 2019-11-26 11:28:20 +00:00 коммит произвёл moz-wptsync-bot
Родитель a69355ee9b
Коммит 9868b4cce7
3 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -106,7 +106,7 @@ function assertNDEFReaderOptionsEqual(provided, received) {
// Checks whether NDEFReaderOptions are matched with given message.
function matchesWatchOptions(message, options) {
// Filter by Web NFC id.
if (!matchesWebNfcId(message.url, options.url)) return false;
if (!matchesWebNfcId(message.url, options.id)) return false;
// Matches any record / media type.
if ((options.mediaType == null || options.mediaType === '') &&

Просмотреть файл

@ -64,8 +64,8 @@ const NDEFReaderOptionTests =
{
desc: "Test that the url of NDEFScanOptions filters relevant data" +
" sources correctly.",
scanOptions: {url: `${location.origin}/custom/path`},
unmatchedScanOptions: {url: `${location.origin}/custom/invalid`},
scanOptions: {id: `${location.origin}/custom/path`},
unmatchedScanOptions: {id: `${location.origin}/custom/invalid`},
message: {url: `${location.origin}/custom/path/update`,
records: [createTextRecord(test_text_data)]}
},
@ -132,7 +132,7 @@ const ReadMultiMessagesTests =
{
desc: "Test that filtering 'text' record from different messages" +
" correctly with NDEFScanOptions' url set.",
scanOptions: {url: `${location.origin}/custom/path`},
scanOptions: {id: `${location.origin}/custom/path`},
message: {url: `${location.origin}/custom/path/update`,
records: [createTextRecord(test_text_data)]},
unmatchedMessage: {url: `${location.origin}/custom/invalid`,

Просмотреть файл

@ -36,17 +36,17 @@ promise_test(async t => {
}, "Test that NDEFReader.scan rejects if signal is not an AbortSignal.");
promise_test(async t => {
await waitSyntaxErrorPromise(t, {url: "www.a.com"});
}, "Test that NDEFReader.scan rejects if NDEFScanOptions.url is missing \
await waitSyntaxErrorPromise(t, {id: "www.a.com"});
}, "Test that NDEFReader.scan rejects if NDEFScanOptions.id is missing \
components.");
promise_test(async t => {
await waitSyntaxErrorPromise(t, {url: "invalid"});
}, "Test that NDEFReader.scan rejects if NDEFScanOptions.url is invalid.");
await waitSyntaxErrorPromise(t, {id: "invalid"});
}, "Test that NDEFReader.scan rejects if NDEFScanOptions.id is invalid.");
promise_test(async t => {
await waitSyntaxErrorPromise(t, {url: "http://a.com"});
}, "Test that NDEFReader.scan rejects if NDEFScanOptions.url has wrong \
await waitSyntaxErrorPromise(t, {id: "http://a.com"});
}, "Test that NDEFReader.scan rejects if NDEFScanOptions.id has wrong \
protocol.");
nfc_test(async (t, mockNFC) => {