Closed Bug 491936 Opened 15 years ago Closed 15 years ago

Create tests for NetUtil.jsm

Categories

(Core :: Networking, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: bzbarsky, Assigned: sdwilsh)

References

Details

Attachments

(1 file, 1 obsolete file)

Depends on: 482310
Attached patch v1.0 (obsolete) — Splinter Review
So, this fixes NetUtil.jsm to actually export and contains a test that writes to a file. The problem being that I'm hitting this assertion and I think the NetUtil code is doing something wrong: http://mxr.mozilla.org/mozilla-central/source/netwerk/base/src/nsFileStreams.cpp#448 bz - any thoughts/hints?
I think that assertion is bogus and should go away. In particular, it'll trigger any time someone tests whether the file output stream is buffered! biesi, any objections to removing those asserts?
fair enough. the error return value should be good enough indication.
Attached patch v1.1Splinter Review
Removing that assertion passes the test :)
Attachment #392633 - Attachment is obsolete: true
Attachment #392746 - Flags: review?(bzbarsky)
Whiteboard: [needs review bz]
Blocks: 508605
Attachment #392746 - Flags: review?(bzbarsky) → review+
Comment on attachment 392746 [details] [diff] [review] v1.1 >+++ b/netwerk/base/src/NetUtil.jsm Thank you for fixing the obvious errors here! I have no idea what I was thinking when I wrote that. >+++ b/netwerk/test/unit/test_NetUtil.js >+function test_async_write_file() >+ file.createUnique(Ci.nsIFile.NORMAL_FIEL_TYPE, 0666); S/FIEL/FILE/, right? Happened to work because undefined converts to 0, which happens to be NORMAL_FILE_TYPE. With that fixed, looks good.
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs review bz]
Target Milestone: --- → mozilla1.9.2a1
Blocks: 408514
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: