From b8139036f63660d779d086118cb5247e9b1e8e45 Mon Sep 17 00:00:00 2001 From: "chengtao.liu" Date: Mon, 24 Mar 2014 15:44:22 +0800 Subject: [PATCH] update launcher codes for web test --- commodule/impl/androidmobile.py | 12 ++++++------ commodule/impl/tizenmobile.py | 23 +---------------------- 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/commodule/impl/androidmobile.py b/commodule/impl/androidmobile.py index 545eecd..02669bc 100644 --- a/commodule/impl/androidmobile.py +++ b/commodule/impl/androidmobile.py @@ -39,6 +39,7 @@ APP_START = "adb -s %s shell am start -n %s" APP_STOP = "adb -s %s shell am force-stop %s" XWALK_APP_STR = "org.xwalk.%s/.%sActivity" + LOGCAT_CLEAR = "adb -s %s shell logcat -c" LOGCAT_START = "adb -s %s shell logcat -v time" DMESG_CLEAR = "adb -s %s shell dmesg -c" @@ -250,13 +251,12 @@ class AndroidMobile: cmdline = APP_STOP % (self.deviceid, pkg_name) exit_code, ret = shell_command(cmdline) cmdline = APP_START % (self.deviceid, wgt_name) - while timecnt < 3: + exit_code, ret = shell_command(cmdline) + if len(ret) > 1: + cmdline = APP_START % (self.deviceid, wgt_name.replace('Activity', '')) exit_code, ret = shell_command(cmdline) - if len(ret) > 0 and ret[0].find('Starting') != -1: - blauched = True - break - timecnt += 1 - time.sleep(3) + blauched = True + time.sleep(3) else: cmdline = APP_NONBLOCK_STR % (self.deviceid, wgt_name) exit_code, ret = shell_command(cmdline) diff --git a/commodule/impl/tizenmobile.py b/commodule/impl/tizenmobile.py index a4e054f..742da84 100644 --- a/commodule/impl/tizenmobile.py +++ b/commodule/impl/tizenmobile.py @@ -477,30 +477,9 @@ class TizenMobile: build_info['buildid'] = '' build_info['manufacturer'] = '' build_info['model'] = '' - - builfinfo_file = os.path.expanduser("~") + os.sep + "tizen_buildinfo.xml" - if self.download_file(BUILD_INFO_FILE, builfinfo_file) and os.path.exists(builfinfo_file): - root = etree.parse(builfinfo_file).getroot() - for element in root.findall("buildinfo"): - if element is not None: - if element.get("name").lower() == 'buildversion': - child = etree.Element.getchildren(element) - if child and child[0].text: - buildid = child[0].text - build_info['buildid'] = buildid - if element.get("name").lower() == 'manufacturer': - child = etree.Element.getchildren(element) - if child and child[0].text: - manufacturer = child[0].text - build_info['manufacturer'] = manufacturer - if element.get("name").lower() == 'model': - child = etree.Element.getchildren(element) - if child and child[0].text: - model = child[0].text - build_info['model'] = model - os.remove(builfinfo_file) return build_info + def get_target_conn(device_id=None): """ Get connection for Test Target""" if device_id is None: -- 2.7.4