1 # Copyright 2014 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.
5 from metrics
import power
6 from telemetry
.page
import page_test
8 class Power(page_test
.PageTest
):
10 super(Power
, self
).__init
__('RunPowerPageInteractions')
11 self
._power
_metric
= None
13 def WillStartBrowser(self
, platform
):
14 self
._power
_metric
= power
.PowerMetric(platform
)
16 def DidNavigateToPage(self
, page
, tab
):
17 self
._power
_metric
.Start(page
, tab
)
19 def ValidateAndMeasurePage(self
, page
, tab
, results
):
20 self
._power
_metric
.Stop(page
, tab
)
21 self
._power
_metric
.AddResults(tab
, results
)