OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 from telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
5 from telemetry import story | 5 from telemetry import story |
6 | 6 |
7 _PAGE_TAGS_LIST = [ | 7 _PAGE_TAGS_LIST = [ |
8 # Audio codecs: | 8 # Audio codecs: |
9 'pcm', | 9 'pcm', |
10 'mp3', | 10 'mp3', |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 def LoopMixedAudio(self, action_runner): | 39 def LoopMixedAudio(self, action_runner): |
40 action_runner.PlayMedia(selector='#background_audio', | 40 action_runner.PlayMedia(selector='#background_audio', |
41 playing_event_timeout_in_seconds=60) | 41 playing_event_timeout_in_seconds=60) |
42 action_runner.LoopMedia(loop_count=50, selector='#mixed_audio') | 42 action_runner.LoopMedia(loop_count=50, selector='#mixed_audio') |
43 | 43 |
44 def LoopSingleAudio(self, action_runner): | 44 def LoopSingleAudio(self, action_runner): |
45 action_runner.LoopMedia(loop_count=50, selector='#single_audio') | 45 action_runner.LoopMedia(loop_count=50, selector='#single_audio') |
46 | 46 |
47 def PlayAction(self, action_runner): | 47 def PlayAction(self, action_runner): |
| 48 # Play the media until it has finished or it times out. |
48 action_runner.PlayMedia(playing_event_timeout_in_seconds=60, | 49 action_runner.PlayMedia(playing_event_timeout_in_seconds=60, |
49 ended_event_timeout_in_seconds=60) | 50 ended_event_timeout_in_seconds=60) |
50 | 51 |
51 def SeekBeforeAndAfterPlayhead(self, action_runner, | 52 def SeekBeforeAndAfterPlayhead(self, action_runner, |
52 action_timeout_in_seconds=60): | 53 action_timeout_in_seconds=60): |
53 timeout = action_timeout_in_seconds | 54 timeout = action_timeout_in_seconds |
54 # Because an ended timeout is passed, this won't return until the media has | 55 # Start the media playback. |
55 # played through. | 56 action_runner.PlayMedia( |
56 action_runner.PlayMedia(playing_event_timeout_in_seconds=timeout, | 57 playing_event_timeout_in_seconds=timeout) |
57 ended_event_timeout_in_seconds=timeout) | 58 # Wait for 1 second so that we know the play-head is at ~1s. |
58 # Wait 1 second for no reason in particular. | |
59 action_runner.Wait(1) | 59 action_runner.Wait(1) |
60 # Seek to before the play-head location. | 60 # Seek to before the play-head location. |
61 action_runner.SeekMedia(seconds=0.5, timeout_in_seconds=timeout, | 61 action_runner.SeekMedia(seconds=0.5, timeout_in_seconds=timeout, |
62 label='seek_warm') | 62 label='seek_warm') |
63 # Seek to after the play-head location. | 63 # Seek to after the play-head location. |
64 action_runner.SeekMedia(seconds=9, timeout_in_seconds=timeout, | 64 action_runner.SeekMedia(seconds=9, timeout_in_seconds=timeout, |
65 label='seek_cold') | 65 label='seek_cold') |
66 | 66 |
67 | 67 |
68 class Page1(ToughVideoCasesPage): | 68 class Page1(ToughVideoCasesPage): |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 self.add_browser_metrics = True | 569 self.add_browser_metrics = True |
570 | 570 |
571 def RunPageInteractions(self, action_runner): | 571 def RunPageInteractions(self, action_runner): |
572 self.SeekBeforeAndAfterPlayhead(action_runner, | 572 self.SeekBeforeAndAfterPlayhead(action_runner, |
573 action_timeout_in_seconds=120) | 573 action_timeout_in_seconds=120) |
574 | 574 |
575 class Page37(ToughVideoCasesPage): | 575 class Page37(ToughVideoCasesPage): |
576 | 576 |
577 def __init__(self, page_set): | 577 def __init__(self, page_set): |
578 super(Page37, self).__init__( | 578 super(Page37, self).__init__( |
579 url='file://tough_video_cases/video.html?src=crowd1080_vp9.webm&canvas=tru
e', | 579 url=('file://tough_video_cases/video.html?src=crowd1080_vp9.webm&canvas=' |
| 580 'true'), |
580 page_set=page_set, | 581 page_set=page_set, |
581 tags=['vp9', 'video_only']) | 582 tags=['vp9', 'video_only']) |
582 | 583 |
583 self.add_browser_metrics = True | 584 self.add_browser_metrics = True |
584 | 585 |
585 def RunPageInteractions(self, action_runner): | 586 def RunPageInteractions(self, action_runner): |
586 self.PlayAction(action_runner) | 587 self.PlayAction(action_runner) |
587 | 588 |
588 class Page38(ToughVideoCasesPage): | 589 class Page38(ToughVideoCasesPage): |
589 | 590 |
590 def __init__(self, page_set): | 591 def __init__(self, page_set): |
591 super(Page38, self).__init__( | 592 super(Page38, self).__init__( |
592 url='file://tough_video_cases/video.html?src=tulip2.mp4&canvas=true', | 593 url='file://tough_video_cases/video.html?src=tulip2.mp4&canvas=true', |
593 page_set=page_set, | 594 page_set=page_set, |
594 tags=['h264', 'aac', 'audio_video']) | 595 tags=['h264', 'aac', 'audio_video']) |
595 | 596 |
596 self.add_browser_metrics = True | 597 self.add_browser_metrics = True |
597 | 598 |
598 def RunPageInteractions(self, action_runner): | 599 def RunPageInteractions(self, action_runner): |
599 self.SeekBeforeAndAfterPlayhead(action_runner) | 600 self.SeekBeforeAndAfterPlayhead(action_runner) |
600 | 601 |
601 class Page39(ToughVideoCasesPage): | 602 class Page39(ToughVideoCasesPage): |
602 | 603 |
603 def __init__(self, page_set): | 604 def __init__(self, page_set): |
604 super(Page39, self).__init__( | 605 super(Page39, self).__init__( |
605 url='file://tough_video_cases/video.html?src=garden2_10s.webm&canvas=true'
, | 606 url=('file://tough_video_cases/video.html?src=garden2_10s.webm&canvas=' |
| 607 'true'), |
606 page_set=page_set, | 608 page_set=page_set, |
607 tags=['is_4k', 'vp8', 'vorbis', 'audio_video']) | 609 tags=['is_4k', 'vp8', 'vorbis', 'audio_video']) |
608 | 610 |
609 self.add_browser_metrics = True | 611 self.add_browser_metrics = True |
610 | 612 |
611 def RunPageInteractions(self, action_runner): | 613 def RunPageInteractions(self, action_runner): |
612 self.PlayAction(action_runner) | 614 self.PlayAction(action_runner) |
613 | 615 |
614 class Page40(ToughVideoCasesPage): | 616 class Page40(ToughVideoCasesPage): |
615 | 617 |
(...skipping 11 matching lines...) Expand all Loading... |
627 def RunPageInteractions(self, action_runner): | 629 def RunPageInteractions(self, action_runner): |
628 self.PlayAction(action_runner) | 630 self.PlayAction(action_runner) |
629 | 631 |
630 class ToughVideoCasesPageSet(story.StorySet): | 632 class ToughVideoCasesPageSet(story.StorySet): |
631 """ | 633 """ |
632 Description: Video Stack Perf benchmark that report time_to_play. | 634 Description: Video Stack Perf benchmark that report time_to_play. |
633 """ | 635 """ |
634 def __init__(self): | 636 def __init__(self): |
635 super(ToughVideoCasesPageSet, self).__init__( | 637 super(ToughVideoCasesPageSet, self).__init__( |
636 cloud_storage_bucket=story.PARTNER_BUCKET) | 638 cloud_storage_bucket=story.PARTNER_BUCKET) |
| 639 # TODO(crouleau): Pages 36 and 38 are in ToughVideoCasesPageSet even though |
| 640 # they both report seek time instead of time_to_play. |
| 641 # This may be a non-issue because we plan to merge these two page sets back |
| 642 # together and use tags to allow teams to filter which pages they want. |
637 | 643 |
638 self.AddStory(Page1(self)) | 644 self.AddStory(Page1(self)) |
639 self.AddStory(Page2(self)) | 645 self.AddStory(Page2(self)) |
640 self.AddStory(Page3(self)) | 646 self.AddStory(Page3(self)) |
641 self.AddStory(Page4(self)) | 647 self.AddStory(Page4(self)) |
642 self.AddStory(Page5(self)) | 648 self.AddStory(Page5(self)) |
643 self.AddStory(Page6(self)) | 649 self.AddStory(Page6(self)) |
644 self.AddStory(Page7(self)) | 650 self.AddStory(Page7(self)) |
645 self.AddStory(Page8(self)) | 651 self.AddStory(Page8(self)) |
646 self.AddStory(Page9(self)) | 652 self.AddStory(Page9(self)) |
(...skipping 11 matching lines...) Expand all Loading... |
658 self.AddStory(Page34(self)) | 664 self.AddStory(Page34(self)) |
659 self.AddStory(Page36(self)) | 665 self.AddStory(Page36(self)) |
660 self.AddStory(Page37(self)) | 666 self.AddStory(Page37(self)) |
661 self.AddStory(Page38(self)) | 667 self.AddStory(Page38(self)) |
662 self.AddStory(Page39(self)) | 668 self.AddStory(Page39(self)) |
663 self.AddStory(Page40(self)) | 669 self.AddStory(Page40(self)) |
664 | 670 |
665 | 671 |
666 class ToughVideoCasesExtraPageSet(story.StorySet): | 672 class ToughVideoCasesExtraPageSet(story.StorySet): |
667 """ | 673 """ |
668 Description: Video Stack Perf benchmark that don't report time_to_play. | 674 Description: Video Stack Perf benchmarks that report seek time and audio |
| 675 avg_loop_time. |
669 """ | 676 """ |
670 def __init__(self): | 677 def __init__(self): |
671 super(ToughVideoCasesExtraPageSet, self).__init__( | 678 super(ToughVideoCasesExtraPageSet, self).__init__( |
672 cloud_storage_bucket=story.PARTNER_BUCKET) | 679 cloud_storage_bucket=story.PARTNER_BUCKET) |
673 | 680 |
674 self.AddStory(Page19(self)) | 681 self.AddStory(Page19(self)) |
675 self.AddStory(Page20(self)) | 682 self.AddStory(Page20(self)) |
676 self.AddStory(Page21(self)) | 683 self.AddStory(Page21(self)) |
677 self.AddStory(Page22(self)) | 684 self.AddStory(Page22(self)) |
678 self.AddStory(Page23(self)) | 685 self.AddStory(Page23(self)) |
679 self.AddStory(Page24(self)) | 686 self.AddStory(Page24(self)) |
680 self.AddStory(Page25(self)) | 687 self.AddStory(Page25(self)) |
681 self.AddStory(Page26(self)) | 688 self.AddStory(Page26(self)) |
682 self.AddStory(Page27(self)) | 689 self.AddStory(Page27(self)) |
683 self.AddStory(Page28(self)) | 690 self.AddStory(Page28(self)) |
684 self.AddStory(Page29(self)) | 691 self.AddStory(Page29(self)) |
685 self.AddStory(Page31(self)) | 692 self.AddStory(Page31(self)) |
686 self.AddStory(Page33(self)) | 693 self.AddStory(Page33(self)) |
687 self.AddStory(Page35(self)) | 694 self.AddStory(Page35(self)) |
OLD | NEW |