Closed Bug 1239964 Opened 8 years ago Closed 8 years ago

Make gaiatest support screen recording on remote devices

Categories

(Firefox OS Graveyard :: Gaia::UI Tests, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jlorenzo, Assigned: jlorenzo)

References

Details

Attachments

(1 file, 1 obsolete file)

Bug 1144103 implemented the possibility to record videos on Firefox OS. Bug 1237069 made gaiatest able to record videos locally. If we want to record videos with a remote adb connection (bug 1239293), we need to expose functions like turn_on_screen_recording() and turn_off_screen_recording() in DeviceManagerADB[1].


[1] https://dxr.mozilla.org/mozilla-central/rev/6020a4cb41a77a09484c24a5875bb221714c0e6a/testing/mozbase/mozdevice/mozdevice/devicemanagerADB.py
Assignee: nobody → jlorenzo
I didn't manage to run the tests at [1], I always get this error during the set up:
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u250c' in position 17: ordinal not in range(128)

Then, I followed Dave's proposal which was to call directly devicemanagerADB in gaiatest. Like this comment reads, there's no way to start a background process with shell() because of these 3 reasons:
1. The default behavior waits on the command to complete
2. Appending & at the end of the command doesn't work => & is escaped
3. Calling `adb shell daemonize screenrecord /sdcard/test_video.mp4` doesn't work either. daemonize kills the process once you shell out, which is the case hen you call shell()

[1] https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozdevice/adb_tests/test_devicemanagerADB.py
[2] https://github.com/mozilla-b2g/gaia/blob/aaab19d36ac0bd750f0ecce68f5ffdb95ca949f7/tests/python/gaia-ui-tests/gaiatest/gaia_test.py#L939-L942
[3] https://dxr.mozilla.org/mozilla-central/rev/0a4331e7d7ba21c3a54d9f17fb6ed1f42b7c29ec/testing/mozbase/mozdevice/mozdevice/devicemanager.py#585
Component: Mozbase → Gaia::UI Tests
Product: Testing → Firefox OS
Summary: [mozdevice] Expose screen recorder capabilites → Make gaiatest support screen recording on remote devices
Attachment #8708434 - Attachment is obsolete: true
Comment on attachment 8709005 [details] [review]
[gaia] JohanLorenzo:bug-1239964 > mozilla-b2g:master

The only small change is we use DeviceManagerADB.shell() and this call is done in a separate thread. This threads ends the same way as before (as the command line returns).

Sadly, I couldn't test if the remote recording was working. By default, adb doesn't support listening to other connections than the ones coming from localhost. The way to enable it is to compile adb with a given option [1]. 

However, shellCheckOutput() is already used for stopping and starting b2g[2] and this part hasn't changed. Then, I would expect this command to be executed to the correct adb host/port/serial.

Worst case scenario, if that doesn't work, the taskcluster runs in Staging will be the only one impacted, once bug 1239293 lands.

[1] http://android.stackexchange.com/questions/52911/adb-start-server-and-listen-on-all-interfaces
[2] https://github.com/mozilla-b2g/gaia/blob/master/tests/python/gaia-ui-tests/gaiatest/gaia_test.py#L693
Attachment #8709005 - Flags: review?(npark)
Attachment #8709005 - Flags: review?(martijn.martijn)
Comment on attachment 8709005 [details] [review]
[gaia] JohanLorenzo:bug-1239964 > mozilla-b2g:master

looks good to me, let's see what happens in TC
Attachment #8709005 - Flags: review?(npark) → review+
Attachment #8709005 - Flags: review?(martijn.martijn) → review+
Landed in master at https://github.com/mozilla-b2g/gaia/commit/1a5d8c9b7e62e177cb065c0b769a31f8ebbd8132
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: