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 telemetry
.page
import page_test
7 from metrics
import power
10 class Power(page_test
.PageTest
):
12 super(Power
, self
).__init
__()
13 self
._power
_metric
= None
15 def WillStartBrowser(self
, platform
):
16 self
._power
_metric
= power
.PowerMetric(platform
)
18 def DidNavigateToPage(self
, page
, tab
):
19 self
._power
_metric
.Start(page
, tab
)
21 def ValidateAndMeasurePage(self
, page
, tab
, results
):
22 self
._power
_metric
.Stop(page
, tab
)
23 self
._power
_metric
.AddResults(tab
, results
)