Bug 1770047 [wpt PR 34117] - [Clipboard API] Clipboard Web Custom Formats implementat...
[gecko.git] / testing / web-platform / tests / native-io / delete_async_basic.tentative.https.any.js
blob149ce2a63f4fbffd0bccf2e31dad5fe3877c4e3e
1 // META: title=NativeIO API: File deletion is reflected in listing.
2 // META: global=window,worker
4 'use strict';
6 promise_test(async testCase => {
7   const file = await storageFoundation.open('test_file');
8   testCase.add_cleanup(async () => {
9     await storageFoundation.delete('test_file');
10   });
11   await file.close();
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');