class HDMI(UIATestBase): @classmethod def setUpClass(self): super(HDMI, self).setUpClass() SampleApiDemoImpl().install_apk() def setUp(self): super(HDMI, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name self.apiDemoImpl = SampleApiDemoImpl() self.develop_settings = DevelopmentSettingsImpl() def tearDown(self): print "[Teardown]: %s" % self._test_name super(HDMI, self).tearDown() self.apiDemoImpl.stop_app_am() self.apiDemoImpl = None def test_HDMI_1_4(self): multi_display.is_multi_displayed() self.apiDemoImpl.launch_app_am() self.apiDemoImpl.perform_presentation_through_mediarouter() multi_display.is_presentation_with_mediarouter() assert logcat.check_dumpsys_SurfaceFlinger_info_with_multiple_keys(\ keyword="SurfaceView", assertword=['1920','3840']),\ "Fail to get SurfaceView info from dumpsys log." def test_OGL_Pre_rotation_Optimization(self): print "[RunTest]: %s" % self.__str__() adb32.change_automatic_rotation(0) # Turn off auto rotation self.develop_settings.set_disable_hw_overlays(switch='ON') rotate_range = [1, 2, 3, 0] for i in rotate_range: adb32.screen_rotation(i) time.sleep(.5) self.develop_settings.set_disable_hw_overlays(switch='OFF') g_common_obj.assert_exp_happens() def test_DisplayInterface_HDMI_FHD(self): multi_display.is_multi_displayed() html5.check_chrome_installed() youtube_video_url, youtube_video_key = chrome_impl.get_youtube_url_key( 'american_bobtail', 'key_american_bobtail') g_common_obj.assert_exp_happens() chrome_impl.launch() chrome_impl.chrome_setup() chrome_impl.open_website(youtube_video_url) chrome_impl.web_check(youtube_video_key, 15) def test_HDMI_Idle(self): multi_display.is_multi_displayed() multi_display.is_clone_mode() adb32.adb_shell_stop() adb32.adb_shell_start() def test_HDMI_CloneMode(self): multi_display.is_multi_displayed() multi_display.is_clone_mode()
class GPUCompositionTest(UIATestBase): @classmethod def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(GPUCompositionTest, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() def setUp(self): print "[Setup]:%s" % self.__class__.__name__ super(GPUCompositionTest, self).setUp() self.benchmark = GLBenchmarkExtendImpl() self.systemui = SystemUiExtendImpl() self.systemui.unlock_screen() self.d.screen.on() self.d.press.menu() self.benchmark.clean() self.benchmark.setup() self.develop_settings = DevelopmentSettingsImpl() self.develop_settings.set_disable_hw_overlays('ON') def tearDown(self): print "[tearDown]:%s" % self.__class__.__name__ super(GPUCompositionTest, self).tearDown() self.benchmark.clean() self.develop_settings.set_disable_hw_overlays('OFF') @classmethod def tearDownClass(cls): print "[tearDownClass]: %s" % cls.__name__ super(GPUCompositionTest, cls).tearDownClass() def test_GPU_Composition(self): """ test_GPU_Composition Steps: 1. Start GLBenchmark 2.7.0 and run the Egypt HD ETC1 Onscreen test. The test runs without any errors and the workload images are properly displayed on the screen and we don't have artifacts. """ print "[RunTest]: %s" % self.__str__() print """[Step] 1. Start GLBenchmark 2.7 and run the Egypt HD ETC1 Onscreen test. The test runs without any errors and the workload images are properly displayed on the screen and we don't have artifacts.""" self.benchmark.launch() self.benchmark.run_performance_test("test25") self.benchmark.check_all_results() g_common_obj.assert_exp_happens() def test_GPU_Composition_Mesa(self): assert logcat.check_dumpsys_SurfaceFlinger_info( True, 'GLES.*Mesa', 'Mesa'), "It's not mesa." self.benchmark.launch() self.benchmark.run_performance_test("test25") self.benchmark.check_all_results() g_common_obj.assert_exp_happens()
def setUp(self): super(HWComposer2, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name g_common_obj.root_on_device() self.d = g_common_obj.get_device() wifi_ctrl.turn_off() self.systemTouch = SystemTouch() self.develop_settings = DevelopmentSettingsImpl()
def setUp(self): super(HWComposer, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name g_common_obj.root_on_device() self.d = g_common_obj.get_device() self._extendcamera = CameraExtendImpl() self.photoImpl = get_photo_implement() self.develop_settings = DevelopmentSettingsImpl() self.develop_settings.set_disable_hw_overlays(switch='ON')
class HWComposer(UIATestBase): def setUp(self): super(HWComposer, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name g_common_obj.root_on_device() self.d = g_common_obj.get_device() self._extendcamera = CameraExtendImpl() self.photoImpl = get_photo_implement() self.develop_settings = DevelopmentSettingsImpl() self.develop_settings.set_disable_hw_overlays(switch='ON') def tearDown(self): print "[Teardown]: %s" % self._test_name super(HWComposer, self).tearDown() self.develop_settings.set_disable_hw_overlays(switch='OFF') def test_HWComposer_camera_preview(self): print "[RunTest]: %s" % self.__str__() self._extendcamera.picTake() g_common_obj.assert_exp_happens() self._extendcamera.delete_capture_pictures() def test_HWComposer_suspend_resume(self): ''' Not using power button to suspend DUT since adb will disconnect. Replace with shell stop and start command to turn off / on display. ''' adb32.refresh_ui() def test_HWComposer_video_playback(self): print "[RunTest]: %s" % self.__str__() Html5Impl().check_chrome_installed() video_path = '/sdcard/video.mp4' youtube_video_url, youtube_video_key = chrome_impl.get_youtube_url_key('american_bobtail', 'key_american_bobtail') self.photoImpl.deploy_photo_content("Videos", "video_006", video_path) self.photoImpl.refresh_sdcard() self.photoImpl.play_video_command(video_path, 8) g_common_obj.assert_exp_happens() self.photoImpl.stop_photos_am() chrome_impl.launch() chrome_impl.chrome_setup() chrome_impl.open_website(youtube_video_url) chrome_impl.web_check(youtube_video_key, 15) def test_HWComposer_video_recording(self): print "[RunTest]: %s" % self.__str__() self._extendcamera.videoRecord() g_common_obj.assert_exp_happens() self._extendcamera.delete_captured_video()
def setUp(self): print "[Setup]:%s" % self.__class__.__name__ super(GPUCompositionTest, self).setUp() self.benchmark = GLBenchmarkExtendImpl() self.systemui = SystemUiExtendImpl() self.systemui.unlock_screen() self.d.screen.on() self.d.press.menu() self.benchmark.clean() self.benchmark.setup() self.develop_settings = DevelopmentSettingsImpl() self.develop_settings.set_disable_hw_overlays('ON')
class GPUCompositionFallbackTest(UIATestBase): @classmethod def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(GPUCompositionFallbackTest, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() def setUp(self): print "[Setup]:%s" % self.__class__.__name__ super(GPUCompositionFallbackTest, self).setUp() self.benchmark = GLBenchmarkExtendImpl() self.systemui = SystemUiExtendImpl() self.develop_settings = DevelopmentSettingsImpl() self.systemui.unlock_screen() self.d.screen.on() self.d.press.menu() self.benchmark.clean() self.benchmark.setup() self.develop_settings.set_disable_hw_overlays(switch='ON') def tearDown(self): print "[tearDown]:%s" % self.__class__.__name__ super(GPUCompositionFallbackTest, self).tearDown() self.benchmark.clean() self.develop_settings.set_disable_hw_overlays('OFF') g_common_obj.set_vertical_screen() @classmethod def tearDownClass(cls): print "[tearDownClass]: %s" % cls.__name__ super(GPUCompositionFallbackTest, cls).tearDownClass() def test_GPU_CompositionFallback(self): """ test_GPU_CompositionFallback Steps: 1. Enable "Disable HW overlays" in developer options 2. adb shell dumpsys SurfaceFlinger | grep -wi "GLES " GLES | xxxx | xxxx | xxxx | xx | xxxx | 3. Start GLBenchmark 2.7 and run the Egypt HD ETC1 Onscreen test. The test runs without any errors and the workload images are properly displayed on the screen and we don't have artifacts. """ assert logcat.check_dumpsys_SurfaceFlinger_info( True, 'GLES.*', 'GLES'), "Not found GLES info" print """[Step] 3. Start GLBenchmark 2.7 and run the Egypt HD ETC1 Onscreen test. The test runs without any errors and the workload images are properly displayed on the screen and we don't have artifacts.""" self.benchmark.launch() self.benchmark.run_performance_test("test25") self.benchmark.check_all_results() g_common_obj.assert_exp_happens() def test_GPU_CompositionFallback_Mesa(self): assert logcat.check_dumpsys_SurfaceFlinger_info( True, 'GLES.*Mesa', 'Mesa'), "Not found GLES info" self.benchmark.launch() self.benchmark.run_performance_test("test25") self.benchmark.check_all_results() g_common_obj.assert_exp_happens()
def setUp(self): super(HDMI, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name self.apiDemoImpl = SampleApiDemoImpl() self.develop_settings = DevelopmentSettingsImpl()
class HWComposer2(UIATestBase): def setUp(self): super(HWComposer2, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name g_common_obj.root_on_device() self.d = g_common_obj.get_device() wifi_ctrl.turn_off() self.systemTouch = SystemTouch() self.develop_settings = DevelopmentSettingsImpl() def tearDown(self): print "[Teardown]: %s" % self._test_name super(HWComposer2, self).tearDown() dbsetting.set_color_corretion(False) dbsetting.set_color_inversion(False) self.develop_settings.set_input_options(switch='OFF') wifi_ctrl.turn_on() def test_HWComposer_2_0_Check_state(self): print "[RunTest]: %s" % self.__str__() special_actions.setup() def long_touch_operation(): print "Starting long touch operation." special_actions.long_touch_on_1_1() self.develop_settings.set_disable_hw_overlays(switch='OFF') self.develop_settings.set_input_options(switch='ON') logcat.check_dumpsys_SurfaceFlinger_info(keyword="h/w composer enabled", assertword="h/w composer enabled") primaryPlaneInfo = file_sys.get_file_context(matchCase=True, file_path='/d/dri/0/i915_display_info', keyword='Plane.*PRI', extend=True, ext_cmd="cut -d 'x' -f2 | cut -d '=' -f2") assert int(primaryPlaneInfo) > 0, "Invalid primary plane info." thread = threading.Timer(2, long_touch_operation) thread.start() check_list = [] for i in range(6): time.sleep(.5) pointerPlaneInfo = file_sys.get_file_context(matchCase=True, file_path='/d/dri/0/i915_display_info', keyword='Plane.*CUR', extend=True, ext_cmd="cut -d 'x' -f2 | cut -d '=' -f2") check_list.append(pointerPlaneInfo) assert sum(int(i) for i in check_list) > 0, "Pointer info not detected." def test_HWComposer_2_0_Color_correction(self): print "[RunTest]: %s" % self.__str__() pre_chk = logcat.check_dumpsys_SurfaceFlinger_info(True, 'composer', 'enabled') assert pre_chk, "Color correction is already taking effect." dbsetting.set_color_corretion(True) assert dbsetting.get_color_corretion() == 1, "Fail to enable color correction." for i in [11, 12, 13]: # Three mode in color correction dbsetting.set_color_corretion_mode(i) assert dbsetting.get_color_corretion_mode() == i, "Fail to set color correction mode." count = 0 for i in range(5): time.sleep(1) count += logcat.check_dumpsys_SurfaceFlinger_info(True, 'composer', 'disabled') if count > 0: break assert count > 0, "Color inversion isn't taking effect." def test_HWComposer_2_0_Color_inversion(self): print "[RunTest]: %s" % self.__str__() pre_chk = logcat.check_dumpsys_SurfaceFlinger_info(True, 'composer', 'enabled') assert pre_chk, "Color inversion is already taking effect." dbsetting.set_color_inversion(True) assert dbsetting.get_color_inversion() == 1, "Fail to enable color inversion." count = 0 for i in range(5): time.sleep(1) count += logcat.check_dumpsys_SurfaceFlinger_info(True, 'composer', 'disabled') if count > 0: break assert count > 0, "Color inversion isn't taking effect."