blob: 7ac29c0b13c41c69288c3f433725f44028d006f0 [file] [log] [blame]
Joshua Bell2f76ef22017-10-11 16:22:231<!DOCTYPE html>
2<meta charset=utf-8>
3<title>Entries API: FileSystemFileEntry file() manual test</title>
4<link rel=help href="https://wicg.github.io/entries-api/#api-entry">
5<script src="/resources/testharness.js"></script>
6<script src="/resources/testharnessreport.js"></script>
7<script src="support.js"></script>
8
9<script>
10
11file_entry_test('file.txt', (t, entry) => {
12 assert_idl_attribute(entry, 'file', 'FileSystemFileEntry has a file() method');
13 assert_equals(typeof entry.file, 'function', 'FileSystemFileEntry has a file() method');
14
Stephen McGruerf0652352020-01-23 17:35:5615 assert_throws_js(TypeError, () => entry.file(), 'file() has a required argument');
Joshua Bell2f76ef22017-10-11 16:22:2316 entry.file(t.step_func(file => {
17
18 assert_class_string(file, 'File', 'file() should yield a File');
19 assert_equals(entry.name, file.name, 'entry and file names should match');
20 t.done();
21
22 }), t.unreached_func('file() should not fail'));
23}, 'FileSystemFileEntry - file()');
24
25// TODO: Manual test where file is replaced with directory before file() called
26</script>