OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 page_sets import android_screen_restoration_shared_state | 4 from page_sets import android_screen_restoration_shared_state |
5 | 5 |
6 from telemetry.page import page as page_module | 6 from telemetry.page import page as page_module |
7 from telemetry.page import page_set as page_set_module | 7 from telemetry.page import page_set as page_set_module |
8 | 8 |
9 | 9 |
10 class KeyIdlePowerPage(page_module.Page): | 10 class KeyIdlePowerPage(page_module.Page): |
(...skipping 15 matching lines...) Expand all Loading... |
26 # exposed here, crbug.com/470147. | 26 # exposed here, crbug.com/470147. |
27 # pylint: disable=protected-access | 27 # pylint: disable=protected-access |
28 action_runner._tab.browser.platform.android_action_runner.TurnScreenOff() | 28 action_runner._tab.browser.platform.android_action_runner.TurnScreenOff() |
29 # We're not interested in tracking activity that occurs immediately after | 29 # We're not interested in tracking activity that occurs immediately after |
30 # the screen is turned off. Several seconds should be enough time for the | 30 # the screen is turned off. Several seconds should be enough time for the |
31 # browser to "settle down" into an idle state. | 31 # browser to "settle down" into an idle state. |
32 action_runner.Wait(2) | 32 action_runner.Wait(2) |
33 | 33 |
34 def RunPageInteractions(self, action_runner): | 34 def RunPageInteractions(self, action_runner): |
35 # The page interaction is simply waiting in an idle state. | 35 # The page interaction is simply waiting in an idle state. |
36 with action_runner.CreateInteraction('IdleWaiting'): | 36 action_runner.Wait(20) |
37 action_runner.Wait(20) | |
38 | 37 |
39 | 38 |
40 class KeyIdlePowerCasesPageSet(page_set_module.PageSet): | 39 class KeyIdlePowerCasesPageSet(page_set_module.PageSet): |
41 | 40 |
42 """ Key idle power cases """ | 41 """ Key idle power cases """ |
43 | 42 |
44 def __init__(self): | 43 def __init__(self): |
45 super(KeyIdlePowerCasesPageSet, self).__init__(user_agent_type='mobile') | 44 super(KeyIdlePowerCasesPageSet, self).__init__(user_agent_type='mobile') |
46 | 45 |
47 foreground_urls_list = [ | 46 foreground_urls_list = [ |
(...skipping 10 matching lines...) Expand all Loading... |
58 # Why: Ensure CSS animations aren't processed when Chrome is backgrounded. | 57 # Why: Ensure CSS animations aren't processed when Chrome is backgrounded. |
59 'file://key_idle_power_cases/css-animation.html', | 58 'file://key_idle_power_cases/css-animation.html', |
60 # Why: Ensure rAF is suppressed when Chrome is backgrounded. | 59 # Why: Ensure rAF is suppressed when Chrome is backgrounded. |
61 'file://key_idle_power_cases/request-animation-frame.html', | 60 'file://key_idle_power_cases/request-animation-frame.html', |
62 # Why: Ensure setTimeout is throttled when Chrome is backgrounded. | 61 # Why: Ensure setTimeout is throttled when Chrome is backgrounded. |
63 'file://key_idle_power_cases/set-timeout.html', | 62 'file://key_idle_power_cases/set-timeout.html', |
64 ] | 63 ] |
65 | 64 |
66 for url in background_urls_list: | 65 for url in background_urls_list: |
67 self.AddUserStory(KeyIdlePowerPage(url, self, True)) | 66 self.AddUserStory(KeyIdlePowerPage(url, self, True)) |
OLD | NEW |