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

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

Issue 2085483002: [memory-infra] Add DumpStateUponFailure method to MultiBrowserSharedState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 collections 5 import collections
6 import logging 6 import logging
7 import re 7 import re
8 import sys 8 import sys
9 import urllib 9 import urllib
10 10
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 def TearDownState(self): 183 def TearDownState(self):
184 self.platform.network_controller.Close() 184 self.platform.network_controller.Close()
185 185
186 for browser_type, browser in self._browsers.iteritems(): 186 for browser_type, browser in self._browsers.iteritems():
187 try: 187 try:
188 browser.Close() 188 browser.Close()
189 except Exception: 189 except Exception:
190 logging.exception('Error while closing browser: %s', browser_type) 190 logging.exception('Error while closing browser: %s', browser_type)
191 self._browsers = None # Not usable after tearing down. 191 self._browsers = None # Not usable after tearing down.
192 192
193 def DumpStateUponFailure(self, unused_story, unused_results):
194 if self._browsers:
195 for browser_type, browser in self._browsers.iteritems():
196 logging.info('vvvvv BROWSER STATE BELOW FOR \'%s\' vvvvv', browser_type)
197 browser.DumpStateUponFailure()
198 else:
199 logging.warning('Cannot dump browser states: No browsers.')
200
193 201
194 class SinglePage(story_module.Story): 202 class SinglePage(story_module.Story):
195 def __init__(self, name, url, browser_type, phase): 203 def __init__(self, name, url, browser_type, phase):
196 """A story that associates a particular page with a browser to view it. 204 """A story that associates a particular page with a browser to view it.
197 205
198 Args: 206 Args:
199 name: A string with the name of the page as it will appear reported, 207 name: A string with the name of the page as it will appear reported,
200 e.g., on results and dashboards. 208 e.g., on results and dashboards.
201 url: A string with the url of the page to load. 209 url: A string with the url of the page to load.
202 browser_type: A string identifying the browser where this page should be 210 browser_type: A string identifying the browser where this page should be
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 url=GOOGLE_SEARCH + urllib.urlencode({'q': query}), 246 url=GOOGLE_SEARCH + urllib.urlencode({'q': query}),
239 browser_type='android-webview', 247 browser_type='android-webview',
240 phase='on_webview')) 248 phase='on_webview'))
241 249
242 # Stories that run on the browser selected by command line options. 250 # Stories that run on the browser selected by command line options.
243 self.AddStory(SinglePage( 251 self.AddStory(SinglePage(
244 name=re.sub('\W+', '_', url), 252 name=re.sub('\W+', '_', url),
245 url=url, 253 url=url,
246 browser_type='default', 254 browser_type='default',
247 phase='on_chrome')) 255 phase='on_chrome'))
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