Chromium Code Reviews| 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 | 4 |
| 5 from telemetry import story | 5 from telemetry import story |
| 6 from telemetry.page import page as page_module | 6 from telemetry.page import page as page_module |
| 7 | 7 |
| 8 | 8 |
| 9 CODECS = ('OPUS', 'G772', 'PCMU', 'ISAC/1600') | |
| 10 | |
| 11 | |
| 9 class WebrtcPage(page_module.Page): | 12 class WebrtcPage(page_module.Page): |
| 10 | 13 |
| 11 def __init__(self, url, page_set, name, tags): | 14 def __init__(self, url, page_set, name, tags): |
| 12 assert url.startswith('file://webrtc_cases/') | 15 assert url.startswith('file://webrtc_cases/') |
| 13 super(WebrtcPage, self).__init__( | 16 super(WebrtcPage, self).__init__( |
| 14 url=url, page_set=page_set, name=name, tags=tags) | 17 url=url, page_set=page_set, name=name, tags=tags) |
| 15 | 18 |
| 16 | 19 |
| 17 class GetUserMedia(WebrtcPage): | 20 class GetUserMedia(WebrtcPage): |
| 18 """Why: Acquires a high definition (720p) local stream.""" | 21 """Why: Acquires a high definition (720p) local stream.""" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 | 106 |
| 104 def __init__(self, page_set, tags): | 107 def __init__(self, page_set, tags): |
| 105 super(MultiplePeerConnections, self).__init__( | 108 super(MultiplePeerConnections, self).__init__( |
| 106 url='file://webrtc_cases/multiple-peerconnections.html', | 109 url='file://webrtc_cases/multiple-peerconnections.html', |
| 107 name='multiple_peerconnections', | 110 name='multiple_peerconnections', |
| 108 page_set=page_set, tags=tags) | 111 page_set=page_set, tags=tags) |
| 109 | 112 |
| 110 def RunPageInteractions(self, action_runner): | 113 def RunPageInteractions(self, action_runner): |
| 111 with action_runner.CreateInteraction('Action_Create_PeerConnection', | 114 with action_runner.CreateInteraction('Action_Create_PeerConnection', |
| 112 repeatable=False): | 115 repeatable=False): |
| 113 # Set the number of peer connections to create to 15. | 116 # Set the number of peer connections to create to 10. |
| 114 action_runner.ExecuteJavaScript( | 117 action_runner.ExecuteJavaScript( |
| 115 'document.getElementById("num-peerconnections").value=15') | 118 'document.getElementById("num-peerconnections").value=10') |
| 116 action_runner.ExecuteJavaScript( | 119 action_runner.ExecuteJavaScript( |
| 117 'document.getElementById("cpuoveruse-detection").checked=false') | 120 'document.getElementById("cpuoveruse-detection").checked=false') |
| 118 action_runner.ClickElement('button[id="start-test"]') | 121 action_runner.ClickElement('button[id="start-test"]') |
| 119 action_runner.Wait(45) | 122 action_runner.Wait(20) |
| 120 | 123 |
| 121 | 124 |
| 122 class WebrtcPageSet(story.StorySet): | 125 class WebrtcPageSet(story.StorySet): |
| 123 def __init__(self): | 126 def __init__(self): |
| 124 super(WebrtcPageSet, self).__init__( | 127 super(WebrtcPageSet, self).__init__( |
| 125 cloud_storage_bucket=story.PUBLIC_BUCKET) | 128 cloud_storage_bucket=story.PUBLIC_BUCKET) |
| 126 | 129 |
| 130 self.AddStory(MultiplePeerConnections(self, tags=['stress'])) | |
| 131 self.AddStory(DataChannel(self, tags=['datachannel'])) | |
| 127 self.AddStory(GetUserMedia(self, tags=['getusermedia'])) | 132 self.AddStory(GetUserMedia(self, tags=['getusermedia'])) |
| 128 self.AddStory(MultiplePeerConnections(self, tags=['stress'])) | |
| 129 self.AddStory(VideoCall(self, tags=['peerconnection', 'smoothness'])) | 133 self.AddStory(VideoCall(self, tags=['peerconnection', 'smoothness'])) |
| 130 self.AddStory(DataChannel(self, tags=['datachannel'])) | |
| 131 self.AddStory(CanvasCapturePeerConnection(self, tags=['smoothness'])) | 134 self.AddStory(CanvasCapturePeerConnection(self, tags=['smoothness'])) |
| 132 # TODO(qyearsley, mcasas): Add webrtc.audio when http://crbug.com/468732 | 135 for codec in CODECS: |
|
nednguyen
2017/05/26 20:17:07
I also don't think code saving here is a good idea
| |
| 133 # is fixed, or revert https://codereview.chromium.org/1544573002/ when | 136 self.AddStory(AudioCall(self, codec, tags=['audio'])) |
| 134 # http://crbug.com/568333 is fixed. | |
| 135 # self.AddStory(AudioCall(self, 'OPUS')) | |
| 136 # self.AddStory(AudioCall(self, 'G772')) | |
| 137 # self.AddStory(AudioCall(self, 'PCMU')) | |
| 138 # self.AddStory(AudioCall(self, 'ISAC/1600')) | |
| 139 | 137 |
| 140 | 138 |
| 141 class WebrtcExpectations(story.expectations.StoryExpectations): | 139 class WebrtcExpectations(story.expectations.StoryExpectations): |
| 142 def SetExpectations(self): | 140 def SetExpectations(self): |
| 143 self.DisableStory('multiple_peerconnections', | 141 # TODO(qyearsley, mcasas): Add webrtc.audio when http://crbug.com/468732 |
| 144 [story.expectations.ALL], | 142 # is fixed, or revert https://codereview.chromium.org/1544573002/ when |
| 145 'crbug.com/725502') | 143 # http://crbug.com/568333 is fixed. |
| 144 for codec in CODECS: | |
|
nednguyen
2017/05/26 20:16:09
No, please don't do this as it makes sheriffs supe
| |
| 145 self.DisableStory('audio_call_%s_10s' % codec.lower(), | |
| 146 [story.expectations.ALL], | |
| 147 'crbug.com/468732') | |
| 146 self.DisableStory('30s_datachannel_transfer', | 148 self.DisableStory('30s_datachannel_transfer', |
| 147 [story.expectations.ALL_DESKTOP], | 149 [story.expectations.ALL_DESKTOP], |
| 148 'crbug.com/726811') | 150 'crbug.com/726811') |
| OLD | NEW |