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

Unified Diff: tools/perf/measurements/tab_switching.py

Issue 350763005: [Telemetry] Power metric: subtract quiescent power draw from result (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/measurements/smoothness_unittest.py ('k') | tools/perf/measurements/webrtc.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/tab_switching.py
diff --git a/tools/perf/measurements/tab_switching.py b/tools/perf/measurements/tab_switching.py
index a613c4d563b5215449721f3784a2474739b4c89c..7c136de36f4caa6bfbcab2b1b1f49528c404f410 100644
--- a/tools/perf/measurements/tab_switching.py
+++ b/tools/perf/measurements/tab_switching.py
@@ -21,10 +21,14 @@ from telemetry.value import histogram
# TODO: Revisit this test once multitab support is finalized.
class TabSwitching(page_measurement.PageMeasurement):
+
+ # Amount of time to measure, in seconds.
+ SAMPLE_TIME = 30
+
def __init__(self):
super(TabSwitching, self).__init__()
self._first_page_in_pageset = True
- self._power_metric = power.PowerMetric()
+ self._power_metric = None
def CustomizeBrowserOptions(self, options):
options.AppendExtraBrowserArgs([
@@ -32,8 +36,9 @@ class TabSwitching(page_measurement.PageMeasurement):
])
power.PowerMetric.CustomizeBrowserOptions(options)
- def DidStartBrowser(self, browser):
+ def WillStartBrowser(self, browser):
self._first_page_in_pageset = True
+ self._power_metric = power.PowerMetric(browser, TabSwitching.SAMPLE_TIME)
def TabForPage(self, page, browser):
if self._first_page_in_pageset:
@@ -58,7 +63,7 @@ class TabSwitching(page_measurement.PageMeasurement):
util.WaitFor(tab.HasReachedQuiescence, 60)
self._power_metric.Start(page, tab)
- time.sleep(60)
+ time.sleep(TabSwitching.SAMPLE_TIME)
self._power_metric.Stop(page, tab)
self._power_metric.AddResults(tab, results,)
« no previous file with comments | « tools/perf/measurements/smoothness_unittest.py ('k') | tools/perf/measurements/webrtc.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698