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

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

Issue 2724903005: Updates exception and adds rety to ExecuteAsyncJavaScript (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
« no previous file with comments | « chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py ('k') | 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 action_runner.Wait(5) 119 action_runner.Wait(5)
120 action_runner.ExecuteJavaScript('collectPerfData();') 120 action_runner.ExecuteJavaScript('collectPerfData();')
121 action_runner.Wait(SESSION_TIME) 121 action_runner.Wait(SESSION_TIME)
122 # Stop session 122 # Stop session
123 self.ExecuteAsyncJavaScript( 123 self.ExecuteAsyncJavaScript(
124 action_runner, 124 action_runner,
125 'stopSession();', 125 'stopSession();',
126 lambda: not action_runner.EvaluateJavaScript('currentSession'), 126 lambda: not action_runner.EvaluateJavaScript('currentSession'),
127 'Failed to stop session', 127 'Failed to stop session',
128 timeout=30) 128 timeout=60, retry=3)
129 129
130 130
131 class CastMirroringPage(media_router_page.CastPage): 131 class CastMirroringPage(media_router_page.CastPage):
132 """Cast page to mirror a tab to Chromecast device.""" 132 """Cast page to mirror a tab to Chromecast device."""
133 133
134 def __init__(self, page_set): 134 def __init__(self, page_set):
135 super(CastMirroringPage, self).__init__( 135 super(CastMirroringPage, self).__init__(
136 page_set=page_set, 136 page_set=page_set,
137 url='file://mirroring.html', 137 url='file://mirroring.html',
138 shared_page_state_class=SharedState) 138 shared_page_state_class=SharedState)
(...skipping 23 matching lines...) Expand all
162 action_runner.TapElement(selector='#start_session_button') 162 action_runner.TapElement(selector='#start_session_button')
163 self._WaitForResult( 163 self._WaitForResult(
164 action_runner, 164 action_runner,
165 lambda: len(action_runner.tab.browser.tabs) >= 2, 165 lambda: len(action_runner.tab.browser.tabs) >= 2,
166 'MR dialog never showed up.') 166 'MR dialog never showed up.')
167 167
168 for tab in action_runner.tab.browser.tabs: 168 for tab in action_runner.tab.browser.tabs:
169 if tab.url == 'chrome://media-router/': 169 if tab.url == 'chrome://media-router/':
170 self.WaitUntilDialogLoaded(action_runner, tab) 170 self.WaitUntilDialogLoaded(action_runner, tab)
171 if not self.CheckIfExistingRoute(tab, sink_name): 171 if not self.CheckIfExistingRoute(tab, sink_name):
172 raise page.page_test.Failure('Failed to start mirroring session.') 172 raise RuntimeError('Failed to start mirroring session.')
173 action_runner.ExecuteJavaScript('collectPerfData();') 173 action_runner.ExecuteJavaScript('collectPerfData();')
174 action_runner.Wait(SESSION_TIME) 174 action_runner.Wait(SESSION_TIME)
175 self.CloseExistingRoute(action_runner, sink_name) 175 self.CloseExistingRoute(action_runner, sink_name)
176 176
177 177
178 class MediaRouterDialogPageSet(story.StorySet): 178 class MediaRouterDialogPageSet(story.StorySet):
179 """Pageset for media router dialog latency tests.""" 179 """Pageset for media router dialog latency tests."""
180 180
181 def __init__(self): 181 def __init__(self):
182 super(MediaRouterDialogPageSet, self).__init__( 182 super(MediaRouterDialogPageSet, self).__init__(
(...skipping 12 matching lines...) Expand all
195 self.AddStory(CastMirroringPage(self)) 195 self.AddStory(CastMirroringPage(self))
196 196
197 197
198 class CPUMemoryPageSet(story.StorySet): 198 class CPUMemoryPageSet(story.StorySet):
199 """Pageset to get baseline CPU and memory usage.""" 199 """Pageset to get baseline CPU and memory usage."""
200 200
201 def __init__(self): 201 def __init__(self):
202 super(CPUMemoryPageSet, self).__init__( 202 super(CPUMemoryPageSet, self).__init__(
203 cloud_storage_bucket=story.PARTNER_BUCKET) 203 cloud_storage_bucket=story.PARTNER_BUCKET)
204 self.AddStory(CastIdlePage(self)) 204 self.AddStory(CastIdlePage(self))
OLDNEW
« no previous file with comments | « chrome/test/media_router/telemetry/benchmarks/pagesets/media_router_page.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698