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

Side by Side Diff: chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_perf_pages.py

Issue 2962553002: Setting story names for stories in media_router_perf_pages (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 import utils 5 import utils
6 6
7 from telemetry import page 7 from telemetry import page
8 from telemetry import story 8 from telemetry import story
9 from benchmarks.pagesets import media_router_page 9 from benchmarks.pagesets import media_router_page
10 from telemetry.core import exceptions 10 from telemetry.core import exceptions
(...skipping 13 matching lines...) Expand all
24 24
25 def DidRunStory(self, results): 25 def DidRunStory(self, results):
26 super(SharedState, self).DidRunStory(results) 26 super(SharedState, self).DidRunStory(results)
27 self._StopBrowser() 27 self._StopBrowser()
28 28
29 29
30 class CastDialogPage(media_router_page.CastPage): 30 class CastDialogPage(media_router_page.CastPage):
31 """Cast page to open a cast-enabled page and open media router dialog.""" 31 """Cast page to open a cast-enabled page and open media router dialog."""
32 32
33 def __init__(self, page_set, url='file://basic_test.html', 33 def __init__(self, page_set, url='file://basic_test.html',
34 shared_page_state_class=shared_page_state.SharedPageState): 34 shared_page_state_class=shared_page_state.SharedPageState,
35 name='basic_test.html'):
35 super(CastDialogPage, self).__init__( 36 super(CastDialogPage, self).__init__(
36 url=url, page_set=page_set, 37 url=url, page_set=page_set,
37 shared_page_state_class=shared_page_state_class) 38 shared_page_state_class=shared_page_state_class)
38 39
39 def RunPageInteractions(self, action_runner): 40 def RunPageInteractions(self, action_runner):
40 # Wait for 5s after Chrome is opened in order to get consistent results. 41 # Wait for 5s after Chrome is opened in order to get consistent results.
41 action_runner.Wait(5) 42 action_runner.Wait(5)
42 with action_runner.CreateInteraction('LaunchDialog'): 43 with action_runner.CreateInteraction('LaunchDialog'):
43 # Open dialog 44 # Open dialog
44 action_runner.TapElement(selector='#start_session_button') 45 action_runner.TapElement(selector='#start_session_button')
45 action_runner.Wait(5) 46 action_runner.Wait(5)
46 # Close media router dialog 47 # Close media router dialog
47 for tab in action_runner.tab.browser.tabs: 48 for tab in action_runner.tab.browser.tabs:
48 if tab.url == 'chrome://media-router/': 49 if tab.url == 'chrome://media-router/':
49 self.CloseDialog(tab) 50 self.CloseDialog(tab)
50 51
51 52
52 class CastIdlePage(CastDialogPage): 53 class CastIdlePage(CastDialogPage):
53 """Cast page to open a cast-enabled page and do nothing.""" 54 """Cast page to open a cast-enabled page and do nothing."""
54 55
55 def __init__(self, page_set): 56 def __init__(self, page_set):
56 super(CastIdlePage, self).__init__( 57 super(CastIdlePage, self).__init__(
57 page_set=page_set, 58 page_set=page_set,
58 url='file://basic_test.html', 59 url='file://basic_test.html',
59 shared_page_state_class=SharedState) 60 shared_page_state_class=SharedState,
61 name='basic_test.html')
60 62
61 def RunPageInteractions(self, action_runner): 63 def RunPageInteractions(self, action_runner):
62 # Wait for 5s after Chrome is opened in order to get consistent results. 64 # Wait for 5s after Chrome is opened in order to get consistent results.
63 action_runner.Wait(5) 65 action_runner.Wait(5)
64 with action_runner.CreateInteraction('Idle'): 66 with action_runner.CreateInteraction('Idle'):
65 action_runner.ExecuteJavaScript('collectPerfData();') 67 action_runner.ExecuteJavaScript('collectPerfData();')
66 action_runner.Wait(SESSION_TIME) 68 action_runner.Wait(SESSION_TIME)
67 69
68 70
69 class CastFlingingPage(media_router_page.CastPage): 71 class CastFlingingPage(media_router_page.CastPage):
70 """Cast page to fling a video to Chromecast device.""" 72 """Cast page to fling a video to Chromecast device."""
71 73
72 def __init__(self, page_set): 74 def __init__(self, page_set):
73 super(CastFlingingPage, self).__init__( 75 super(CastFlingingPage, self).__init__(
74 page_set=page_set, 76 page_set=page_set,
75 url='file://basic_test.html#flinging', 77 url='file://basic_test.html#flinging',
76 shared_page_state_class=SharedState) 78 shared_page_state_class=SharedState,
79 name='basic_test.html#flinging')
77 80
78 def RunPageInteractions(self, action_runner): 81 def RunPageInteractions(self, action_runner):
79 sink_name = self._GetDeviceName() 82 sink_name = self._GetDeviceName()
80 # Wait for 5s after Chrome is opened in order to get consistent results. 83 # Wait for 5s after Chrome is opened in order to get consistent results.
81 action_runner.Wait(5) 84 action_runner.Wait(5)
82 with action_runner.CreateInteraction('flinging'): 85 with action_runner.CreateInteraction('flinging'):
83 86
84 self._WaitForResult( 87 self._WaitForResult(
85 action_runner, 88 action_runner,
86 lambda: action_runner.EvaluateJavaScript('initialized'), 89 lambda: action_runner.EvaluateJavaScript('initialized'),
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 timeout=60, retry=3) 131 timeout=60, retry=3)
129 132
130 133
131 class CastMirroringPage(media_router_page.CastPage): 134 class CastMirroringPage(media_router_page.CastPage):
132 """Cast page to mirror a tab to Chromecast device.""" 135 """Cast page to mirror a tab to Chromecast device."""
133 136
134 def __init__(self, page_set): 137 def __init__(self, page_set):
135 super(CastMirroringPage, self).__init__( 138 super(CastMirroringPage, self).__init__(
136 page_set=page_set, 139 page_set=page_set,
137 url='file://mirroring.html', 140 url='file://mirroring.html',
138 shared_page_state_class=SharedState) 141 shared_page_state_class=SharedState,
142 name='mirroring.html')
139 143
140 def RunPageInteractions(self, action_runner): 144 def RunPageInteractions(self, action_runner):
141 sink_name = self._GetDeviceName() 145 sink_name = self._GetDeviceName()
142 # Wait for 5s after Chrome is opened in order to get consistent results. 146 # Wait for 5s after Chrome is opened in order to get consistent results.
143 action_runner.Wait(5) 147 action_runner.Wait(5)
144 with action_runner.CreateInteraction('mirroring'): 148 with action_runner.CreateInteraction('mirroring'):
145 self.CloseExistingRoute(action_runner, sink_name) 149 self.CloseExistingRoute(action_runner, sink_name)
146 150
147 # Start session 151 # Start session
148 action_runner.TapElement(selector='#start_session_button') 152 action_runner.TapElement(selector='#start_session_button')
(...skipping 24 matching lines...) Expand all
173 action_runner.ExecuteJavaScript('collectPerfData();') 177 action_runner.ExecuteJavaScript('collectPerfData();')
174 action_runner.Wait(SESSION_TIME) 178 action_runner.Wait(SESSION_TIME)
175 self.CloseExistingRoute(action_runner, sink_name) 179 self.CloseExistingRoute(action_runner, sink_name)
176 180
177 181
178 class MediaRouterDialogPageSet(story.StorySet): 182 class MediaRouterDialogPageSet(story.StorySet):
179 """Pageset for media router dialog latency tests.""" 183 """Pageset for media router dialog latency tests."""
180 184
181 def __init__(self): 185 def __init__(self):
182 super(MediaRouterDialogPageSet, self).__init__( 186 super(MediaRouterDialogPageSet, self).__init__(
183 cloud_storage_bucket=story.PARTNER_BUCKET, verify_names=False) 187 cloud_storage_bucket=story.PARTNER_BUCKET)
184 self.AddStory(CastDialogPage(self)) 188 self.AddStory(CastDialogPage(self))
185 189
186 190
187 class MediaRouterCPUMemoryPageSet(story.StorySet): 191 class MediaRouterCPUMemoryPageSet(story.StorySet):
188 """Pageset for media router CPU/memory usage tests.""" 192 """Pageset for media router CPU/memory usage tests."""
189 193
190 def __init__(self): 194 def __init__(self):
191 super(MediaRouterCPUMemoryPageSet, self).__init__( 195 super(MediaRouterCPUMemoryPageSet, self).__init__(
192 cloud_storage_bucket=story.PARTNER_BUCKET, verify_names=False) 196 cloud_storage_bucket=story.PARTNER_BUCKET)
193 self.AddStory(CastIdlePage(self)) 197 self.AddStory(CastIdlePage(self))
194 self.AddStory(CastFlingingPage(self)) 198 self.AddStory(CastFlingingPage(self))
195 self.AddStory(CastMirroringPage(self)) 199 self.AddStory(CastMirroringPage(self))
196 200
197 201
198 class CPUMemoryPageSet(story.StorySet): 202 class CPUMemoryPageSet(story.StorySet):
199 """Pageset to get baseline CPU and memory usage.""" 203 """Pageset to get baseline CPU and memory usage."""
200 204
201 def __init__(self): 205 def __init__(self):
202 super(CPUMemoryPageSet, self).__init__( 206 super(CPUMemoryPageSet, self).__init__(
203 cloud_storage_bucket=story.PARTNER_BUCKET, verify_names=False) 207 cloud_storage_bucket=story.PARTNER_BUCKET)
204 self.AddStory(CastIdlePage(self)) 208 self.AddStory(CastIdlePage(self))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698