gecko-dev/testing/web-platform/tests/native-io/delete_sync_basic.tentative.https.any.js
Anne van Kesteren 1d883303eb Bug 1631719 [wpt PR 23133] - *.any.js: explicitly list defaults, part 3, a=testonly
Automatic update from web-platform-tests
*.any.js: explicitly list defaults, part 3

*.any.js's META global no longer supports negation or the default feature making everything a bit easier as a result.

See https://github.com/web-platform-tests/rfcs/pull/52, #23117, and #23121.

Closes #23111.
--

wpt-commits: 96c7f0b57b704c94a7535d58009500ea94c02995
wpt-pr: 23133
2020-05-04 18:11:51 +00:00

19 lines
608 B
JavaScript

// META: title=Synchronous NativeIO API: File deletion is reflected in listing.
// META: global=dedicatedworker
'use strict';
test(testCase => {
const file = nativeIO.openSync('test_file');
testCase.add_cleanup(() => {
nativeIO.deleteSync('test_file');
});
file.close();
const fileNamesBeforeDelete = nativeIO.getAllSync();
assert_in_array('test_file', fileNamesBeforeDelete);
nativeIO.deleteSync('test_file');
const fileNames = nativeIO.getAllSync();
assert_equals(fileNames.indexOf('test_file'), -1);
}, 'nativeIO.getAllSync does not return file deleted by nativeIO.deleteSync');