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.
4 from telemetry
.page
import page
as page_module
5 from telemetry
.page
import page_set
as page_set_module
8 class ToughEnergyCasesPage(page_module
.Page
):
10 def __init__(self
, url
, page_set
):
11 super(ToughEnergyCasesPage
, self
).__init
__(url
=url
, page_set
=page_set
)
12 self
.credentials_path
= 'data/credentials.json'
15 class GmailPage(ToughEnergyCasesPage
):
17 """ Why: productivity, top google properties """
19 def __init__(self
, page_set
):
20 super(GmailPage
, self
).__init
__(
21 url
='https://mail.google.com/mail/',
24 self
.credentials
= 'google'
26 def RunNavigateSteps(self
, action_runner
):
27 action_runner
.NavigateToPage(self
)
28 action_runner
.WaitForJavaScriptCondition(
29 'window.gmonkey !== undefined &&'
30 'document.getElementById("gb") !== null')
33 class ToughEnergyCasesPageSet(page_set_module
.PageSet
):
35 """ Pages for measuring Chrome power draw. """
38 super(ToughEnergyCasesPageSet
, self
).__init
__(
39 archive_data_file
='data/tough_energy_cases.json',
40 bucket
=page_set_module
.PUBLIC_BUCKET
,
41 credentials_path
='data/credentials.json')
43 # Why: Above the fold animated gif running in the background
44 self
.AddPage(ToughEnergyCasesPage(
45 'file://tough_energy_cases/above-fold-animated-gif.html',
47 # TODO(dominikg): fix crbug.com/386152
48 #self.AddPage(GmailPage(self))
49 # Why: Below the fold animated gif
50 self
.AddPage(ToughEnergyCasesPage(
51 'file://tough_energy_cases/below-fold-animated-gif.html',
53 # Why: Below the fold flash animation
54 self
.AddPage(ToughEnergyCasesPage(
55 'file://tough_energy_cases/below-fold-flash.html',