当前位置: 首页>>代码示例>>Python>>正文


Python VideoPlayer.launch方法代码示例

本文整理汇总了Python中gaiatest.apps.videoplayer.app.VideoPlayer.launch方法的典型用法代码示例。如果您正苦于以下问题:Python VideoPlayer.launch方法的具体用法?Python VideoPlayer.launch怎么用?Python VideoPlayer.launch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gaiatest.apps.videoplayer.app.VideoPlayer的用法示例。


在下文中一共展示了VideoPlayer.launch方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_play_mp4_video

# 需要导入模块: from gaiatest.apps.videoplayer.app import VideoPlayer [as 别名]
# 或者: from gaiatest.apps.videoplayer.app.VideoPlayer import launch [as 别名]
    def test_play_mp4_video(self):
        """https://moztrap.mozilla.org/manage/case/2478/"""

        video_player = VideoPlayer(self.marionette)
        video_player.launch()
        video_player.wait_for_thumbnails_to_load(1, 'Video files found on device: %s' %self.data_layer.video_files)

        # Assert that there is at least one video available
        self.assertGreater(video_player.total_video_count, 0)

        first_video_name = video_player.first_video_name

        # Click on the first video.
        fullscreen_video = video_player.tap_first_video_item()

        # Video will play automatically
        # We'll wait for the controls to clear so we're 'safe' to proceed
        time.sleep(2)

        # We cannot tap the toolbar so let's just enable it with javascript
        fullscreen_video.show_controls()

        # The elapsed time > 0:00 denote the video is playing
        zero_time = time.strptime('00:00', '%M:%S')
        self.assertGreater(fullscreen_video.elapsed_time, zero_time)

        # Check the name too. This will only work if the toolbar is visible.
        self.assertEqual(first_video_name, fullscreen_video.name)
开发者ID:4gh,项目名称:gaia,代码行数:30,代码来源:test_play_mp4_video.py

示例2: test_play_3gp_video

# 需要导入模块: from gaiatest.apps.videoplayer.app import VideoPlayer [as 别名]
# 或者: from gaiatest.apps.videoplayer.app.VideoPlayer import launch [as 别名]
    def test_play_3gp_video(self):
        """https://moztrap.mozilla.org/manage/case/2478/"""

        video_player = VideoPlayer(self.marionette)
        video_player.launch()
        video_player.wait_for_thumbnails_to_load(1)

        # Assert that there is at least one video available
        self.assertGreater(video_player.total_video_count, 0)

        first_video_name = video_player.first_video_name

        self.assertEqual('none', self.data_layer.current_audio_channel)
        # See bug 1109203, current_audio_channel switches context to the system
        # app, so we need to return it back to the displayed app
        self.apps.switch_to_displayed_app()

        # Click on the first video.
        fullscreen_video = video_player.tap_first_video_item()

        # Video will play automatically
        # We'll wait for the controls to clear so we're 'safe' to proceed
        time.sleep(2)

        # We cannot tap the toolbar so let's just enable it with javascript
        fullscreen_video.show_controls()

        # The elapsed time > 0:00 denote the video is playing
        zero_time = time.strptime('00:00', '%M:%S')
        self.assertGreater(fullscreen_video.elapsed_time, zero_time)

        # Check the name too. This will only work if the toolbar is visible.
        self.assertEqual(first_video_name, fullscreen_video.name)

        self.assertEqual('content', self.data_layer.current_audio_channel)
开发者ID:AaskaShah,项目名称:gaia,代码行数:37,代码来源:test_play_3gp_video.py

示例3: test_empty_video

# 需要导入模块: from gaiatest.apps.videoplayer.app import VideoPlayer [as 别名]
# 或者: from gaiatest.apps.videoplayer.app.VideoPlayer import launch [as 别名]
    def test_empty_video(self):
        """https://moztrap.mozilla.org/manage/case/3660/
        Requires to be no videos on SDCard, which is the default.
        """

        video_player = VideoPlayer(self.marionette)
        video_player.launch()

        # Verify title when no videos
        self.assertEqual(video_player.empty_video_title, "Add videos to get started")

        # Verify text when no videos
        # Note: Text will need to be updated if/when Bug 834477 is fixed
        self.assertEqual(video_player.empty_video_text, "Load videos on to the memory card.")
开发者ID:robhudson,项目名称:gaia,代码行数:16,代码来源:test_video_empty.py

示例4: video_playback

# 需要导入模块: from gaiatest.apps.videoplayer.app import VideoPlayer [as 别名]
# 或者: from gaiatest.apps.videoplayer.app.VideoPlayer import launch [as 别名]
    def video_playback(self, screen_flag):
        self.push_resource(os.path.abspath('source/meetthecubs.webm'))
        lock_screen = LockScreen(self.marionette)
        homescreen = lock_screen.unlock()
        self.wait_for_condition(lambda m: self.apps.displayed_app.name == homescreen.name)

        video_player = VideoPlayer(self.marionette)
        video_player.launch()
        video_player.wait_for_thumbnails_to_load(1, 'Video files found on device: %s' %self.data_layer.video_files)

        # Assert that there is at least one video available
        self.assertGreater(video_player.total_video_count, 0)

        first_video_name = video_player.first_video_name

        self.assertEqual('none', self.data_layer.current_audio_channel)
        self.apps.switch_to_displayed_app()

        # Click on the first video
        fullscreen_video = video_player.tap_first_video_item()

        # Video will play automatically
        # We'll wait for the controls to clear so we're 'safe' to proceed
        time.sleep(2)

        # We cannot tap the toolbar so let's just enable it with javascript
        fullscreen_video.show_controls()

        # The elapsed time > 0:00 denote the video is playing
        zero_time = time.strptime('00:00', '%M:%S')
        self.assertGreater(fullscreen_video.elapsed_time, zero_time)

        # Check the name too. This will only work if the toolbar is visible
        self.assertEqual(first_video_name, fullscreen_video.name)

        self.assertEqual('content', self.data_layer.current_audio_channel)

        print ""
        if screen_flag:
            print "Running Video Test (screen on)"
            test_name = "video_playback"
        else:
            self.device.turn_screen_off()
            print "Running Video Test (screen off)"
            test_name = "background_video_playback"
            time.sleep(2)
            fullscreen_video.tap_play() #when you turn off the screen, video playback pauses...
        self.runPowerTest(test_name, "Video", "video")
开发者ID:askeing,项目名称:power-tests,代码行数:50,代码来源:test_media_playback.py

示例5: test_play_3gp_video

# 需要导入模块: from gaiatest.apps.videoplayer.app import VideoPlayer [as 别名]
# 或者: from gaiatest.apps.videoplayer.app.VideoPlayer import launch [as 别名]
    def test_play_3gp_video(self):
        """https://moztrap.mozilla.org/manage/case/2478/"""

        video_player = VideoPlayer(self.marionette)
        video_player.launch()
        video_player.wait_for_thumbnails_to_load(1)

        # Assert that there is at least one video available
        self.assertGreater(video_player.total_video_count, 0)
        first_video_name = video_player.first_video_name
        self.take_screenshot()

        # Click on the first video.
        fullscreen_video = video_player.tap_first_video_item()

        # Video will play automatically
        # After playback, it rewinds to the beginning.  The video file is 13 seconds long
        time.sleep(self._video_length + 3) # add 3 seconds to compensate for the lag

        begin_time = time.strptime('00:00', '%M:%S')
        # display the data overlay to show the elapsed time
        fullscreen_video.show_controls()
        self.assertEqual(fullscreen_video.elapsed_time, begin_time)
        self.assertEqual(first_video_name, fullscreen_video.name)
        self.take_screenshot()

        # take snapshot of random frames
        fullscreen_video.tap_forward()  # tapping forward or rewinds moves frames in 10 sec increment
        self.take_screenshot()
        fullscreen_video.tap_forward()  # go to the end of the frame
        self.take_screenshot()

        # go back to the beginning by tapping rewind twice, since each tap is in 10 second increment
        fullscreen_video.tap_rewind()
        # wait until the elapsed_time goes 10 seconds back
        Wait(self.marionette).until(lambda m: fullscreen_video.elapsed_time == time.strptime('00:03', '%M:%S'))
        fullscreen_video.tap_rewind()
        # wait until the counter goes back to the beginning
        Wait(self.marionette).until(lambda m: fullscreen_video.elapsed_time == begin_time)

        # seek forward
        fullscreen_video.move_seek_slider(100)
        self.take_screenshot()

        # seek backward
        fullscreen_video.move_seek_slider(-50)
        self.take_screenshot()
开发者ID:AaskaShah,项目名称:gaia,代码行数:49,代码来源:test_play_3gp_video.py


注:本文中的gaiatest.apps.videoplayer.app.VideoPlayer.launch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。