Closed Bug 489938 Opened 11 years ago Closed 11 years ago

allow redirecting dump() to a file

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: vlad, Assigned: vlad)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch dump to file (obsolete) — Splinter Review
A lot of our tools rely on dump() for output, which makes it hard to get at the data on devices where we don't really have a stdout.  Here's a simple patch that adds a pref to optionally redirect dump() output to a file.

With this, and the ability to execute commands remotely with a command line (e.g. for winmo/wince, using rapi tools prun/pput/pget), we can run many of our tests on mobile devices.
Attachment #374405 - Flags: review?(jst)
Assignee: nobody → vladimir
Attachment #374405 - Flags: superreview+
Attachment #374405 - Flags: review?(jst)
Attachment #374405 - Flags: review+
Comment on attachment 374405 [details] [diff] [review]
dump to file

+    const nsAdoptingCString& fname = 
+      nsContentUtils::GetCharPref("browser.dom.window.dump.file");
+    if (fname) {

That should be if (!fname.IsEmpty()) rather than just checking if (fname), right?

r+sr=jst
Attached patch updated patchSplinter Review
Updated patch -- this correctly closes the file only in ::ShutDown instead of in ::Cleanup, giving us a new file per run correctly.  Also uses fputs() and adds a fflush() in dump() to ensure that the output always ends up in the file.
Attachment #374405 - Attachment is obsolete: true
Attachment #374540 - Flags: review?(jst)
Attachment #374540 - Flags: superreview+
Attachment #374540 - Flags: review?(jst)
Attachment #374540 - Flags: review+
http://hg.mozilla.org/mozilla-central/rev/49f4101fb09b

thanks!
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Component: Content → DOM
QA Contact: content → general
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.