forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File/Directory Entries API: Make tests Edge friendly (web-platform-te…
…sts#7659) * Reduce dependencies on APIs by tests
- Loading branch information
1 parent
1f31c88
commit 2f76ef2
Showing
15 changed files
with
194 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
entries-api/filesystemdirectoryentry-createReader-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<meta charset=utf-8> | ||
<title>Entries API: FileSystemDirectoryEntry createReader() manual test</title> | ||
<link rel=help href="https://wicg.github.io/entries-api/#api-directoryentry"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="support.js"></script> | ||
|
||
<script> | ||
entry_test((t, entry) => { | ||
|
||
assert_idl_attribute(entry, 'createReader', 'FileSystemDirectoryEntry has createReader'); | ||
assert_equals(typeof entry.createReader, 'function', 'createReader() is a method'); | ||
|
||
t.done(); | ||
}, 'FileSystemDirectoryEntry - createReader()'); | ||
|
||
entry_test((t, entry) => { | ||
assert_not_equals(entry.createReader(), entry.createReader(), | ||
'createReader() returns a new object each time'); | ||
t.done(); | ||
}, 'FileSystemDirectoryEntry - createReader() distinct objects'); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
entries-api/filesystemdirectoryentry-getParent-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<meta charset=utf-8> | ||
<title>Entries API: FileSystemDirectoryEntry getParent() manual test</title> | ||
<link rel=help href="https://wicg.github.io/entries-api/#api-directoryentry"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="support.js"></script> | ||
|
||
<script> | ||
entry_test((t, entry) => { | ||
|
||
assert_idl_attribute(entry, 'getParent', 'FileSystemDirectoryEntry has getParent'); | ||
assert_equals(typeof entry.getParent, 'function', 'getParent() is a method'); | ||
|
||
t.done(); | ||
}, 'FileSystemDirectoryEntry - getParent()'); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<meta charset=utf-8> | ||
<title>Entries API: FileSystemEntry getParent() manual test</title> | ||
<link rel=help href="https://wicg.github.io/entries-api/#dom-filesystementry-getparentapi-entry"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="support.js"></script> | ||
|
||
<script> | ||
entry_test((t, entry) => { | ||
assert_idl_attribute(entry, 'getParent', 'FileSystemEntry has getParent method'); | ||
assert_equals(typeof entry.getParent, 'function', 'FileSystemEntry has a getParent() method'); | ||
|
||
assert_equals(entry.getParent(), void 0, 'getParent() arguments are optional'); | ||
|
||
entry.getParent(t.step_func(parent => { | ||
assert_true(parent.isDirectory, 'parent should be a directory'); | ||
|
||
assert_equals(parent.fullPath, '/', 'parent should be root'); | ||
assert_equals(parent.name, '', 'root name is empty string'); | ||
|
||
t.done(); | ||
}), t.unreached_func('getParent() should not fail')); | ||
}, 'FileSystemEntry - getParent()'); | ||
|
||
// TODO: Manual test for getParent() where containing directory is removed before getParent() is called. | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!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(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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<meta charset=utf-8> | ||
<title>Entries API: FileSystemFileEntry getParent() 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, 'getParent', 'FileSystemFileEntry has a getParent method'); | ||
assert_equals(typeof entry.getParent, 'function', 'FileSystemFileEntry has a getParent() method'); | ||
t.done(); | ||
}, 'FileSystemFileEntry - getParent() method'); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.