1 // META: title=NativeIO API: File deletion is reflected in listing.
2 // META: global=window,worker
6 promise_test(async testCase => {
7 const file = await storageFoundation.open('test_file');
8 testCase.add_cleanup(async () => {
9 await storageFoundation.delete('test_file');
13 const fileNamesBeforeDelete = await storageFoundation.getAll();
14 assert_in_array('test_file', fileNamesBeforeDelete);
16 await storageFoundation.delete('test_file');
17 const fileNames = await storageFoundation.getAll();
18 assert_equals(fileNames.indexOf('test_file'), -1);
19 }, 'storageFoundation.getAll does not return file deleted by' +
20 ' storageFoundation.delete');
22 promise_test(async testCase => {
23 await storageFoundation.delete('test_file');
24 // Delete a second time if the file existed before the first delete.
25 await storageFoundation.delete('test_file');
26 }, 'storageFoundation.delete does not fail when deleting a non-existing file');