Exemple #1
0
 def test_scaling_rotation_Video(self):
     ''' refer TC test_Scaling_Rotation_Video
     '''
     print "[RunTest]: %s" % self.__str__()
     self._composeui.play_video_command_mx(self.remote_path)
     time.sleep(2)
     if self.d(textContains="START OVER").exists:
         self.d(textContains="START OVER").click.wait()
     for i in [2, 1, 3, 0]:
         adb32.screen_rotation(i)
         time.sleep(1)
         if self.d(resourceId="com.mxtech.videoplayer.ad:id/ui_layout"
                   ).exists:
             self.d(resourceId="com.mxtech.videoplayer.ad:id/ui_layout"
                    ).pinch.Out(percent=120)
             time.sleep(2)
             assert self._qr.decode_image_qrcode(
                 self.d.screenshot("tmp.png")
             )[1] == "QRCODE_TEST_STRING", "The scaling of video playback failed!"
             self.d(resourceId="com.mxtech.videoplayer.ad:id/ui_layout"
                    ).pinch.In(percent=70, steps=5)
             time.sleep(2)
             assert self._qr.decode_image_qrcode(
                 self.d.screenshot("tmp.png")
             )[1] == "QRCODE_TEST_STRING", "The scaling of video playback failed!"
Exemple #2
0
 def setUp(self):
     super(DebugModeSimulateSecondaryDisplayDrag, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     self._debugmodeDrag = DebugModeDragImpl()
     self._debugmode = DebugModeImpl()
     adb32.screen_rotation(0)
Exemple #3
0
 def tearDown(self):
     g_common_obj.back_home()
     if self.split_window_impl.split_button.exists: self.split_window_impl._exit_split()
     wifi_ctrl.turn_on()
     adb32.screen_rotation(0)
     try:
         game_impl.uninstall_hillclimb()
     except:
         pass
Exemple #4
0
 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 tearDown(self):
     print "[Teardown]: %s" % self._test_name
     super(Fit, self).tearDown()
     self.photos.rm_delete_photos()
     self.photos.refresh_sdcard()
     g_common_obj.stop_app_am("com.google.android.apps.photos")
     try:
         os.remove(".tmp.png")
     except OSError:
         pass
     adb32.screen_rotation(0)
 def setUp(self):
     super(Fit, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     self.photos = get_photo_implement()
     self.d = g_common_obj.get_device()
     self.d.screen.on()
     self._qr = QRcode()
     self.extend_photos = PhotosExtendImpl()
     self.remote_path = self.extend_photos.push_videos(count=1, like='test_video_qr', exts='.mp4')[0]
     adb32.screen_rotation(0)
 def test_switch_portrait_landscape_apps_serval_times(self):
     ''' refer TC test_switch_portrait_landscape_apps_serval_times
     '''
     print "[RunTest]: %s" % self.__str__()
     n = 5
     self.photos.play_video_command(self.remote_path)
     while n > 0:
         for i in [2, 1, 3, 0]:
             adb32.screen_rotation(i)
             time.sleep(10)
             assert self._qr.decode_image_qrcode(self.d.screenshot(".tmp.png"))[1] == "QRCODE_TEST_STRING", "Video playback failed!"
         n = n - 1
Exemple #8
0
 def test_ImageEdit_ThumbMD_One_Rotate(self):
     print "[RunTest]: %s" % self.__str__()
     try:
         self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                              self.PHOTO_PATH)
         self.photosImpl.refresh_sdcard()
         self.photosImpl.launch_photos_am()
         self.photosImpl.open_a_picture()
         adb32.screen_rotation(1)
     except:
         raise Exception("Test failed!")
     finally:
         adb32.screen_rotation(0)
Exemple #9
0
 def setUp(self):
     super(ComposeUI, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     self.d = g_common_obj.get_device()
     #         self.photos = get_photo_implement()
     self._composeui = ComposeUiImpl()
     config_handle = ConfigHandle()
     result = config_handle.check_apps("com.mxtech.videoplayer.ad")
     if result == 0:
         self._composeui.install_apk('Mxplayer')
     self.d.screen.on()
     self._qr = QRcode()
     self.extend_photos = PhotosExtendImpl()
     self.remote_path = self.extend_photos.push_videos(
         count=1, like='test_video_qr_middle', exts='.mp4')[0]
     adb32.screen_rotation(0)
Exemple #10
0
 def test_MultiWindow_SplitScreen_PlayGame_ImgeViewing(self):
     wifi_ctrl.turn_off()
     game_impl.install_apk("HillClimb")
     game_impl.launch_hillclimb_am()
     game_impl.play_hillclimb()
     self.split_window_impl.split_app_window("Hill Climb Racing", "left")
     try:
         # Close recent dashboard
         self.d(resourceId='com.android.systemui:id/title', description='Chrome').click.wait()
     except:
         pass
     rotate_value = [1, 2, 3, 0] * 8 # Rotate 32 times.
     LOG.info("Start rotation")
     for r in rotate_value:
         adb32.screen_rotation(r)
         time.sleep(1)
     for i in range(2):
         self.d.press.power()
         time.sleep(6)
     assert self.split_window_impl.split_button.exists, "Split mode was disabled."
     self.split_window_impl.change_split_size(choice(['left', 'right']))
     g_common_obj.assert_exp_happens()
Exemple #11
0
    def test_ImageEdit_CropMoreThan8times_Rotate(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.click_crop_tools()
            for i in range(9):
                self.photosImpl.rotate_90_degrees()
                time.sleep(.5)
            self.photosImpl.save_picture_after_rotation()
            assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) > 0, \
                "Failed! No effects on the saving pic."
        except:
            raise Exception("Test failed in round 1.")
        self.photosImpl.rm_delete_photos()

        try:
            adb32.screen_rotation(1)
            self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.click_crop_tools()
            for i in range(9):
                self.photosImpl.rotate_90_degrees()
                time.sleep(.5)
            self.photosImpl.save_picture_after_rotation()
            assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) > 0, \
                "Failed! No effects on the saving pic."
        except:
            raise Exception("Test failed in round 2.")
        finally:
            adb32.screen_rotation(0)
Exemple #12
0
 def test_ImageEdit_Add_Effect_Rotate(self):
     print "[RunTest]: %s" % self.__str__()
     try:
         self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                              self.PHOTO_PATH)
         self.photosImpl.refresh_sdcard()
         self.photosImpl.launch_photos_am()
         self.photosImpl.open_a_picture()
         self.photosImpl.change_display_effect(effType='Vignette',
                                               effVol=80)
         adb32.screen_rotation(1)
         adb32.screen_rotation(0)
     except:
         raise Exception("Test failed!")
     finally:
         adb32.screen_rotation(0)
Exemple #13
0
 def tearDown(self):
     print "[Teardown]: %s" % self._test_name
     super(DebugModeSimulateSecondaryDisplayDrag, self).tearDown()
     self._debugmode.set_secondary_displays_none()
     adb32.screen_rotation(0)
Exemple #14
0
 def tearDown(self):
     print "[Teardown]: %s" % self._test_name
     super(ComposeUI, self).tearDown()
     os.remove("tmp.png")
     adb32.screen_rotation(0)