allow redirecting dump() to a file

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: vlad, Assigned: vlad)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Created attachment 374405 [details] [diff] [review]
dump to file

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)

Updated

8 years ago
Assignee: nobody → vladimir

Updated

8 years ago
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
(Assignee)

Comment 2

8 years ago
Created attachment 374540 [details] [diff] [review]
updated patch

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)

Updated

8 years ago
Attachment #374540 - Flags: superreview+
Attachment #374540 - Flags: review?(jst)
Attachment #374540 - Flags: review+
(Assignee)

Comment 3

8 years ago
http://hg.mozilla.org/mozilla-central/rev/49f4101fb09b

thanks!
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED

Updated

8 years ago
Component: Content → DOM
QA Contact: content → general
You need to log in before you can comment on or make changes to this bug.