OLD | NEW |
---|---|
(Empty) | |
1 # Copyright 2015 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 | |
6 | |
7 | |
8 class KeyPowerPage(page_module.Page): | |
9 | |
10 def __init__(self, url, page_set, turn_screen_off): | |
11 super(KeyPowerPage, self).__init__( | |
12 url=url, page_set=page_set) | |
13 self.user_agent_type = 'mobile' | |
14 self._turn_screen_off = turn_screen_off | |
15 | |
16 def RunNavigateSteps(self, action_runner): | |
17 action_runner._tab.browser.platform.android_action_runner.TurnScreenOn() | |
18 super(KeyPowerPage, self).RunNavigateSteps(action_runner) | |
19 action_runner.Wait(2) | |
20 if self._turn_screen_off: | |
21 action_runner._tab.browser.platform.android_action_runner.TurnScreenOff() | |
22 action_runner.Wait(2) | |
23 | |
24 def RunPageInteractions(self, action_runner): | |
25 action_runner.Wait(20) | |
26 # TODO(jdduke): Restore screen state? | |
27 | |
rnephew (Reviews Here)
2015/04/23 18:28:05
Should the turn screen off/on step be performed he
jdduke (slow)
2015/04/24 16:10:52
Right, we don't want the "interaction" to include
| |
28 | |
29 class KeyPowerCasesPageSet(page_set_module.PageSet): | |
30 | |
31 """ Key power cases """ | |
32 | |
33 def __init__(self): | |
34 super(KeyPowerCasesPageSet, self).__init__( | |
35 user_agent_type='mobile') | |
36 | |
37 foreground_urls_list = [ | |
38 # Why: Ensure minimal activity for static, empty pages in the foreground. | |
39 'file://key_power_cases/blank.html', | |
rnephew (Reviews Here)
2015/04/23 18:28:05
I dont know enough about telemetry to know if it s
jdduke (slow)
2015/04/24 16:10:52
Typically, yes, but these are (intentionally) synt
| |
40 ] | |
41 | |
42 for url in foreground_urls_list: | |
43 self.AddUserStory(KeyPowerPage(url, self, False)) | |
44 | |
45 background_urls_list = [ | |
46 # Why: Ensure animated GIFs aren't processed when Chrome is backgrounded. | |
47 'file://key_power_cases/animated-gif.html', | |
48 # Why: Ensure CSS animations aren't processed when Chrome is backgrounded. | |
49 'file://key_power_cases/css-animation.html', | |
50 # Why: Ensure rAF is suppressed when Chrome is backgrounded. | |
51 'file://key_power_cases/request-animation-frame.html', | |
52 # Why: Ensure setTimeout is throttled when Chrome is backgrounded. | |
53 'file://key_power_cases/set-timeout.html', | |
54 ] | |
55 | |
56 for url in background_urls_list: | |
57 self.AddUserStory(KeyPowerPage(url, self, True)) | |
OLD | NEW |