| OLD | NEW |
| (Empty) |
| 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 import story | |
| 6 | |
| 7 | |
| 8 class ToughEnergyCasesPage(page_module.Page): | |
| 9 | |
| 10 def __init__(self, url, page_set): | |
| 11 super(ToughEnergyCasesPage, self).__init__( | |
| 12 url=url, page_set=page_set, credentials_path = 'data/credentials.json') | |
| 13 | |
| 14 class CodePenPage(ToughEnergyCasesPage): | |
| 15 | |
| 16 def __init__(self, url, page_set): | |
| 17 super(CodePenPage, self).__init__(url, page_set) | |
| 18 self.credentials = 'codepen' | |
| 19 | |
| 20 | |
| 21 class GooglePage(ToughEnergyCasesPage): | |
| 22 | |
| 23 def __init__(self, url, page_set): | |
| 24 super(GooglePage, self).__init__( | |
| 25 url=url, | |
| 26 page_set=page_set) | |
| 27 self.credentials = 'google2' | |
| 28 | |
| 29 def RunNavigateSteps(self, action_runner): | |
| 30 super(GooglePage, self).RunNavigateSteps(action_runner) | |
| 31 action_runner.WaitForJavaScriptCondition( | |
| 32 'window.gmonkey !== undefined &&' | |
| 33 'document.getElementById("gb") !== null') | |
| 34 | |
| 35 | |
| 36 class ToughEnergyCasesPageSet(story.StorySet): | |
| 37 """Pages for measuring Chrome power draw.""" | |
| 38 | |
| 39 def __init__(self): | |
| 40 super(ToughEnergyCasesPageSet, self).__init__( | |
| 41 archive_data_file='data/tough_energy_cases.json', | |
| 42 cloud_storage_bucket=story.PARTNER_BUCKET) | |
| 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. | |
| 47 # Why: productivity, top google properties | |
| 48 #self.AddStory(GooglePage('https://mail.google.com/mail/', self)) | |
| 49 | |
| 50 # Disabled: pegs CPU too much to get meaningful results. | |
| 51 # Why: Image constantly changed in the background, above the fold | |
| 52 # self.AddStory(CodePenPage( | |
| 53 # 'http://codepen.io/testificate364/debug/eIutG', self)) | |
| 54 | |
| 55 # Disabled: pegs CPU too much to get meaningful results. | |
| 56 # Why: Image constantly changed in the background, below the fold | |
| 57 # self.AddStory(CodePenPage( | |
| 58 # 'http://codepen.io/testificate364/debug/zcDdv', self)) | |
| 59 | |
| 60 # Why: CSS Animation, above the fold | |
| 61 self.AddStory(CodePenPage( | |
| 62 'http://codepen.io/testificate364/debug/nrbDc', self)) | |
| 63 | |
| 64 # Why: CSS Animation, below the fold | |
| 65 self.AddStory(CodePenPage( | |
| 66 'http://codepen.io/testificate364/debug/fhKCg', self)) | |
| 67 | |
| 68 # Why: requestAnimationFrame, above the fold | |
| 69 self.AddStory(CodePenPage( | |
| 70 'http://codepen.io/testificate364/debug/paJhg',self)) | |
| 71 | |
| 72 # Why: requestAnimationFrame, below the fold | |
| 73 self.AddStory(CodePenPage( | |
| 74 'http://codepen.io/testificate364/debug/yaosK', self)) | |
| 75 | |
| 76 # Why: setTimeout animation, above the fold | |
| 77 self.AddStory(CodePenPage( | |
| 78 'http://codepen.io/testificate364/debug/DLbxg', self)) | |
| 79 | |
| 80 # Why: setTimeout animation, below the fold | |
| 81 self.AddStory(CodePenPage( | |
| 82 'http://codepen.io/testificate364/debug/kFvpd', self)) | |
| 83 | |
| 84 # Why: setInterval animation, above the fold | |
| 85 self.AddStory(CodePenPage( | |
| 86 'http://codepen.io/testificate364/debug/lEhyw', self)) | |
| 87 | |
| 88 # Why: setInterval animation, below the fold | |
| 89 self.AddStory(CodePenPage( | |
| 90 'http://codepen.io/testificate364/debug/zhgBD', self)) | |
| 91 | |
| 92 # Why: Animated GIF, above the fold | |
| 93 self.AddStory(CodePenPage( | |
| 94 'http://codepen.io/testificate364/debug/jetyn', self)) | |
| 95 | |
| 96 # Why: Animated GIF, below the fold | |
| 97 self.AddStory(CodePenPage( | |
| 98 'http://codepen.io/testificate364/debug/Kvdxs', self)) | |
| 99 | |
| 100 # Why: HTML5 video, above the fold | |
| 101 self.AddStory(CodePenPage( | |
| 102 'http://codepen.io/testificate364/debug/lJAiH', self)) | |
| 103 | |
| 104 # Why: HTML5 video, below the fold | |
| 105 self.AddStory(CodePenPage( | |
| 106 'http://codepen.io/testificate364/debug/EFceH', self)) | |
| 107 | |
| 108 # Disabled: pegs CPU too much to get meaningful results. | |
| 109 # Why: PostMessage between frames, above the fold | |
| 110 # self.AddStory(CodePenPage( | |
| 111 # 'http://codepen.io/testificate364/debug/pgBHu', self)) | |
| 112 | |
| 113 # Disabled: pegs CPU too much to get meaningful results. | |
| 114 # Why: Asynchronous XHR continually running | |
| 115 # self.AddStory(CodePenPage( | |
| 116 # 'http://codepen.io/testificate364/debug/iwAfJ', self)) | |
| 117 | |
| 118 # Disabled: pegs CPU too much to get meaningful results. | |
| 119 # Why: Web Worker continually running | |
| 120 # self.AddStory(CodePenPage( | |
| 121 # 'http://codepen.io/testificate364/debug/ckItK', self)) | |
| 122 | |
| 123 # Why: flash video | |
| 124 self.AddStory(CodePenPage( | |
| 125 'http://codepen.io/testificate364/debug/slBue', self)) | |
| 126 | |
| 127 # Why: Blank page in the foreground | |
| 128 self.AddStory(CodePenPage( | |
| 129 'http://codepen.io/testificate364/debug/HdIgr', self)) | |
| OLD | NEW |