blob: 9e84b10c08394514448fe00dd4ea95e3fc41b552 [file] [log] [blame]
Joshua Bell3f001762017-10-05 03:33:011<!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>
10entry_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
28entry_test((t, entry) => {
29 const fs = entry.filesystem;
30
Joshua Bell2f76ef22017-10-11 16:22:2331 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 Bell3f001762017-10-05 03:33:0135
36 t.done();
Joshua Bell2f76ef22017-10-11 16:22:2337 }), t.unreached_func('child entry file.txt should be present'));
Joshua Bell3f001762017-10-05 03:33:0138
39}, 'FileSystem - name consistency and object identity');
40</script>