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__(url=url, page_set=page_set) | 11 super(ToughEnergyCasesPage, self).__init__(url=url, page_set=page_set) |
12 self.credentials_path = 'data/credentials.json' | 12 self.credentials_path = 'data/credentials.json' |
13 | 13 |
14 | 14 |
| 15 class CodePenPage(ToughEnergyCasesPage): |
| 16 |
| 17 def __init__(self, url, page_set): |
| 18 super(CodePenPage, self).__init__(url, page_set) |
| 19 self.credentials = 'codepen' |
| 20 |
| 21 |
15 class GmailPage(ToughEnergyCasesPage): | 22 class GmailPage(ToughEnergyCasesPage): |
16 | 23 |
17 """ Why: productivity, top google properties """ | 24 """ Why: productivity, top google properties """ |
18 | 25 |
19 def __init__(self, page_set): | 26 def __init__(self, page_set): |
20 super(GmailPage, self).__init__( | 27 super(GmailPage, self).__init__( |
21 url='https://mail.google.com/mail/', | 28 url='https://mail.google.com/mail/', |
22 page_set=page_set) | 29 page_set=page_set) |
23 | 30 |
24 self.credentials = 'google' | 31 self.credentials = 'google' |
25 | 32 |
26 def RunNavigateSteps(self, action_runner): | 33 def RunNavigateSteps(self, action_runner): |
27 action_runner.NavigateToPage(self) | 34 action_runner.NavigateToPage(self) |
28 action_runner.WaitForJavaScriptCondition( | 35 action_runner.WaitForJavaScriptCondition( |
29 'window.gmonkey !== undefined &&' | 36 'window.gmonkey !== undefined &&' |
30 'document.getElementById("gb") !== null') | 37 'document.getElementById("gb") !== null') |
31 | 38 |
32 | 39 |
33 class ToughEnergyCasesPageSet(page_set_module.PageSet): | 40 class ToughEnergyCasesPageSet(page_set_module.PageSet): |
34 | 41 |
35 """ Pages for measuring Chrome power draw. """ | 42 """ Pages for measuring Chrome power draw. """ |
36 | 43 |
37 def __init__(self): | 44 def __init__(self): |
38 super(ToughEnergyCasesPageSet, self).__init__( | 45 super(ToughEnergyCasesPageSet, self).__init__( |
39 archive_data_file='data/tough_energy_cases.json', | 46 archive_data_file='data/tough_energy_cases.json', |
40 bucket=page_set_module.PUBLIC_BUCKET, | 47 bucket=page_set_module.PUBLIC_BUCKET, |
41 credentials_path='data/credentials.json') | 48 credentials_path='data/credentials.json') |
42 | 49 |
43 # Why: Above the fold animated gif running in the background | 50 # TODO(sullivan): uncomment this when Google login works properly. |
44 self.AddPage(ToughEnergyCasesPage( | |
45 'file://tough_energy_cases/above-fold-animated-gif.html', | |
46 self)) | |
47 # TODO(dominikg): fix crbug.com/386152 | |
48 #self.AddPage(GmailPage(self)) | 51 #self.AddPage(GmailPage(self)) |
49 # Why: Below the fold animated gif | 52 |
50 self.AddPage(ToughEnergyCasesPage( | 53 # Why: Image constantly changed in the background, above the fold |
51 'file://tough_energy_cases/below-fold-animated-gif.html', | 54 self.AddPage(CodePenPage( |
52 self)) | 55 'http://codepen.io/testificate364/debug/eIutG', self)) |
53 # Why: Below the fold flash animation | 56 |
54 self.AddPage(ToughEnergyCasesPage( | 57 # Why: Image constantly changed in the background, below the fold |
55 'file://tough_energy_cases/below-fold-flash.html', | 58 self.AddPage(CodePenPage( |
56 self)) | 59 'http://codepen.io/testificate364/debug/zcDdv', self)) |
| 60 |
| 61 # Why: CSS Animation, above the fold |
| 62 self.AddPage(CodePenPage( |
| 63 'http://codepen.io/testificate364/debug/nrbDc', self)) |
| 64 |
| 65 # Why: CSS Animation, below the fold |
| 66 self.AddPage(CodePenPage( |
| 67 'http://codepen.io/testificate364/debug/fhKCg', self)) |
| 68 |
| 69 # Why: requestAnimationFrame, above the fold |
| 70 self.AddPage(CodePenPage( |
| 71 'http://codepen.io/testificate364/debug/paJhg',self)) |
| 72 |
| 73 # Why: requestAnimationFrame, below the fold |
| 74 self.AddPage(CodePenPage( |
| 75 'http://codepen.io/testificate364/debug/yaosK', self)) |
| 76 |
| 77 # Why: setTimeout animation, above the fold |
| 78 self.AddPage(CodePenPage( |
| 79 'http://codepen.io/testificate364/debug/DLbxg', self)) |
| 80 |
| 81 # Why: setTimeout animation, below the fold |
| 82 self.AddPage(CodePenPage( |
| 83 'http://codepen.io/testificate364/debug/kFvpd', self)) |
| 84 |
| 85 # Why: setInterval animation, above the fold |
| 86 self.AddPage(CodePenPage( |
| 87 'http://codepen.io/testificate364/debug/lEhyw', self)) |
| 88 |
| 89 # Why: setInterval animation, below the fold |
| 90 self.AddPage(CodePenPage( |
| 91 'http://codepen.io/testificate364/debug/zhgBD', self)) |
| 92 |
| 93 # Why: Animated GIF, above the fold |
| 94 self.AddPage(CodePenPage( |
| 95 'http://codepen.io/testificate364/debug/jetyn', self)) |
| 96 |
| 97 # Why: Animated GIF, below the fold |
| 98 self.AddPage(CodePenPage( |
| 99 'http://codepen.io/testificate364/debug/Kvdxs', self)) |
| 100 |
| 101 # Why: HTML5 video, above the fold |
| 102 self.AddPage(CodePenPage( |
| 103 'http://codepen.io/testificate364/debug/lJAiH', self)) |
| 104 |
| 105 # Why: HTML5 video, below the fold |
| 106 self.AddPage(CodePenPage( |
| 107 'http://codepen.io/testificate364/debug/EFceH', self)) |
| 108 |
| 109 # Why: PostMessage between frames, above the fold |
| 110 self.AddPage(CodePenPage( |
| 111 'http://codepen.io/testificate364/debug/pgBHu', self)) |
| 112 |
| 113 # Why: Asynchronous XHR continually running |
| 114 self.AddPage(CodePenPage( |
| 115 'http://codepen.io/testificate364/debug/iwAfJ', self)) |
| 116 |
| 117 # Why: Web Worker continually running |
| 118 self.AddPage(CodePenPage( |
| 119 'http://codepen.io/testificate364/debug/ckItK', self)) |
| 120 |
| 121 # Why: flash video |
| 122 self.AddPage(CodePenPage( |
| 123 'http://codepen.io/testificate364/debug/cFEaD', self)) |
| 124 |
| 125 # Why: Blank page in the foreground |
| 126 self.AddPage(CodePenPage( |
| 127 'http://codepen.io/testificate364/debug/HdIgr', self)) |
OLD | NEW |