blob: 113773e82dcdc28145ecc50188f8c68acb7d156c [file] [log] [blame]
Joshua Bell2f76ef22017-10-11 16:22:231<!DOCTYPE html>
2<meta charset=utf-8>
3<title>Entries API: FileSystemFileEntry attributes 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>
10file_entry_test('file.txt', (t, entry) => {
11
12 assert_idl_attribute(entry, 'isFile', 'FileSystemEntry has isFile attribute');
13 assert_equals(typeof entry.isFile, 'boolean', 'isFile is boolean');
14
15 assert_idl_attribute(entry, 'isDirectory', 'FileSystemEntry has isDirectory attribute');
16 assert_equals(typeof entry.isDirectory, 'boolean', 'isFile is boolean');
17
18 assert_idl_attribute(entry, 'name', 'FileSystemEntry has name attribute');
19 assert_equals(typeof entry.name, 'string', 'name is a string');
20
21 assert_idl_attribute(entry, 'fullPath', 'FileSystemEntry has fullPath attribute');
22 assert_equals(typeof entry.fullPath, 'string', 'fullPath is a string');
23
24 assert_idl_attribute(entry, 'filesystem', 'FileSystemEntry has filesystem attribute');
25
26 t.done();
27}, 'FileSystemFileEntry - attribute types');
28
29file_entry_test('file.txt', (t, entry) => {
30 assert_true(entry.isFile);
31 assert_false(entry.isDirectory);
32 assert_equals(entry.name, 'file.txt');
33 assert_equals(entry.fullPath, '/upload/file.txt');
34 t.done();
35}, 'FileSystemFileEntry - attribute values');
36
37</script>