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