Closed
Bug 1164822
Opened 9 years ago
Closed 9 years ago
OS.File.remove does not honor the ignoreAbsent option
Categories
(Toolkit Graveyard :: OS.File, defect)
Toolkit Graveyard
OS.File
Tracking
(firefox41 fixed)
RESOLVED
FIXED
mozilla41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: Dexter, Assigned: Dexter)
Details
Attachments
(2 files, 1 obsolete file)
2.34 KB,
patch
|
Yoric
:
review+
|
Details | Diff | Splinter Review |
2.38 KB,
patch
|
Dexter
:
review+
|
Details | Diff | Splinter Review |
Calling |OS.File.remove(NON_EXISTING_FILE_PATH, {ignoreAbsent: false})| on a non existing file path does not throw (it should, as ignoreAbsent was introduced by bug 857077).
Assignee | ||
Comment 1•9 years ago
|
||
This fixes the problem: the options were not being passed around. Also, I've noticed that "\toolkit\components\osfile\tests\mochi\worker_test_osfile_front.js" contains the |test_remove_file()| test which appears to be broken: without this patch, the first check doesn't fail. Yoric, do you have any clue why that test doesn't fail?
Assignee: nobody → alessio.placitelli
Status: NEW → ASSIGNED
Attachment #8605826 -
Flags: review?(dteller)
Comment on attachment 8605826 [details] [diff] [review] bug1164822.patch Review of attachment 8605826 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Could you add a test in the xpcshell/ directory?
Attachment #8605826 -
Flags: review?(dteller) → review+
(In reply to Alessio Placitelli [:Dexter] from comment #1) > Yoric, do you have any clue why that test doesn't fail? Well, your fix fixes the main thread API. That test tests the worker API, which already worked.
Assignee | ||
Comment 4•9 years ago
|
||
Thanks Yoric, this adds test coverage for the ignoreAbsent flag.
Attachment #8607012 -
Flags: review?(dteller)
Comment on attachment 8607012 [details] [diff] [review] part 2 - add test coverage Review of attachment 8607012 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/components/osfile/tests/xpcshell/test_remove.js @@ +25,5 @@ > + try { > + yield OS.File.remove(absent_file_name, {ignoreAbsent: false}); > + } catch (ex) { > + exception = ex; > + } You should use `Assert.rejects`.
Attachment #8607012 -
Flags: review?(dteller) → review+
Assignee | ||
Comment 6•9 years ago
|
||
Thank you Yoric! Here's the try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d970dac3bbee
Attachment #8607012 -
Attachment is obsolete: true
Attachment #8607199 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
https://hg.mozilla.org/integration/fx-team/rev/2f729ee97af9 https://hg.mozilla.org/integration/fx-team/rev/c40ca2a73105
Keywords: checkin-needed
Comment 8•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/2f729ee97af9 https://hg.mozilla.org/mozilla-central/rev/c40ca2a73105
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Updated•11 months ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•