fix: wait_for_boot waiting forever (#978)

This commit is contained in:
Norman Breau 2020-05-22 15:07:18 -03:00 committed by GitHub
parent 08dc1dd9b9
commit a830145f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -352,8 +352,8 @@ module.exports.wait_for_emulator = function (port) {
*/
module.exports.wait_for_boot = function (emulator_id, time_remaining) {
var self = this;
return Adb.shell(emulator_id, 'ps').then(function (output) {
if (output.match(/android\.process\.acore/)) {
return Adb.shell(emulator_id, 'getprop sys.boot_completed').then(function (output) {
if (output.match(/1/)) {
return true;
} else if (time_remaining === 0) {
return false;

View File

@ -452,7 +452,7 @@ describe('emulator', () => {
it('should resolve with true if the system has booted', () => {
AdbSpy.shell.and.callFake((emuId, shellArgs) => {
expect(emuId).toBe(emulatorId);
expect(shellArgs).toContain('ps');
expect(shellArgs).toContain('getprop sys.boot_completed');
return Promise.resolve(psOutput);
});