def __init__(self, test_case, app_package, app_activity, result_dir, loop_index): self.src_dic = { "H264_720P_30FPS": "ToS_720p_29.97fps_H264_4000kbps_8bits_noHDR_v1511090000.mp4", "H264_1080P_60FPS": "ToS_1080p_59.94fps_H264_25000kbps_8bits_noHDR_v1511090000_barcode.mp4", "H264_2160P_60FPS": "ToS_2160p_59.94fps_H264_35000kbps_8bits_noHDR_v1511090000_code_new.mp4", "H265_2K_10bit": "ToS_2160p_59.94fps_H265_35000kbps_10bits_noHDR_v1511090000_code_new.mp4", "H265_2K_8bit": "ToS_2160p_59.94fps_H265_35000kbps_8bits_noHDR_v1511090000_code_new.mp4", } self.result = '' self.attfile = '' self.test_case = test_case self.app_package = app_package self.app_activity = app_activity self.loop_index = loop_index self.video_fps_test = test_fps( self.test_case, self.app_package + '/' + self.app_activity) self.result_dir = result_dir if not os.path.exists(self.result_dir): os.mkdir(self.result_dir) self.args = [self.result_dir, self.loop_index] self.app = [self.test_case, ''] self.video_test = apptest(self.args, self.app, self.app_package, self.app_activity) self.main()
def __init__(self, test_case, app_package, app_activity, result_dir, loop_index): self.src_dic = { "H265_4k60fps": "http://10.239.93.52/workloads/H265_4k60fps.html" } self.result = '' self.attfile = '' self.test_case = test_case self.app_package = app_package self.app_activity = app_activity self.loop_index = loop_index self.video_fps_test = test_fps( self.test_case, self.app_package + '/' + self.app_activity) self.result_dir = result_dir if not os.path.exists(self.result_dir): os.mkdir(self.result_dir) self.args = [self.result_dir, self.loop_index] self.app = [self.test_case, ''] self.video_test = apptest(self.args, self.app, self.app_package, self.app_activity) for i in range(3): if self.main(): break #utiliy.hard_reboot() self.returncode = 0 if i < 2 else 1 self.video_fps_test.logout( self.video_fps_test.my_func_name(), self.test_case + " test complate! " + ("<success>" if i < 2 else "<failed>"))
def __init__(self, tr): self.result = '' self.attfile = '' self.test_case = tr.case_name self.app_package = tr.case_info["app_package"] self.app_activity = tr.case_info["app_activity"] self.loop_index = tr.loop_index self.log_dir = tr.result_dir if not os.path.exists(self.log_dir): os.mkdir(self.log_dir) self.args = [self.log_dir, self.loop_index] self.app = [self.test_case, ''] self.gallery_fps_test = test_fps(self.test_case, self.app_package + '/' + self.app_activity + "#0") self.gallery_test = apptest(self.args, self.app, self.app_package, self.app_activity) self.main(self.log_dir)
def __init__(self, test_case, app_package, app_activity, result_dir, loop_index): self.src_dic = { "H264_720P_30FPS": "ToS_720p_29.97fps_H264_4000kbps_8bits_noHDR_v1511090000.mp4", "H264_1080P_60FPS": "ToS_1080p_59.94fps_H264_25000kbps_8bits_noHDR_v1511090000_barcode.mp4", "H264_4kx2k_60FPS": "ToS_2160p_59.94fps_H264_35000kbps_8bits_noHDR_v1511090000_code_new.mp4", "H265_1080P_8bit": "ToS_1080p_59.94fps_H265_12000kbps_8bits_noHDR_v1511090000_code_new.mp4", "H265_4kx2k_10bit": "ToS_2160p_59.94fps_H265_35000kbps_10bits_noHDR_v1511090000_code_new.mp4", "MPEG4_1920x1080_60FPS": "ToS_1080p_59.94fps_H264_25000kbps_8bits_noHDR_v1511090000_code_new.mp4", "VP9_3840X2460_30FPS": "ToS_2160p_29.97fps_VP9_35000kbps_8bits_noHDR_v2014_code_new.webm" } self.result = '' self.attfile = '' self.test_case = test_case self.app_package = app_package self.app_activity = app_activity self.loop_index = loop_index self.video_fps_test = test_fps( self.test_case, self.app_package + '/' + self.app_activity) self.result_dir = result_dir if not os.path.exists(self.result_dir): os.mkdir(self.result_dir) self.args = [self.result_dir, self.loop_index] self.app = [self.test_case, ''] self.video_test = apptest(self.args, self.app, self.app_package, self.app_activity) for i in range(3): if self.main(): break time.sleep(10) utiliy.hard_reboot() self.returncode = 0 if i < 2 else 1 self.video_fps_test.logout( self.video_fps_test.my_func_name(), self.test_case + " test complate! " + ("<success>" if i < 2 else "<failed>"))
try: system_operation.turn_bluetooth('0') system_operation.turn_wifi('1') except Exception, e: panning_test.log.error("exception error :%s !!!!" % e) return False time.sleep(2) log_dir = tr.result_dir if not os.path.exists(log_dir): os.mkdir(log_dir) log = log_dir + "/result.txt" result = run_test(panning_fps_test, panning_test, log) if not result: clean_app(panning_test) return False tr.result('Frame_rate_while_panning_web_page_in_Browser', result, 'fps') tr.save() if __name__ == '__main__': tr = TestResult() args = [tr.result_dir, tr.loop_index] panning_fps_test = test_fps( "pannig_web", 'com.android.chrome/org.chromium.chrome.browser.ChromeTabbedActivity') panning_test = apptest(args, tr.case_info["app_package"], tr.case_info["app_activity"], tr.case_info["url"], tr.case_name) panning_fps_test.kill_fps_tools() main(tr, panning_fps_test, panning_test)
def main(zooming_fps_test, zooming_test): tr = TestResult(sys.argv) if not set_settings(zooming_test): return False log_dir = tr.result_dir if not os.path.exists(log_dir): os.mkdir(log_dir) log = log_dir + "result.txt" result = run_test(zooming_fps_test, zooming_test, log) if not result: zooming_fps_test.kill_fps_tools() return False tr.result('Fps_while_zooming_in_map', result, 'fps') tr.save() kill_adb_uiautomator_block() zooming_test.device.watchers.remove() if __name__ == '__main__': zooming_fps_test = test_fps( "zooming_map", 'com.google.android.apps.maps/com.google.android.maps.MapsActivity') zooming_test = apptest(sys.argv, app_package="com.google.android.apps.maps", app_activity="com.google.android.maps.MapsActivity", case_name="zooming_map") zooming_fps_test.kill_fps_tools() main(zooming_fps_test, zooming_test)
return False homescreen_fpstest.logout( homescreen_fpstest.my_func_name(), "Frame rate of Home screen flicking result is:%s" % avg_fps) return avg_fps def main(homescreen_fpstest, homescreen_test): tr = TestResult() log_dir = tr.result_dir if not os.path.exists(log_dir): os.mkdir(log_dir) log = log_dir + "result.txt" result = run_test(homescreen_fpstest, homescreen_test, log) if result == False: return False tr.result('Frame_rate_of_Home_screen_flicking', result, 'fps') tr.save() if __name__ == '__main__': homescreen_fpstest = test_fps( "homescreen_fpstest", 'com.android.launcher3/com.android.launcher3.Launcher') homescreen_test = apptest(sys.argv, app_package="com.android.launcher3", app_activity="com.android.launcher3.Launcher", case_name="homescreen_fpstest") homescreen_fpstest.kill_fps_tools() main(homescreen_fpstest, homescreen_test)