Files
tubestation/testing/web-platform/tests/entries-api/filesystemfileentry-file-manual.html
Stephen McGruer 493df05d15 Bug 1611180 [wpt PR 21378] - Replace some "assert_throws(FooError(), stuff)" calls with assert_throws_js, a=testonly
Automatic update from web-platform-tests
Replace some "assert_throws(FooError(), stuff)" calls with assert_throws_js. (#21378)

This diff was generated by running:

  find . -type f -print0 | xargs -0 perl -pi -e 'BEGIN { $/ = undef; } s/assert_throws\(([ \n]*)([A-Za-z]*Error) *\(\) *(, *.)/assert_throws_js(\1\2\3/gs'

and then:

1) Manually editing dom/nodes/Element-matches.js to get the TypeError
constructor from the element's global.

2) Manually editing dom/nodes/ParentNode-querySelector-All.js to get the
TypeError constructor from root's global, whether "root" is a Document or some
other kind of node.

Co-authored-by: Boris Zbarsky <bzbarsky@mit.edu>

--

wpt-commits: f06523527a0735d23879f4e687d6efc095f780b7
wpt-pr: 21378
2020-01-27 15:36:03 +00:00

27 lines
1005 B
HTML

<!DOCTYPE html>
<meta charset=utf-8>
<title>Entries API: FileSystemFileEntry file() manual test</title>
<link rel=help href="https://wicg.github.io/entries-api/#api-entry">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support.js"></script>
<script>
file_entry_test('file.txt', (t, entry) => {
assert_idl_attribute(entry, 'file', 'FileSystemFileEntry has a file() method');
assert_equals(typeof entry.file, 'function', 'FileSystemFileEntry has a file() method');
assert_throws_js(TypeError, () => entry.file(), 'file() has a required argument');
entry.file(t.step_func(file => {
assert_class_string(file, 'File', 'file() should yield a File');
assert_equals(entry.name, file.name, 'entry and file names should match');
t.done();
}), t.unreached_func('file() should not fail'));
}, 'FileSystemFileEntry - file()');
// TODO: Manual test where file is replaced with directory before file() called
</script>