def setUp(self): """ @summary: set up @return: None """ super(CameraTest, self).setUp() self._test_name = __name__ self.logger.debug("[Setup]: %s" % self._test_name) g_common_obj.root_on_device() self.camera_common = CameraCommon() self.host_path = self.camera_common.getTmpDir() self.rvc_camera = MultiMediaSwitchCameraHelper().camera self.camera_common.removeDeivceFile() self.camera_common.removeFile(self.host_path + "/*") self.camera_common.unlockScreen() self.rvc_camera.skipAccountLoginLyout() self.rvc_camera.backHome() self.d = g_common_obj.get_device() if self.d(text="Got it").exists: self.d(text="Got it").click.wait() self.multimedia_setting = MultiMediaSetting(self.camera_common.DEFAULT_CONFIG_FILE) need_install_result = self.multimedia_setting.install_apk("multi_camera_apk") if need_install_result: self.reboot_device() self.multi_camera_package_name, _ = self.multimedia_setting.get_package_and_activity_name("multi_camera_apk") MULTI_CAMERA_PERMISSION_LIST = ["android.permission.CAMERA"] self.camera_common.grantPermission(self.multi_camera_package_name, MULTI_CAMERA_PERMISSION_LIST)
def appPrepare(self, model=1): self.cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_drm.conf') self.cfg = self.config.read(self.cfg_file, self.case_name) self.multimedia_handle = MultiMediaHandle() self.multimedia_setting = MultiMediaSetting(self.cfg_file) self.multimedia_drm_helper = MultiMediaDRMHelper() self.multimedia_setting.install_apk( "widevine_apk") #install widevine apk self.widevine_package_name, self.widevine_activity_name = self.multimedia_setting.get_package_and_activity_name( "widevine_apk") if model == 1: # play local video mode self.dst_path = self.cfg.get("dst_path") self.clearResourcefolder() self.dst_path = self.multimedia_setting.push_file_new( self.cfg.get("src_path"), self.dst_path) #push video file to device elif model == 2: # play network video mode self.src_path = self.cfg.get("src_path") # g_common_obj.set_vertical_screen() g_common_obj.stop_app_am(self.widevine_package_name) g_common_obj.adb_cmd_capture_msg("input keyevent 82") #Unlock screen
def __init__(self, host_path): self.logger = Logger.getlogger() self.host_path = host_path self.camera_helper = MultiMediaSwitchCameraHelper( skip_import_camera=True) self.target_folder = os.path.join(self.host_path, self.camera_helper.device, self.camera_helper.android_version) self.expect_folder = os.path.join(self.target_folder, "expect") self.actual_folder = os.path.join(self.target_folder, "actual") if not os.path.exists(self.expect_folder): os.makedirs(self.expect_folder) if not os.path.exists(self.actual_folder): os.makedirs(self.actual_folder) self.ffmpeg_cmd = "ffmpeg -i %s -ss 00:00.02 -y -q:v 2 -vframes 1 %s" self.movies_folder_device_path = "/sdcard/Movies/" self.scale_test_xml_value_dict = {1: 30, 2: 50, 3: 60} self.play_result = -1 self.get_cfg_file_helper = GetConfigFileHelper( "", "multimedia_scale_test_helper.conf") self.scale_test_cfg = self.get_cfg_file_helper.get_section("config") self.multimedia_setting = MultiMediaSetting( self.get_cfg_file_helper.cfg_file) self.generated_reference_library = int( self.scale_test_cfg.get("generated_reference_library")) self.reference_library_folder = self.scale_test_cfg.get( "reference_library_folder") self.reference_library_folder = os.path.join( self.reference_library_folder, self.camera_helper.device, self.camera_helper.android_version) self.xml_file_dst_path = self.scale_test_cfg.get("xml_file_dst_path") self.o_image_camera3_xml_file_dst_path = self.scale_test_cfg.get( "o_image_camera3_xml_file_dst_path")
def test_ref_camera_check_fps(self, preview_format): assert 0, "Need OV10635 senser!" self.multimedia_setting = MultiMediaSetting( self.camera_common.DEFAULT_CONFIG_FILE) self.multimedia_setting.executeCommandWithPopen( "setprop camera.hal.perf 3") self.multimedia_logcat_helper = MultiMediaLogcatHelper( "adb logcat CameraHardwareSoc:D *:S") self.get_ref_camera_class().startCameraApp() self.get_ref_camera_class().selectMode("SingleShot") self.get_ref_camera_class().setSettingsButton("Preview Format", preview_format) self.multimedia_logcat_helper.get_logcat_data_start() time.sleep(1 * 60) preview_size_list = ["1280x800", "1280x720", "640x480"] for preview_size in preview_size_list: self.get_ref_camera_class().setSettingsButton( "Picture Size", preview_size) self.get_ref_camera_class().capturePhoto() self.camera_common.checkFileCorrupt(len(preview_size_list)) result_list = self.multimedia_logcat_helper.get_logcat_data_end( "total fps is (.*),") check_logcat_data_result, error_fps = self.check_logcat_data( result_list, 29, 31) assert check_logcat_data_result, "fps error! error_fps=%s, expect_fps=%s, result_list=%s" % ( error_fps, "29-31", result_list)
def check_gps(self): self.multimedia_setting = MultiMediaSetting( self.camera_common.DEFAULT_CONFIG_FILE) self.multimedia_setting.install_apk("gps_apk") self.camera_common.launchGpsApp() network_longitude, network_latitude = self.camera_common.getGPSLocation( ) return network_longitude, network_latitude
class MulticameraApkHelper: MULTI_CAMERA_CONFIG_DICT = { "camera0_input_field": 1, "camera0_input_resolution": 3, "camera0_input_format": 4, "camera0_input_default": 5, "camera0_output_resolution": 0, "camera0_output_format": 2, "camera1_input_field": 7, "camera1_input_resolution": 9, "camera1_input_format": 10, "camera1_input_default": 11, "camera1_output_resolution": 6, "camera1_output_format": 8 } def __init__(self): self.d = g_common_obj.get_device() self.camera_common = CameraCommon() self.get_cfg_file_helper = GetConfigFileHelper( "", "multicamera_apk_helper.conf") self.multimedia_setting = MultiMediaSetting( self.get_cfg_file_helper.cfg_file) need_install_result = self.multimedia_setting.install_apk( "multicamera_apk") if need_install_result: adb32._adb_reboot() time.sleep(15) self.multicamera_apk_package_name, _ = self.multimedia_setting.get_package_and_activity_name( "multicamera_apk") MULTI_CAMERA_PERMISSION_LIST = ["android.permission.CAMERA"] self.camera_common.grantPermission(self.multicamera_apk_package_name, MULTI_CAMERA_PERMISSION_LIST) def launch_multicamera_apk(self): return self.multimedia_setting.launch_apk("multicamera_apk") def stop_multicamera_apk(self): return self.multimedia_setting.stop_apk("multicamera_apk") def set_multicamera_config(self, config_list): logger.debug("set_multicamera_config start. config_list=%s" % config_list) for config_str in config_list: config_item, config_value = config_str.split(":") if config_item not in self.MULTI_CAMERA_CONFIG_DICT.keys(): continue logger.debug("config_item:%s, config_value:%s" % (config_item, config_value)) self.d(className="android.widget.Spinner")[ self.MULTI_CAMERA_CONFIG_DICT[config_item]].click.wait() time.sleep(1) self.d(textContains=config_value).click.wait() time.sleep(1) logger.debug("set_multicamera_config end.")
def appPrepare(self, case_name, model=1): cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_image.conf') self.video = CameraImpl(\ self.config.read(cfg_file, case_name)) self.multimedia_setting = MultiMediaSetting(cfg_file) self.multimedia_setting.install_apk("photo_apk") self.video.set_orientation_n() # Unlock screen g_common_obj.adb_cmd_capture_msg("input keyevent 82")
def appPrepare(self, case_name): cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_video.conf') self.video = PhotosImpl(\ self.config.read(cfg_file, case_name)) self.camera = CameraImpl(\ self.config.read(cfg_file, case_name)) self.multimedia_setting = MultiMediaSetting(cfg_file) g_common_obj.adb_cmd_capture_msg(" rm -rf /sdcard/DCIM/Camera/*") g_common_obj.adb_cmd_capture_msg(self.video.cfg.get("refresh_sd")) self.video.set_orientation_n() self.camera.clean_up_camera_data()
def appPrepare(self): self.camera = CameraCommon().switchPlatform() self.checkImage = CheckImage() self.multimedia_setting = MultiMediaSetting(CameraCommon.DEFAULT_CONFIG_FILE) self.video = CheckVideo() self.host_path = CameraCommon().getTmpDir() self.makefileTime = CameraCommon().makefileTime self.camera_dir = CameraCommon().camera_dir CameraCommon().removeDeivceFile() CameraCommon().removeFile(self.host_path + "/*") self.camera.cleanMediaFiles() CameraCommon().setOrientationToVertical() self.logger.debug("app prepare successfully")
def setUp(self): super(InstallAllVideoApp, self).setUp() self._test_name = __name__ print print "[Setup]: %s" % self._test_name cfg_file = 'tests.tablet.dut_init.conf' self.retry_num = self.config.read( cfg_file, 'init_list').get("delete_camera_folder_file") if self.retry_num is None: self.retry_num = 3 self.retry_num = int(self.retry_num) cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_video.conf') self.multimedia_setting = MultiMediaSetting(cfg_file)
def appPrepare(self, model=1): self.cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_drm.conf') self.cfg = self.config.read(self.cfg_file, self.case_name) self.multimedia_setting = MultiMediaSetting(self.cfg_file) self.multimedia_drm_helper = MultiMediaDRMHelper() self.multimedia_video_quality_helper = MultiMediaVideoQualityHelper() self.multimedia_setting.install_apk("netflix_apk") self.netflix_package_name, self.netflix_activity_name = self.multimedia_setting.get_package_and_activity_name("netflix_apk") # g_common_obj.set_vertical_screen() g_common_obj.stop_app_am(self.netflix_package_name) SystemUI().unlock_screen()
def setUp(self): """ @summary: set up @return: None """ super(CameraTest, self).setUp() self._test_name = __name__ self.logger.debug("[Setup]: %s" % self._test_name) self.case_result = -1 g_common_obj.root_on_device() g_common_obj.remount_device() self.camera_common = CameraCommon() self.multimedia_setting = MultiMediaSetting(self.camera_common.DEFAULT_CONFIG_FILE) self.host_path = self.camera_common.getTmpDir() self.multimedia_scale_test_helper = MultiMediaScaleTestHelper(self.host_path) self.multimedia_checkiq_helper = MultiMediaCheckiqHelper(self.host_path) self.android_version = MultiMediaSwitchCameraHelper(skip_import_camera=True).android_version.lower() self.multimedia_scale_test_helper.scale_test_prepare() self.camera_common.removeDeivceFile() self.camera_common.removeDeivceFile(self.multimedia_scale_test_helper.movies_folder_device_path + "*") self.camera_common.removeFile(self.host_path + "/*.mp4") self.camera_common.unlockScreen() self.d = g_common_obj.get_device() self.skipAccountLoginLyout() g_common_obj.back_home() if self.d(text="Got it").exists: self.d(text="Got it").click.wait()
def test_ref_camera_with_different_format(self, preview_format): assert 0, "Need OV10635 senser!" self.multimedia_setting = MultiMediaSetting( self.camera_common.DEFAULT_CONFIG_FILE) self.multimedia_setting.executeCommandWithPopen( "setprop camera.hal.perf 3") self.get_ref_camera_class().startCameraApp() self.get_ref_camera_class().selectMode("SingleShot") self.get_ref_camera_class().setSettingsButton("Preview Format", preview_format) preview_size_list = ["1280x800", "1280x720", "640x480"] for preview_size in preview_size_list: self.get_ref_camera_class().setSettingsButton( "Picture Size", preview_size) self.get_ref_camera_class().capturePhoto() self.camera_common.checkFileCorrupt(len(preview_size_list))
def setUp(self): """ @summary: set up @return: None """ super(CameraTest, self).setUp() self._test_name = __name__ self.logger.debug("[Setup]: %s" % self._test_name) g_common_obj.root_on_device() g_common_obj.remount_device() self.camera_common = CameraCommon() self.host_path = self.camera_common.getTmpDir() self.camera_common.removeDeivceFile() self.camera_common.removeFile(self.host_path + "/*") self.multimedia_setting = MultiMediaSetting(self.camera_common.DEFAULT_CONFIG_FILE) self.multimedia_scale_test_helper = MultiMediaScaleTestHelper(self.host_path) self.aosp_camera = AOSPCamera() self.aosp_camera.cleanMediaFiles() self.multimedia_scale_test_helper.remount_device() self.multimedia_scale_test_helper.backup_file("o_image_media_xml_file_dst_path") self.multimedia_scale_test_helper.replace_file("o_image_media_xml_file_src_path", "o_image_media_xml_file_dst_path") self.multimedia_scale_test_helper.backup_file("o_image_camera3_xml_file_dst_path")[0] self.multimedia_scale_test_helper.restore_file("o_image_camera3_xml_file_dst_path", "_hdmi") adb32._adb_reboot()
def __init__(self): self.d = g_common_obj.get_device() self.camera_common = CameraCommon() self.get_cfg_file_helper = GetConfigFileHelper( "", "multicamera_apk_helper.conf") self.multimedia_setting = MultiMediaSetting( self.get_cfg_file_helper.cfg_file) need_install_result = self.multimedia_setting.install_apk( "multicamera_apk") if need_install_result: adb32._adb_reboot() time.sleep(15) self.multicamera_apk_package_name, _ = self.multimedia_setting.get_package_and_activity_name( "multicamera_apk") MULTI_CAMERA_PERMISSION_LIST = ["android.permission.CAMERA"] self.camera_common.grantPermission(self.multicamera_apk_package_name, MULTI_CAMERA_PERMISSION_LIST)
def appPrepare(self, case_name, model=1): self.cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_video.conf') self.video = PhotosImpl(\ self.config.read(self.cfg_file, case_name)) g_common_obj.adb_cmd_capture_msg(" rm -rf /sdcard/DCIM/Camera/*") self.multimedia_handle = MultiMediaHandle() self.multimedia_setting = MultiMediaSetting(self.cfg_file) self.multimedia_setting.clearFolder(self.video.cfg.get("remove_video")) time.sleep(2) if model == 1: self.push_path = self.multimedia_setting.push_file(self.video.cfg.get("push_video"), self.video.cfg.get("datapath")) self.multimedia_setting.install_apk("video_apk") self.video.set_orientation_n() # Unlock screen g_common_obj.adb_cmd_capture_msg("input keyevent 82")
def __init__(self, toolPath="", tempDir=""): if toolPath != "": self.tool = toolPath #The folder where "IQCheck" exists else: from testlib.multimedia.multimedia_setting import MultiMediaSetting from testlib.camera.CameraCommon import CameraCommon multimedia_setting = MultiMediaSetting( CameraCommon().DEFAULT_CONFIG_FILE) localPath = CameraCommon().getTmpDir() binName = "IQCheck" remoteToolBinary = multimedia_setting.download_file_to_host( "Multimedia_Camera/apk/" + binName) self.tool = localPath + "/" + binName print self.tool if os.path.exists(self.tool) == False: os.system("cp " + remoteToolBinary + " " + self.tool) os.system("chmod 777 " + self.tool) self.tempDir = tempDir
def appPrepare(self, model=1): self.cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_drm.conf') self.cfg = self.config.read(self.cfg_file, self.case_name) # read config file self.multimedia_setting = MultiMediaSetting(self.cfg_file) self.multimedia_drm_helper = MultiMediaDRMHelper() self.multimedia_video_quality_helper = MultiMediaVideoQualityHelper() self.multimedia_setting.install_apk( "exoplayer_apk") #install exoplayer apk self.exoplayer_package_name, self.exoplayer_activity_name = self.multimedia_setting.get_package_and_activity_name( "exoplayer_apk") #get app info # g_common_obj.set_vertical_screen() g_common_obj.stop_app_am(self.exoplayer_package_name) g_common_obj.adb_cmd_capture_msg("input keyevent 82") #Unlock screen
def __init__(self, cfg=None): if cfg == None: self.cfg = self.config.read(CameraCommon.DEFAULT_CONFIG_FILE, "multimedia_camera") else: self.cfg = cfg self.d = g_common_obj.get_device() self.logger = CameraLogger.instance() self.x = self.d.info["displayWidth"] self.y = self.d.info["displayHeight"] self.camera_widget = self.CameraWidget() self.camera_common = CameraCommon() self.multimedia_setting = MultiMediaSetting( self.camera_common.DEFAULT_CONFIG_FILE) self.multimedia_setting.install_apk("ref_camera_1_apk") self.camera_common.grantPermission(self.PACKAGE_NAME_REFCAMCAMERA, self.PERMISSION_LIST)
def setUp(self): """ @summary: set up @return: None """ super(CameraTest, self).setUp() self._test_name = __name__ self.logger.debug("[Setup]: %s" % self._test_name) g_common_obj.root_on_device() g_common_obj.remount_device() self.camera_common = CameraCommon() self.evs_vts_test_config = self.config.read( self.camera_common.DEFAULT_CONFIG_FILE, "evs_vts_test_config") self.multimedia_setting = MultiMediaSetting( self.camera_common.DEFAULT_CONFIG_FILE) adb32.adb_disable_verity() self.prepare_env()
def appPrepare(self, case_name, model=1): cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_image.conf') self.video = PhotosImpl(\ self.config.read(cfg_file, case_name)) self.multimedia_handle = MultiMediaHandle() self.multimedia_setting = MultiMediaSetting(cfg_file) self.multimedia_setting.install_apk("photo_apk") self.multimedia_setting.install_apk("alarm_apk") self.video.set_orientation_n() if self.video.cfg.get("push_picture") is not None: self.multimedia_setting.push_file( self.video.cfg.get("push_picture"), self.video.cfg.get("datapath")) refresh_sd_cmd = self.config.read(cfg_file, 'common_cmd')['refresh_sd'] g_common_obj.adb_cmd_capture_msg(refresh_sd_cmd) # Unlock screen g_common_obj.adb_cmd_capture_msg("input keyevent 82")
def appPrepare(self, case_name): cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_video.conf') self.video = PhotosImpl(\ self.config.read(cfg_file, case_name)) self.file_name = self.video.cfg.get("push_video").split( "/")[-1].replace("\"", "") self.push_path = self.video.cfg.get("push_video").split( "\" \"")[1].replace("\"", "") self.multimedia_handle = MultiMediaHandle() self.multimedia_setting = MultiMediaSetting(cfg_file) self.multimedia_setting.clearFolder(self.video.cfg.get("remove_video")) time.sleep(2) self.multimedia_setting.push_file(self.video.cfg.get("push_video"), self.video.cfg.get("datapath")) self.video.set_orientation_n() # Unlock screen g_common_obj.adb_cmd_capture_msg(self.video.cfg.get("refresh_sd")) g_common_obj.adb_cmd_capture_msg("input keyevent 82")
def __init__(self, host_path): self.host_path = host_path multimedia_setting = MultiMediaSetting( CameraCommon().DEFAULT_CONFIG_FILE) self.iq_check_file_path = multimedia_setting.download_file_to_host( "Multimedia_Camera/apk/IQCheck") os.chmod(self.iq_check_file_path, stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH) self.__execute_command_with_popen("chmod 777 %s" % self.iq_check_file_path) self.zxing_jar_file_path = multimedia_setting.download_file_to_host( "Multimedia_Camera/apk/zxing-analyzer.jar") self.home_path = os.environ['HOME'] self.temp_dir = os.path.join(self.home_path, "tmp/checkiq_temp_dir/") if not os.path.exists(self.temp_dir): os.makedirs(self.temp_dir) self.check_IQ = CheckIQ(self.iq_check_file_path, self.temp_dir) self.num_list = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
def check_ref_camera_preview_with_format(self, preview_format, duration=10): self.android_version = MultiMediaSwitchCameraHelper( skip_import_camera=True).android_version.lower() if "o" in self.android_version: self.multimedia_setting = MultiMediaSetting( self.camera_common.DEFAULT_CONFIG_FILE) self.multimedia_setting.install_apk( "for_o_image_camera_preview_test_apk") from testlib.multimedia.get_device_port_helper import GetConfigFileHelper self.scale_test_cfg = GetConfigFileHelper( "", "multimedia_scale_test_helper.conf").get_section("config") self.o_image_play_cmd = self.scale_test_cfg.get("o_image_play_cmd") check_size_list = ["720x480", "640x480", "320x240", "176x144"] from testlib.graphics.common import adb32 adb32._adb_reboot() time.sleep(15) for size in check_size_list: width, height = size.split("x") result = g_common_obj.adb_cmd_capture_msg( self.o_image_play_cmd % (width, height, preview_format, duration)) assert "OK" in result, "play error! result=%s" % result time.sleep(2) else: self.get_ref_camera_class().startCameraApp() self.get_ref_camera_class().selectMode("SingleShot") self.get_ref_camera_class().setSettingsButton( "Preview Format", preview_format) check_size_list = [ "1920x1080", "1280x720", "720x480", "640x480", "320x240", "176x144" ] for size in check_size_list: self.logger.debug("capture photo, format: %s, size: %s" % (preview_format, size)) self.get_ref_camera_class().setSettingsButton( "Picture Size", size) self.get_ref_camera_class().capturePhoto() self.camera_common.checkFileCorrupt(len(check_size_list))
def appPrepare(self): self.camera = CameraCommon().switchPlatform(None, False, True, False, True) # self.camera = RefCam2Camera() self.common = CameraCommon() self.multimedia_setting = MultiMediaSetting( CameraCommon.DEFAULT_CONFIG_FILE) # self.camera = self.common.switchPlatform() self.checkImage = CheckImage() self.video = CheckVideo() # self.checkIQ = CheckIQ() self.host_path = self.common.getTmpDir() self.makefileTime = self.common.makefileTime self.camera_dir = self.common.camera_dir self.common.removeDeivceFile() self.common.removeFile(self.host_path + "/*") self.camera.cleanMediaFiles() # self.common.setOrientationToVertical() self.logger.debug("app prepare successfully") self.device = self.common.initDevice() self.common.resetDevice(self.device)
def setUp(self): """ @summary: set up @return: None """ super(VideoAPITest, self).setUp() self.d = g_common_obj.get_device() self._test_name = __name__ self.x = self.d.info["displayWidth"] self.y = self.d.info["displayHeight"] print "[Setup]: %s" % self._test_name g_common_obj.stop_app_am( "videoplayer.app.instrument.otc.intel.com.otcvideoplayer") # Unlock screen g_common_obj.adb_cmd_capture_msg("input keyevent 82") self.cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_video.conf') self.multimedia_setting = MultiMediaSetting(self.cfg_file) self.hardware = self.multimedia_setting.get_paltform_hardware() self.tag = "[Decode API] "
def appPrepare(self, case_name): cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_video.conf') self.video = PhotosImpl(\ self.config.read(cfg_file, case_name)) self.camera = CameraImpl(\ self.config.read(cfg_file, case_name)) self.multimedia_handle = MultiMediaHandle() g_common_obj.adb_cmd_capture_msg(" rm -rf /sdcard/DCIM/Camera/*") g_common_obj.adb_cmd_capture_msg(self.video.cfg.get("refresh_sd")) self.multimedia_setting = MultiMediaSetting(cfg_file) self.multimedia_setting.install_apk("video_apk") self.multimedia_setting.install_apk("alarm_apk") self.multimedia_setting.install_apk("ffmpegCLI_apk") self.multimedia_setting.install_apk("EncodeAndMux_4K_Encode_apk") self.video.set_orientation_n() self.camera.clean_up_camera_data() if self.video.cfg.get("push_video") != None: self.multimedia_setting.clearFolder(self.video.cfg.get("remove_video")) self.push_path = self.multimedia_setting.push_file(self.video.cfg.get("push_video"), self.video.cfg.get("datapath"))
class InstallAllVideoApp(UIATestBase): def setUp(self): super(InstallAllVideoApp, self).setUp() self._test_name = __name__ print print "[Setup]: %s" % self._test_name cfg_file = 'tests.tablet.dut_init.conf' self.retry_num = self.config.read( cfg_file, 'init_list').get("delete_camera_folder_file") if self.retry_num is None: self.retry_num = 3 self.retry_num = int(self.retry_num) cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ 'tests.tablet.mum_auto_video.conf') self.multimedia_setting = MultiMediaSetting(cfg_file) def tearDown(self): super(InstallAllVideoApp, self).tearDown() print "[Teardown]: %s" % self._test_name def testInstallAllVideoApp(self): """ delete all camera folder files """ print "[RunTest]: %s" % self.__str__() succeed = False for _ in range(self.retry_num): try: self.multimedia_setting.install_apk("video_apk") self.multimedia_setting.install_apk("alarm_apk") self.multimedia_setting.install_apk("photo_apk") succeed = True break except Exception as e: print e assert succeed
def appPrepare(self,): # cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \ # 'tests.testplan.camera.conf') # current_platform = CameraCommon().getPlatform() # self.camera = GMSCamera(self.config.read(cfg_file, "multimedia_camera")) #self.camera = ArcSoftCamera(self.config.read(cfg_file, "multimedia_camera")) self.camera = CameraCommon().switchPlatform() self.multimedia_setting = MultiMediaSetting(CameraCommon().DEFAULT_CONFIG_FILE) self.video = CheckVideo() self.checkImage = CheckImage() self.deviceControl = DeviceControl() self.host_path = CameraCommon().getTmpDir() self.makefileTime = CameraCommon().makefileTime self.camera_dir = CameraCommon().camera_dir CameraCommon().removeDeivceFile() CameraCommon().removeFile(self.host_path + "/*") self.camera.cleanMediaFiles() #CameraCommon().setOrientationToVertical() self.logger.debug("app prepare successfully")
def setUp(self): """ @summary: set up @return: None """ super(CameraTest, self).setUp() self._test_name = __name__ self.logger.debug("[Setup]: %s" % self._test_name) g_common_obj.root_on_device() g_common_obj.remount_device() self.camera_common = CameraCommon() self.host_path = self.camera_common.getTmpDir() self.camera_common.removeDeivceFile() self.camera_common.removeFile(self.host_path + "/*") self.multimedia_setting = MultiMediaSetting( self.camera_common.DEFAULT_CONFIG_FILE) self.aosp_camera = AOSPCamera() self.adb_extension = AdbExtension() self.aosp_camera.cleanMediaFiles() self.adb_extension._adb_reboot()