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

Unified Diff: tools/telemetry/telemetry/page_runner.py

Issue 11428107: Telemetry: extends Platform abstraction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/page_runner.py
diff --git a/tools/telemetry/telemetry/page_runner.py b/tools/telemetry/telemetry/page_runner.py
index 181ac036dd251cf2ef915b88a66a19a1b730c849..d5bde86f3ac4009e7f7047d46c944cecdb06a0b9 100644
--- a/tools/telemetry/telemetry/page_runner.py
+++ b/tools/telemetry/telemetry/page_runner.py
@@ -24,6 +24,7 @@ class _RunState(object):
self.browser = None
self.tab = None
self.trace_tab = None
+ self.performance_test = False
def Close(self):
if self.trace_tab:
@@ -35,9 +36,12 @@ class _RunState(object):
self.tab = None
if self.browser:
+ if self.performance_test:
+ self.browser.platform.SetFullPerformanceModeEnabled(False)
self.browser.Close()
self.browser = None
+
def _ShufflePageSet(page_set, options):
if options.test_shuffle_order_file and not options.test_shuffle:
raise Exception('--test-shuffle-order-file requires --test-shuffle.')
@@ -135,6 +139,11 @@ http://goto/read-src-internal, or create a new archive using --record.
else:
state.Close()
+ if (state.browser.platform.CanMonitorThermalThrottling() and
+ state.browser.platform.IsThermallyThrottled()):
aberent 2013/01/29 14:03:36 See my other comments on thermal throttling. This
bulach 2013/02/22 11:54:25 good point, added a check for "IsThrottled" at the
+ raise Exception('Device was thermally throttled during '
+ 'performance tests.')
tonyg 2013/02/21 18:07:08 I'm on the fence about whether this should really
bulach 2013/02/22 11:54:25 agree. done as just messages for now.
+
if options.trace_dir and state.trace_tab:
self._EndTracing(state, options, page)
break
@@ -219,6 +228,11 @@ http://goto/read-src-internal, or create a new archive using --record.
archive_path):
assert not state.tab
state.browser = possible_browser.Create()
+
+ if possible_browser.options.performance_test:
+ state.performance_test = True
+ state.browser.platform.SetFullPerformanceModeEnabled(True)
tonyg 2013/02/21 18:07:08 I wonder if it would be more robust to call SetFul
bulach 2013/02/22 11:54:25 Done.
+
state.browser.credentials.credentials_path = credentials_path
test.SetUpBrowser(state.browser)

Powered by Google App Engine
This is Rietveld 408576698