A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/web-platform-tests/wpt/commit/b20e8343ce5ff1eada39dc1487b8b28ed903fff6 below:

Don't allow overwrite of files/directories using move() · web-platform-tests/wpt@b20e834 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+13

-17

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+13

-17

lines changed Original file line number Diff line number Diff line change

@@ -86,10 +86,11 @@ directory_test(async (t, root) => {

86 86

await promise_rejects_dom(

87 87

t, 'NoModificationAllowedError', handle.move('file-after'));

88 88 89 -

// Can move handle once the writable is closed.

89 +

// Can't move handle once the writable is closed.

90 90

await stream.close();

91 -

await handle.move('file-after');

92 -

assert_array_equals(await getSortedDirectoryEntries(root), ['file-after']);

91 +

await promise_rejects_dom(

92 +

t, 'NoModificationAllowedError', handle.move('file-after'));

93 +

assert_array_equals(await getSortedDirectoryEntries(root), ['file-before']);

93 94

}, 'move(name) while the destination file has an open writable fails');

94 95 95 96

@@ -308,15 +309,11 @@ directory_test(async (t, root) => {

308 309

// Assert the file is still in the source directory.

309 310

assert_array_equals(await getSortedDirectoryEntries(dir_src), ['file']);

310 311 311 -

// Can move handle once the writable is closed.

312 +

// Can't move handle once the writable is closed.

312 313

await stream.close();

313 -

await file.move(dir_dest);

314 -

assert_array_equals(

315 -

await getSortedDirectoryEntries(root), ['dir-dest/', 'dir-src/']);

316 -

assert_array_equals(await getSortedDirectoryEntries(dir_src), []);

317 -

assert_array_equals(await getSortedDirectoryEntries(dir_dest), ['file']);

318 -

assert_equals(await getFileContents(file), 'abc');

319 -

assert_equals(await getFileSize(file), 3);

314 +

await promise_rejects_dom(

315 +

t, 'NoModificationAllowedError', file.move(dir_dest));

316 +

assert_array_equals(await getSortedDirectoryEntries(dir_src), ['file']);

320 317

}, 'move(dir) while the destination file has an open writable fails');

321 318 322 319

directory_test(async (t, root) => {

@@ -336,13 +333,12 @@ directory_test(async (t, root) => {

336 333

// Assert the file is still in the source directory.

337 334

assert_array_equals(await getSortedDirectoryEntries(dir_src), ['file-src']);

338 335 339 -

// Can move handle once the writable is closed.

336 +

// Can't move handle once the writable is closed.

340 337

await stream.close();

341 -

await file.move(dir_dest, 'file-dest');

342 -

assert_array_equals(

343 -

await getSortedDirectoryEntries(root), ['dir-dest/', 'dir-src/']);

344 -

assert_array_equals(await getSortedDirectoryEntries(dir_src), []);

345 -

assert_array_equals(await getSortedDirectoryEntries(dir_dest), ['file-dest']);

338 +

await promise_rejects_dom(

339 +

t, 'NoModificationAllowedError', file.move(dir_dest, 'file-dest'));

340 +

// Assert the file is still in the source directory.

341 +

assert_array_equals(await getSortedDirectoryEntries(dir_src), ['file-src']);

346 342

assert_equals(await getFileContents(file), 'abc');

347 343

assert_equals(await getFileSize(file), 3);

348 344

}, 'move(dir, name) while the destination file has an open writable fails');

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4