Closed Bug 1248097 Opened 10 years ago Closed 10 years ago

Add some more features to SpecialPowers.createFiles()

Categories

(Testing :: Mochitest, defect)

defect
Not set
normal

Tracking

(firefox47 fixed)

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(4 files)

For bug 1243577 I need a couple of additional abilities for SpecialPowers.createFiles(). First, if a name is omitted, use createUnique to come up with one. Most (or maybe all) of the tests don't really care what the file name is. Second, the child should be able to pass in an "options" argument to be used as the second argument to the File constructor.
This is pretty trivial. It just passes through an additional argument to the WebIDL File constructor.
Attachment #8720579 - Flags: review?(jmaher)
This would cause us to not delete some created files if SpecialPowers.createFiles() is called multiple times in a single test. I noticed this while I was looking at the code. There's no test because I'd have to change the removeFiles API (which is currently called automatically from finishTest() to do a callback when it finishes which seems like a bit of a pain. Leaving around a few files doesn't seem like a huge deal.
Attachment #8720580 - Flags: review?(jmaher)
Comment on attachment 8720575 [details] [diff] [review] part 1 - Fix indentation in SpecialPowersObserver.jsm. Review of attachment 8720575 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/specialpowers/content/SpecialPowersObserver.jsm @@ +266,5 @@ > outStream.write(request.data, request.data.length); > outStream.close(); > } > filePaths.push(new File(testFile.path)); > createdFiles.push(testFile); I am not sure why we went from 2 space indentation to 6 space. Either way, these indentations are only half of the code inside the forEach.
Attachment #8720575 - Flags: review?(jmaher) → review-
Attachment #8720578 - Flags: review?(jmaher) → review+
Attachment #8720579 - Flags: review?(jmaher) → review+
Attachment #8720580 - Flags: review?(jmaher) → review+
(In reply to Joel Maher (:jmaher) from comment #5) > I am not sure why we went from 2 space indentation to 6 space. Either way, > these indentations are only half of the code inside the forEach. Sorry, I'm not sure what you mean here. All of the code inside the forEach is correctly indented now. Did you mean to r- my patch? If so, what do I need to fix? Thanks.
Flags: needinfo?(jmaher)
Comment on attachment 8720575 [details] [diff] [review] part 1 - Fix indentation in SpecialPowersObserver.jsm. Review of attachment 8720575 [details] [diff] [review]: ----------------------------------------------------------------- oh silly me, I read the patch backwards.
Attachment #8720575 - Flags: review- → review+
Flags: needinfo?(jmaher)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: