зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1560906
[wpt PR 17425] - [webnfc] Remove incorrect test, a=testonly
Automatic update from web-platform-tests [webnfc] Remove incorrect tests (#17425) Per spec https://heycam.github.io/webidl/#es-DOMString, non string value will be converted to string via `toString()` method, therefore there's no `TypeError` to be thrown. -- wpt-commits: 3a00a57af5f449a72f0e1b89dae6f1bd15ad8fcd wpt-pr: 17425
This commit is contained in:
Родитель
c4c8dc14af
Коммит
e585e10cd2
|
@ -6,31 +6,11 @@
|
|||
<script src="resources/nfc_help.js"></script>
|
||||
<script>
|
||||
|
||||
const non_strings = [
|
||||
123,
|
||||
{},
|
||||
true,
|
||||
Symbol(),
|
||||
() => {},
|
||||
self
|
||||
]
|
||||
|
||||
test(() => {
|
||||
assert_equals(NFCReadingEvent.length, 2);
|
||||
assert_throws(new TypeError, () => new NFCReadingEvent('message'));
|
||||
}, 'NFCReadingEvent constructor without init dict');
|
||||
|
||||
test(() => {
|
||||
assert_equals(NFCReadingEvent.length, 2);
|
||||
const message = createMessage([createJsonRecord(test_json_data)]);
|
||||
non_strings.forEach(invalid_serialNumber => {
|
||||
assert_throws(new TypeError, () => new NFCReadingEvent(
|
||||
'message',
|
||||
{serialNumber: invalid_serialNumber, message: message}
|
||||
));
|
||||
});
|
||||
}, 'NFCReadingEvent constructor with invalid serialNumber');
|
||||
|
||||
test(() => {
|
||||
const message = createMessage([createJsonRecord(test_json_data)]);
|
||||
const event = new NFCReadingEvent('type', {serialNumber: '', message: message});
|
||||
|
|
|
@ -82,16 +82,7 @@ const invalid_signals = [
|
|||
Symbol(),
|
||||
() => {},
|
||||
self
|
||||
]
|
||||
|
||||
const non_strings = [
|
||||
123,
|
||||
{},
|
||||
true,
|
||||
Symbol(),
|
||||
() => {},
|
||||
self
|
||||
]
|
||||
];
|
||||
|
||||
promise_test(t => {
|
||||
const writer = new NFCWriter();
|
||||
|
@ -220,17 +211,4 @@ promise_test(() => {
|
|||
});
|
||||
}, 'Test that WebNFC API is not accessible from iframe context.');
|
||||
|
||||
promise_test(t => {
|
||||
const writer = new NFCWriter();
|
||||
const promises = [];
|
||||
non_strings.forEach(invalid_url => {
|
||||
promises.push(
|
||||
promise_rejects(t, new TypeError(), writer.push({
|
||||
url: invalid_url,
|
||||
records: [{ recordType: "text", data: 'Hello World' }]
|
||||
})));
|
||||
});
|
||||
return Promise.all(promises);
|
||||
}, "Test that promise is rejected with TypeError if NDEFMessageSource contains non-string url.");
|
||||
|
||||
</script>
|
||||
|
|
Загрузка…
Ссылка в новой задаче