OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 from telemetry.page import page as page_module | 4 from telemetry.page import page as page_module |
5 from telemetry.page import page_set as page_set_module | 5 from telemetry.page import page_set as page_set_module |
6 | 6 |
7 | 7 |
8 class ToughEnergyCasesPage(page_module.Page): | 8 class ToughEnergyCasesPage(page_module.Page): |
9 | 9 |
10 def __init__(self, url, page_set): | 10 def __init__(self, url, page_set): |
11 super(ToughEnergyCasesPage, self).__init__( | 11 super(ToughEnergyCasesPage, self).__init__( |
12 url=url, page_set=page_set, credentials_path = 'data/credentials.json') | 12 url=url, page_set=page_set, credentials_path = 'data/credentials.json') |
13 | 13 |
14 class CodePenPage(ToughEnergyCasesPage): | 14 class CodePenPage(ToughEnergyCasesPage): |
15 | 15 |
16 def __init__(self, url, page_set): | 16 def __init__(self, url, page_set): |
17 super(CodePenPage, self).__init__(url, page_set) | 17 super(CodePenPage, self).__init__(url, page_set) |
18 self.credentials = 'codepen' | 18 self.credentials = 'codepen' |
19 | 19 |
20 | 20 |
21 class GooglePage(ToughEnergyCasesPage): | 21 class GooglePage(ToughEnergyCasesPage): |
22 | 22 |
23 def __init__(self, url, page_set): | 23 def __init__(self, url, page_set): |
24 super(GooglePage, self).__init__( | 24 super(GooglePage, self).__init__( |
25 url=url, | 25 url=url, |
26 page_set=page_set) | 26 page_set=page_set) |
27 self.credentials = 'google' | 27 self.credentials = 'google2' |
28 | 28 |
29 def RunNavigateSteps(self, action_runner): | 29 def RunNavigateSteps(self, action_runner): |
30 super(GooglePage, self).RunNavigateSteps(action_runner) | 30 super(GooglePage, self).RunNavigateSteps(action_runner) |
31 action_runner.WaitForJavaScriptCondition( | 31 action_runner.WaitForJavaScriptCondition( |
32 'window.gmonkey !== undefined &&' | 32 'window.gmonkey !== undefined &&' |
33 'document.getElementById("gb") !== null') | 33 'document.getElementById("gb") !== null') |
34 | 34 |
35 | 35 |
36 class ToughEnergyCasesPageSet(page_set_module.PageSet): | 36 class ToughEnergyCasesPageSet(page_set_module.PageSet): |
37 """Pages for measuring Chrome power draw.""" | 37 """Pages for measuring Chrome power draw.""" |
38 | 38 |
39 def __init__(self): | 39 def __init__(self): |
40 super(ToughEnergyCasesPageSet, self).__init__( | 40 super(ToughEnergyCasesPageSet, self).__init__( |
41 archive_data_file='data/tough_energy_cases.json', | 41 archive_data_file='data/tough_energy_cases.json', |
42 bucket=page_set_module.PARTNER_BUCKET) | 42 bucket=page_set_module.PARTNER_BUCKET) |
43 | 43 |
| 44 # TODO: this part of the test is disabled because it fails when |
| 45 # run with replay data and not with live data. See crbug.com/465692 |
| 46 # for complete details. |
44 # Why: productivity, top google properties | 47 # Why: productivity, top google properties |
45 self.AddUserStory(GooglePage('https://mail.google.com/mail/', self)) | 48 #self.AddUserStory(GooglePage('https://mail.google.com/mail/', self)) |
46 | 49 |
47 # Disabled: pegs CPU too much to get meaningful results. | 50 # Disabled: pegs CPU too much to get meaningful results. |
48 # Why: Image constantly changed in the background, above the fold | 51 # Why: Image constantly changed in the background, above the fold |
49 # self.AddUserStory(CodePenPage( | 52 # self.AddUserStory(CodePenPage( |
50 # 'http://codepen.io/testificate364/debug/eIutG', self)) | 53 # 'http://codepen.io/testificate364/debug/eIutG', self)) |
51 | 54 |
52 # Disabled: pegs CPU too much to get meaningful results. | 55 # Disabled: pegs CPU too much to get meaningful results. |
53 # Why: Image constantly changed in the background, below the fold | 56 # Why: Image constantly changed in the background, below the fold |
54 # self.AddUserStory(CodePenPage( | 57 # self.AddUserStory(CodePenPage( |
55 # 'http://codepen.io/testificate364/debug/zcDdv', self)) | 58 # 'http://codepen.io/testificate364/debug/zcDdv', self)) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 # self.AddUserStory(CodePenPage( | 120 # self.AddUserStory(CodePenPage( |
118 # 'http://codepen.io/testificate364/debug/ckItK', self)) | 121 # 'http://codepen.io/testificate364/debug/ckItK', self)) |
119 | 122 |
120 # Why: flash video | 123 # Why: flash video |
121 self.AddUserStory(CodePenPage( | 124 self.AddUserStory(CodePenPage( |
122 'http://codepen.io/testificate364/debug/slBue', self)) | 125 'http://codepen.io/testificate364/debug/slBue', self)) |
123 | 126 |
124 # Why: Blank page in the foreground | 127 # Why: Blank page in the foreground |
125 self.AddUserStory(CodePenPage( | 128 self.AddUserStory(CodePenPage( |
126 'http://codepen.io/testificate364/debug/HdIgr', self)) | 129 'http://codepen.io/testificate364/debug/HdIgr', self)) |
OLD | NEW |