andreasgal / B2G

Boot to Gecko aims to create a complete, standalone operating system for the open web.
https://wiki.mozilla.org/B2G
908 stars 158 forks source link

emulator goes to sleep too quickly, can timeout automated tests #214

Open jonallengriffin opened 12 years ago

jonallengriffin commented 12 years ago

The emulator will go to sleep after 60s of inactivity. Sometimes this can cause automated tests to fail (e.g., while one emulator waits for another to start during multi-emulator tests). Can this be changed to a longer period, like 5 minutes?

While the emulator is asleep, you can't connect to it via adb (although it does show up in the list of adb devices), and the emulator will not react to mouse events. The only way I've found to wake it up is to press the Home button on the emulator skin.

lquterqtd commented 12 years ago

I have a question seems to be something else.When I start the emulator I cannot see the Home or Return or Menu or Search button. How can they be shown?

malini commented 12 years ago

https://github.com/cgjones/mozilla-central/blob/master/b2g/chrome/content/shell.js#L332

You can set it via the "power.screen.timeout" pref in b2g/app/b2g.js. We should probably change it here for our testing purposes, or in a profile file if one is used, unless you think we should change the b2g.js that's committed to the repo?

jonallengriffin commented 12 years ago

I'm not sure what to do about this; we can't set the pref at runtime since it is only checked at startup. We can't modify the profile without restarting b2g.

Eventually there should be some code to support changing this at runtime, which we could utilize.

jonallengriffin commented 12 years ago

A patch to bump the sleep timeout was submitted in https://bugzilla.mozilla.org/show_bug.cgi?id=739476

kanru commented 12 years ago

Could we detect the device is real phone or emulator?