diff --git a/native-file-system/showPicker-errors.https.window.js b/native-file-system/showPicker-errors.https.window.js index e8f0d3f5404851..d1dabf37da8305 100644 --- a/native-file-system/showPicker-errors.https.window.js +++ b/native-file-system/showPicker-errors.https.window.js @@ -80,9 +80,39 @@ function define_file_picker_error_tests(showPickerMethod) { showPickerMethod + ': MIME type can\'t have invalid characters in subtype.'); - promise_test(async t => { - await promise_rejects_js(t, TypeError, self[showPickerMethod]({ - types: [{accept: {'text/plain': ['.txt', 'txt']}}] - })); - }, showPickerMethod + ': extension has to start with ".".'); + const invalid_extensions = { + '.extensiontoolong': 'extension length more than 16.', + '.txt.': 'extenstion ends with "."', + 'txt': 'extenstion does not start with "."', + '.$txt' : 'illegal character "$"', + '.t { + await promise_rejects_js( + t, TypeError, + self[showPickerMethod]( + { types: [{ accept: { 'text/plain': ['.txt', extension] } }] })); + }, showPickerMethod + ': invalid extension "' + extension + '". ' + description + "."); +} \ No newline at end of file