Commit 6a48a45a authored by crouleau's avatar crouleau Committed by Commit bot

Do not play the whole media file before seeking.

I also fixed some comments and fixed pylint line length errors.

This was a bug introduced in crrev/346923003.
Originally we would start playing the video and wait until it got to 1
second, and then we would seek around in it. After crrev/346923003 we
would instead play the entire video and then seek around in it.

sandersd@'s crrev/1962563005 noticed this bug and commented on it, but
we haven't gotten around to fixing it until now.

This change should reduce load on Speed infra machines by reducing the benchmark duration for tough_video_cases_extra from ~5 minutes to ~3 minutes. we get to skip the initial playback for 14 of the pages in tough_video_cases_extra. the video length of test content is around 10 seconds on average, and this change will make us play only 1 second of the video instead of the whole video before we start seeking. So 14*(10-1) = 126 seconds.

Also, I noticed that two of the pages in tough_video_cases are also seeking pages, not time_to_play pages, so this will reduce the runtime for those as well.

In addition to reducing the load, this change will also make seek times become the measurement that they were originally supposed to be. Seek time cold currently doesn't actually measure cold seek time because that part of the video that was seeked to was already played once.

BUG=711125

Review-Url: https://codereview.chromium.org/2813383002
Cr-Commit-Position: refs/heads/master@{#464288}
parent 0e56c1a9
......@@ -45,17 +45,17 @@ class ToughVideoCasesPage(page_module.Page):
action_runner.LoopMedia(loop_count=50, selector='#single_audio')
def PlayAction(self, action_runner):
# Play the media until it has finished or it times out.
action_runner.PlayMedia(playing_event_timeout_in_seconds=60,
ended_event_timeout_in_seconds=60)
def SeekBeforeAndAfterPlayhead(self, action_runner,
action_timeout_in_seconds=60):
timeout = action_timeout_in_seconds
# Because an ended timeout is passed, this won't return until the media has
# played through.
action_runner.PlayMedia(playing_event_timeout_in_seconds=timeout,
ended_event_timeout_in_seconds=timeout)
# Wait 1 second for no reason in particular.
# Start the media playback.
action_runner.PlayMedia(
playing_event_timeout_in_seconds=timeout)
# Wait for 1 second so that we know the play-head is at ~1s.
action_runner.Wait(1)
# Seek to before the play-head location.
action_runner.SeekMedia(seconds=0.5, timeout_in_seconds=timeout,
......@@ -576,7 +576,8 @@ class Page37(ToughVideoCasesPage):
def __init__(self, page_set):
super(Page37, self).__init__(
url='file://tough_video_cases/video.html?src=crowd1080_vp9.webm&canvas=true',
url=('file://tough_video_cases/video.html?src=crowd1080_vp9.webm&canvas='
'true'),
page_set=page_set,
tags=['vp9', 'video_only'])
......@@ -602,7 +603,8 @@ class Page39(ToughVideoCasesPage):
def __init__(self, page_set):
super(Page39, self).__init__(
url='file://tough_video_cases/video.html?src=garden2_10s.webm&canvas=true',
url=('file://tough_video_cases/video.html?src=garden2_10s.webm&canvas='
'true'),
page_set=page_set,
tags=['is_4k', 'vp8', 'vorbis', 'audio_video'])
......@@ -634,6 +636,10 @@ class ToughVideoCasesPageSet(story.StorySet):
def __init__(self):
super(ToughVideoCasesPageSet, self).__init__(
cloud_storage_bucket=story.PARTNER_BUCKET)
# TODO(crouleau): Pages 36 and 38 are in ToughVideoCasesPageSet even though
# they both report seek time instead of time_to_play.
# This may be a non-issue because we plan to merge these two page sets back
# together and use tags to allow teams to filter which pages they want.
self.AddStory(Page1(self))
self.AddStory(Page2(self))
......@@ -665,7 +671,8 @@ class ToughVideoCasesPageSet(story.StorySet):
class ToughVideoCasesExtraPageSet(story.StorySet):
"""
Description: Video Stack Perf benchmark that don't report time_to_play.
Description: Video Stack Perf benchmarks that report seek time and audio
avg_loop_time.
"""
def __init__(self):
super(ToughVideoCasesExtraPageSet, self).__init__(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment