Beispiel #1
0
class RunPresentation(RenderAppTestBase):
    @classmethod
    def setUpClass(self):
        '''
        install apk
        '''
        super(RunPresentation, self).setUpClass()
        SampleApiDemoImpl().install_apk()

    def setUp(self):
        super(RunPresentation, self).setUp()
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self._runPresentation = SampleApiDemoImpl()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(RunPresentation, self).tearDown()
        self._runPresentation.stop_app_am()
        self._runPresentation = None

    def test_start_presentation(self):
        self._runPresentation.launch_app_am()
        self._runPresentation.start_presentation()

    def test_presentation_through_mediarouter(self, delay=21):
        self._runPresentation.launch_app_am()
        self._runPresentation.countdown_t0_perform_presentation_through_mediarouter(
            delay)
Beispiel #2
0
 def setUp(self):
     super(VirtualDisplay, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     self.apk = get_resource_from_atifactory(CONFIG_FILE, SECTION, 'name')
     self.d = g_common_obj.get_device()
     self.apiDemoImpl = SampleApiDemoImpl()
     self.photoImpl = get_photo_implement()
     self.photoImpl.stop_photos_am()
     self.photoImpl.rm_delete_photos()
     self.photoImpl.refresh_sdcard()
class SwitchCameraPreview(RenderAppTestBase):
    @classmethod
    def setUpClass(self):
        super(SwitchCameraPreview, self).setUpClass()
        self._demoInstance = SampleApiDemoImpl()
        self._demoInstance.install_apk()

    def setUp(self):
        super(SwitchCameraPreview, self).setUp()
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(SwitchCameraPreview, self).tearDown()
        self._demoInstance = None

    def test_Switch_Camera(self):
        SystemUI().unlock_screen()
        self._demoInstance.switch_camera_preview()
Beispiel #4
0
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()
Beispiel #5
0
    def swichbetweenhomemenus(self, homemenucycle=10):
        """
            action as method names
        """
        SampleApiDemoImpl().unlock()
        self._device.screen.on()
        self._device.press.menu()

        for x in xrange(1, homemenucycle):
            self._device.press.home()
            if self._device(description="Apps").wait.exists(timeout=3000):
                self._device(description="Apps").click()
            else:
                self._device(description="Apps list").click.wait(timeout=3000)
            self._device.press.menu()
            print "[Info:complete %x times]" % x
Beispiel #6
0
 def init_dut_squeence(self):
     """
         seqeueence of predebugplan
     """
     self.__init__()
     SampleApiDemoImpl().unlock()
     self.func.push_uiautomator_jar()
     g_common_obj.set_vertical_screen()
     self.enable_developer_option()
     self.keep_awake()
     self.func.wake_up()
     self.add_google_account()
     self.init_playstore()
     self.func.init_camera()
     self.init_chrome()
     self.func.init_photo()
     self.init_googlemap()
     self.init_hangout()
     self.init_playmusic()
     self.func.init_youtube()
Beispiel #7
0
 def setUp(self):
     super(RunPresentation, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     self._runPresentation = SampleApiDemoImpl()
Beispiel #8
0
 def setUpClass(self):
     '''
     install apk
     '''
     super(RunPresentation, self).setUpClass()
     SampleApiDemoImpl().install_apk()
 def setUpClass(cls):
     super(TestGLSurface, cls).setUpClass()
     _runPresentation = SampleApiDemoImpl()
     _runPresentation.install_apk()
class TestGLSurface(RenderAppTestBase):
    @classmethod
    def setUpClass(cls):
        super(TestGLSurface, cls).setUpClass()
        _runPresentation = SampleApiDemoImpl()
        _runPresentation.install_apk()

    def setUp(self):
        super(TestGLSurface, self).setUp()
        self._test_name = __name__
        print "[Setup]:  %s" % self._test_name
        self._runPresentation = SampleApiDemoImpl()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(TestGLSurface, self).tearDown()
        g_common_obj.shell_cmd("ps -ef | grep "
                               'adb'
                               " | awk '{print $2}' | xargs killall")

    def testsTranslucent_GLSurface(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_translucent_glsurfaceview(timeout)

    def test_countdown_t0_test_compresstexture(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_test_compresstexture(timeout)

    def test_countdown_t0_test_cubemap(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_test_cubemap(timeout)

    def test_countdown_t0_test_framebufferobject(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_test_framebufferobject(timeout)

    def test_countdown_t0_test_kube(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_test_kube(timeout)

    def test_countdown_t0_test_matrixpaletteskining(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_test_matrixpaletteskining(timeout)

    def test_countdown_t0_test_opengles20(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_test_opengles20(timeout)

    def test_countdown_t0_test_glsurfaceview(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_test_glsurfaceview(timeout)

    def test_countdown_t0_test_spritetextactivity(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_test_spritetextactivity(timeout)

    def test_countdown_t0_test_texturedtriangle(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_test_texturedtriangle(timeout)

    def test_countdown_t0_test_touchrotate(self, timeout=1800):
        self._runPresentation.stop_app_am()
        self._runPresentation.countdown_t0_test_touchrotate(timeout)
 def setUpClass(self):
     super(SwitchCameraPreview, self).setUpClass()
     self._demoInstance = SampleApiDemoImpl()
     self._demoInstance.install_apk()
Beispiel #12
0
 def setUp(self):
     super(HDMI, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     self.apiDemoImpl = SampleApiDemoImpl()
     self.develop_settings = DevelopmentSettingsImpl()
Beispiel #13
0
 def setUpClass(self):
     super(HDMI, self).setUpClass()
     SampleApiDemoImpl().install_apk()
Beispiel #14
0
class VirtualDisplay(UIATestBase):
    def setUp(self):
        super(VirtualDisplay, self).setUp()
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.apk = get_resource_from_atifactory(CONFIG_FILE, SECTION, 'name')
        self.d = g_common_obj.get_device()
        self.apiDemoImpl = SampleApiDemoImpl()
        self.photoImpl = get_photo_implement()
        self.photoImpl.stop_photos_am()
        self.photoImpl.rm_delete_photos()
        self.photoImpl.refresh_sdcard()

    def tearDown(self):
        super(VirtualDisplay, self).tearDown()
        print "[Teardown]: %s" % self._test_name
        self.photoImpl.stop_photos_am()
        self.photoImpl.rm_delete_photos()
        self.photoImpl.refresh_sdcard()

    def test_Virtual_DisplayTest(self):
        if not pkgmgr._package_installed(PACKAGE_NAME):
            g_common_obj.adb_cmd_common("install -r %s" % self.apk)
        assert adb32.run_instrument_test(CLASS_NAME,
                                         PACKAGE_NAME), "Test failed."

    def test_VirtualDisplay_HDMI(self):
        self.apiDemoImpl.install_apk()
        multi_display.is_multi_displayed()
        self.apiDemoImpl.launch_app_am()
        self.apiDemoImpl.perform_presentation_through_mediarouter()
        multi_display.is_presentation_with_mediarouter()
        self.apiDemoImpl.start_presentation()
        multi_display.is_presentation()

    def test_VirtualDispaly_screenshots(self):
        # get right top corner for capturing time date.
        x, y = self.d.info['displayWidth'], self.d.info['displayHeight']
        sx, sy, ex, ey = x - 300, 0, x, 100
        target_strs = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', ':']
        img_text = compare_pic.extract_strings_from_croped_screen_shot(
            0, sx, sy, ex, ey)
        assert (i in img_text
                for i in target_strs), 'Fail to get correct screenshot.'

    def test_VirtualDispaly_RecordingVideo(self):
        video_record_file = '/sdcard/Movies/demo.mp4'
        g_common_obj.shell_cmd('adb shell rm %s' % video_record_file)

        # do something during video recording. or not duration will be 0.
        def launch_settings_app():
            from testlib.graphics.common import launch_settings_am
            LOG.info("Launch settings app during video recording.")
            _d = g_common_obj.get_device()
            for i in range(2):
                launch_settings_am()
                _d.press.home()
                time.sleep(1)

        thread = threading.Timer(2, launch_settings_app)
        thread.start()

        LOG.info("Start video recording for 20 seconds.")
        g_common_obj.adb_cmd_capture_msg('screenrecord %s --time-limit 20' %
                                         video_record_file)
        time.sleep(2)
        self.photoImpl.play_video_command(video_record_file, 20)
        g_common_obj.assert_exp_happens()