Closed Bug 854549 Opened 12 years ago Closed 12 years ago

Robocop screenshots

Categories

(Firefox for Android Graveyard :: General, defect)

x86
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 22

People

(Reporter: gbrown, Assigned: gbrown)

Details

Attachments

(4 files)

In some of our intermittent robocop failures, a screenshot from the time of failure would be a great aid to debugging.
Taking the screenshot on assertion failure or exception is easy. Unfortunately, this doesn't work for content (the jpg is all black where content would be), but at least it gives us something. (Will attach examples...)
Assignee: nobody → gbrown
Attachment #729160 - Flags: review?(jmaher)
This pulls the jpg off the device, base64 encodes it and dumps the result. You can see this in action here: https://tbpl.mozilla.org/?tree=Try&rev=6fd6e65589df (search the logs for "SCREENSHOT"). It's fairly straight-forward, but a little awkward, to copy the screenshot data, decode it and display the resulting jpg. As an alternative, we could copy the jpg somewhere and have a link to the jpg in the log...I just don't know where to store it.
Attachment #729161 - Flags: review?(jmaher)
Attachment #729160 - Flags: review?(jmaher) → review+
Comment on attachment 729161 [details] [diff] [review] base64 encode screenshot jpg and dump to log output; cleanup screenshot files Review of attachment 729161 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/mochitest/runtestsremote.py @@ +435,5 @@ > + def printScreenshot(self): > + try: > + image = self._dm.pullFile("/mnt/sdcard/Robotium-Screenshots/robocop-screenshot.jpg") > + encoded = base64.b64encode(image) > + print "SCREENSHOT: data:image/jpg;base64,%s" % encoded This is assuming there is a screenshot. I know there is a try/except around it. Is that what you are using if image is '' ?
Attachment #729161 - Flags: review?(jmaher) → review+
(In reply to Joel Maher (:jmaher) from comment #5) > This is assuming there is a screenshot. I know there is a try/except around > it. Is that what you are using if image is '' ? Right. If a test passes, no screenshot is generated and pullFile() throws; we catch that and continue silently. The obvious alternative is to call fileExists(), but that ends up generating more sut traffic (check that the directory exists, then pulls down a directory listing). I will add a comment before landing to explain this.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 22
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: