Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Side by Side Diff: tools/perf/page_sets/webrtc_cases.py

Issue 2719853003: [Telemetry refactor] Drop "2" from method calls to JS API (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 import os 4 import os
5 5
6 from telemetry import story 6 from telemetry import story
7 from telemetry.page import page as page_module 7 from telemetry.page import page as page_module
8 8
9 9
10 WEBRTC_TEST_PAGES_URL = 'https://test.webrtc.org/manual/' 10 WEBRTC_TEST_PAGES_URL = 'https://test.webrtc.org/manual/'
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 def __init__(self, page_set): 43 def __init__(self, page_set):
44 super(Page2, self).__init__( 44 super(Page2, self).__init__(
45 url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/constraints/', 45 url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/constraints/',
46 name='720p_call_45s', 46 name='720p_call_45s',
47 page_set=page_set) 47 page_set=page_set)
48 48
49 def RunPageInteractions(self, action_runner): 49 def RunPageInteractions(self, action_runner):
50 with action_runner.CreateInteraction('Action_Create_PeerConnection', 50 with action_runner.CreateInteraction('Action_Create_PeerConnection',
51 repeatable=False): 51 repeatable=False):
52 action_runner.ExecuteJavaScript2('minWidthInput.value = 1280') 52 action_runner.ExecuteJavaScript('minWidthInput.value = 1280')
53 action_runner.ExecuteJavaScript2('maxWidthInput.value = 1280') 53 action_runner.ExecuteJavaScript('maxWidthInput.value = 1280')
54 action_runner.ExecuteJavaScript2('minHeightInput.value = 720') 54 action_runner.ExecuteJavaScript('minHeightInput.value = 720')
55 action_runner.ExecuteJavaScript2('maxHeightInput.value = 720') 55 action_runner.ExecuteJavaScript('maxHeightInput.value = 720')
56 action_runner.ClickElement('button[id="getMedia"]') 56 action_runner.ClickElement('button[id="getMedia"]')
57 action_runner.Wait(2) 57 action_runner.Wait(2)
58 action_runner.ClickElement('button[id="connect"]') 58 action_runner.ClickElement('button[id="connect"]')
59 action_runner.Wait(45) 59 action_runner.Wait(45)
60 60
61 61
62 class Page3(WebrtcPage): 62 class Page3(WebrtcPage):
63 """Why: Transfer as much data as possible through a data channel in 20s.""" 63 """Why: Transfer as much data as possible through a data channel in 20s."""
64 64
65 def __init__(self, page_set): 65 def __init__(self, page_set):
66 super(Page3, self).__init__( 66 super(Page3, self).__init__(
67 url=WEBRTC_GITHUB_SAMPLES_URL + 'datachannel/datatransfer', 67 url=WEBRTC_GITHUB_SAMPLES_URL + 'datachannel/datatransfer',
68 name='30s_datachannel_transfer', 68 name='30s_datachannel_transfer',
69 page_set=page_set) 69 page_set=page_set)
70 70
71 def RunPageInteractions(self, action_runner): 71 def RunPageInteractions(self, action_runner):
72 # It won't have time to finish the 512 MB, but we're only interested in 72 # It won't have time to finish the 512 MB, but we're only interested in
73 # cpu + memory anyway rather than how much data we manage to transfer. 73 # cpu + memory anyway rather than how much data we manage to transfer.
74 action_runner.ExecuteJavaScript2('megsToSend.value = 512;') 74 action_runner.ExecuteJavaScript('megsToSend.value = 512;')
75 action_runner.ClickElement('button[id="sendTheData"]') 75 action_runner.ClickElement('button[id="sendTheData"]')
76 action_runner.Wait(30) 76 action_runner.Wait(30)
77 77
78 78
79 class Page4(WebrtcPage): 79 class Page4(WebrtcPage):
80 """Why: Sets up a WebRTC audio call with Opus.""" 80 """Why: Sets up a WebRTC audio call with Opus."""
81 81
82 def __init__(self, page_set): 82 def __init__(self, page_set):
83 super(Page4, self).__init__( 83 super(Page4, self).__init__(
84 url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/audio/?codec=OPUS', 84 url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/audio/?codec=OPUS',
85 name='audio_call_opus_10s', 85 name='audio_call_opus_10s',
86 page_set=page_set) 86 page_set=page_set)
87 87
88 def RunPageInteractions(self, action_runner): 88 def RunPageInteractions(self, action_runner):
89 action_runner.ExecuteJavaScript2('codecSelector.value="OPUS";') 89 action_runner.ExecuteJavaScript('codecSelector.value="OPUS";')
90 action_runner.ClickElement('button[id="callButton"]') 90 action_runner.ClickElement('button[id="callButton"]')
91 action_runner.Wait(10) 91 action_runner.Wait(10)
92 92
93 93
94 class Page5(WebrtcPage): 94 class Page5(WebrtcPage):
95 """Why: Sets up a WebRTC audio call with G722.""" 95 """Why: Sets up a WebRTC audio call with G722."""
96 96
97 def __init__(self, page_set): 97 def __init__(self, page_set):
98 super(Page5, self).__init__( 98 super(Page5, self).__init__(
99 url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/audio/?codec=G722', 99 url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/audio/?codec=G722',
100 name='audio_call_g722_10s', 100 name='audio_call_g722_10s',
101 page_set=page_set) 101 page_set=page_set)
102 102
103 def RunPageInteractions(self, action_runner): 103 def RunPageInteractions(self, action_runner):
104 action_runner.ExecuteJavaScript2('codecSelector.value="G722";') 104 action_runner.ExecuteJavaScript('codecSelector.value="G722";')
105 action_runner.ClickElement('button[id="callButton"]') 105 action_runner.ClickElement('button[id="callButton"]')
106 action_runner.Wait(10) 106 action_runner.Wait(10)
107 107
108 108
109 class Page6(WebrtcPage): 109 class Page6(WebrtcPage):
110 """Why: Sets up a WebRTC audio call with PCMU.""" 110 """Why: Sets up a WebRTC audio call with PCMU."""
111 111
112 def __init__(self, page_set): 112 def __init__(self, page_set):
113 super(Page6, self).__init__( 113 super(Page6, self).__init__(
114 url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/audio/?codec=PCMU', 114 url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/audio/?codec=PCMU',
115 name='audio_call_pcmu_10s', 115 name='audio_call_pcmu_10s',
116 page_set=page_set) 116 page_set=page_set)
117 117
118 def RunPageInteractions(self, action_runner): 118 def RunPageInteractions(self, action_runner):
119 action_runner.ExecuteJavaScript2('codecSelector.value="PCMU";') 119 action_runner.ExecuteJavaScript('codecSelector.value="PCMU";')
120 action_runner.ClickElement('button[id="callButton"]') 120 action_runner.ClickElement('button[id="callButton"]')
121 action_runner.Wait(10) 121 action_runner.Wait(10)
122 122
123 123
124 class Page7(WebrtcPage): 124 class Page7(WebrtcPage):
125 """Why: Sets up a WebRTC audio call with iSAC 16K.""" 125 """Why: Sets up a WebRTC audio call with iSAC 16K."""
126 126
127 def __init__(self, page_set): 127 def __init__(self, page_set):
128 super(Page7, self).__init__( 128 super(Page7, self).__init__(
129 url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/audio/?codec=ISAC_16K', 129 url=WEBRTC_GITHUB_SAMPLES_URL + 'peerconnection/audio/?codec=ISAC_16K',
130 name='audio_call_isac16k_10s', 130 name='audio_call_isac16k_10s',
131 page_set=page_set) 131 page_set=page_set)
132 132
133 def RunPageInteractions(self, action_runner): 133 def RunPageInteractions(self, action_runner):
134 action_runner.ExecuteJavaScript2('codecSelector.value="ISAC/16000";') 134 action_runner.ExecuteJavaScript('codecSelector.value="ISAC/16000";')
135 action_runner.ClickElement('button[id="callButton"]') 135 action_runner.ClickElement('button[id="callButton"]')
136 action_runner.Wait(10) 136 action_runner.Wait(10)
137 137
138 138
139 class Page8(WebrtcPage): 139 class Page8(WebrtcPage):
140 """Why: Sets up a canvas capture stream connection to a peer connection.""" 140 """Why: Sets up a canvas capture stream connection to a peer connection."""
141 141
142 def __init__(self, page_set): 142 def __init__(self, page_set):
143 canvas_capure_html = 'canvascapture/canvas_capture_peerconnection.html' 143 canvas_capure_html = 'canvascapture/canvas_capture_peerconnection.html'
144 super(Page8, self).__init__( 144 super(Page8, self).__init__(
145 url=MEDIARECORDER_GITHUB_URL + canvas_capure_html, 145 url=MEDIARECORDER_GITHUB_URL + canvas_capure_html,
146 name='canvas_capture_peer_connection', 146 name='canvas_capture_peer_connection',
147 page_set=page_set) 147 page_set=page_set)
148 148
149 def RunPageInteractions(self, action_runner): 149 def RunPageInteractions(self, action_runner):
150 with action_runner.CreateInteraction('Action_Canvas_PeerConnection', 150 with action_runner.CreateInteraction('Action_Canvas_PeerConnection',
151 repeatable=False): 151 repeatable=False):
152 action_runner.ExecuteJavaScript2('draw();') 152 action_runner.ExecuteJavaScript('draw();')
153 action_runner.ExecuteJavaScript2('doCanvasCaptureAndPeerConnection();') 153 action_runner.ExecuteJavaScript('doCanvasCaptureAndPeerConnection();')
154 action_runner.Wait(10) 154 action_runner.Wait(10)
155 155
156 156
157 class Page9(WebrtcPage): 157 class Page9(WebrtcPage):
158 """Why: Sets up several peerconnections in the same page.""" 158 """Why: Sets up several peerconnections in the same page."""
159 159
160 def __init__(self, page_set): 160 def __init__(self, page_set):
161 super(Page9, self).__init__( 161 super(Page9, self).__init__(
162 url= WEBRTC_TEST_PAGES_URL + 'multiple-peerconnections/', 162 url= WEBRTC_TEST_PAGES_URL + 'multiple-peerconnections/',
163 name='multiple_peerconnections', 163 name='multiple_peerconnections',
164 page_set=page_set) 164 page_set=page_set)
165 165
166 def RunPageInteractions(self, action_runner): 166 def RunPageInteractions(self, action_runner):
167 with action_runner.CreateInteraction('Action_Create_PeerConnection', 167 with action_runner.CreateInteraction('Action_Create_PeerConnection',
168 repeatable=False): 168 repeatable=False):
169 # Set the number of peer connections to create to 15. 169 # Set the number of peer connections to create to 15.
170 action_runner.ExecuteJavaScript2( 170 action_runner.ExecuteJavaScript(
171 'document.getElementById("num-peerconnections").value=15') 171 'document.getElementById("num-peerconnections").value=15')
172 action_runner.ExecuteJavaScript2( 172 action_runner.ExecuteJavaScript(
173 'document.getElementById("cpuoveruse-detection").checked=false') 173 'document.getElementById("cpuoveruse-detection").checked=false')
174 action_runner.ClickElement('button[id="start-test"]') 174 action_runner.ClickElement('button[id="start-test"]')
175 action_runner.Wait(45) 175 action_runner.Wait(45)
176 176
177 177
178 class WebrtcGetusermediaPageSet(story.StorySet): 178 class WebrtcGetusermediaPageSet(story.StorySet):
179 """WebRTC tests for local getUserMedia: video capture and playback.""" 179 """WebRTC tests for local getUserMedia: video capture and playback."""
180 180
181 def __init__(self): 181 def __init__(self):
182 super(WebrtcGetusermediaPageSet, self).__init__( 182 super(WebrtcGetusermediaPageSet, self).__init__(
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 class WebrtcRenderingPageSet(story.StorySet): 236 class WebrtcRenderingPageSet(story.StorySet):
237 """WebRTC tests for video rendering.""" 237 """WebRTC tests for video rendering."""
238 238
239 def __init__(self): 239 def __init__(self):
240 super(WebrtcRenderingPageSet, self).__init__( 240 super(WebrtcRenderingPageSet, self).__init__(
241 archive_data_file='data/webrtc_smoothness_cases.json', 241 archive_data_file='data/webrtc_smoothness_cases.json',
242 cloud_storage_bucket=story.PARTNER_BUCKET) 242 cloud_storage_bucket=story.PARTNER_BUCKET)
243 243
244 self.AddStory(Page2(self)) 244 self.AddStory(Page2(self))
245 self.AddStory(Page8(self)) 245 self.AddStory(Page8(self))
OLDNEW
« no previous file with comments | « tools/perf/page_sets/typical_25.py ('k') | tools/perf/profile_creators/fast_navigation_profile_extender.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698