| Joshua Bell | 3f00176 | 2017-10-05 03:33:01 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <meta charset=utf-8> |
| 3 | <title>Entries API: FileSystem manual test</title> |
| 4 | <link rel=help href="https://wicg.github.io/entries-api/#api-domfilesystem"> |
| 5 | <script src="/resources/testharness.js"></script> |
| 6 | <script src="/resources/testharnessreport.js"></script> |
| 7 | <script src="support.js"></script> |
| 8 | |
| 9 | <script> |
| 10 | entry_test((t, entry) => { |
| 11 | const fs = entry.filesystem; |
| 12 | |
| 13 | assert_idl_attribute(fs, 'name', 'has name attribute'); |
| 14 | assert_equals(typeof fs.name, 'string', 'name is a string'); |
| 15 | |
| 16 | assert_idl_attribute(fs, 'root', 'has root attribute'); |
| 17 | assert_true(fs.root.isDirectory, |
| 18 | 'FileSystem root is a directory entry'); |
| 19 | |
| 20 | assert_equals(fs.root.name, '', 'root name is empty string'); |
| 21 | |
| 22 | assert_equals(fs.root.fullPath, '/', 'root path is /'); |
| 23 | |
| 24 | t.done(); |
| 25 | |
| 26 | }, 'FileSystem - API'); |
| 27 | |
| 28 | entry_test((t, entry) => { |
| 29 | const fs = entry.filesystem; |
| 30 | |
| Joshua Bell | 2f76ef2 | 2017-10-11 16:22:23 | [diff] [blame] | 31 | getChildEntry(entry, 'file.txt', t.step_func(child => { |
| 32 | const cfs = child.filesystem; |
| 33 | assert_not_equals(fs, cfs.filesystem, 'FileSystem objects do not have object identity'); |
| 34 | assert_equals(fs.name, cfs.name, 'FileSystem names match'); |
| Joshua Bell | 3f00176 | 2017-10-05 03:33:01 | [diff] [blame] | 35 | |
| 36 | t.done(); |
| Joshua Bell | 2f76ef2 | 2017-10-11 16:22:23 | [diff] [blame] | 37 | }), t.unreached_func('child entry file.txt should be present')); |
| Joshua Bell | 3f00176 | 2017-10-05 03:33:01 | [diff] [blame] | 38 | |
| 39 | }, 'FileSystem - name consistency and object identity'); |
| 40 | </script> |