Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 # Use of this source code is governed by a BSD-style license that can be | |
| 3 # found in the LICENSE file. | |
| 4 | |
| 5 import time | |
| 6 | |
| 7 from metrics import cpu | |
| 8 from metrics import power | |
| 9 from telemetry.page import page_test | |
| 10 | |
| 11 | |
| 12 class Energy(page_test.PageTest): | |
|
sullivan
2015/04/21 15:56:53
It's pretty confusing to have both "Power" and "En
Andre
2015/04/22 00:46:54
Done, merged into power.py.
| |
| 13 """Measures energy usage and idle wakeups after the page is loaded.""" | |
| 14 | |
| 15 # Amount of time to measure, in seconds. | |
| 16 SAMPLE_TIME = 30 | |
| 17 | |
| 18 def ValidateAndMeasurePage(self, page, tab, results): | |
| 19 metric = power.PowerMetric(tab.browser.platform) | |
| 20 metric.Start(page, tab) | |
| 21 | |
| 22 time.sleep(Energy.SAMPLE_TIME) | |
| 23 | |
| 24 metric.Stop(page, tab) | |
| 25 metric.AddResults(tab, results) | |
| OLD | NEW |