Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: tools/perf/page_sets/android_screen_restoration_shared_state.py

Issue 1097463004: Add key_idle_power_cases for ensuring idle activity on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lint Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/perf/benchmarks/thread_times.py ('k') | tools/perf/page_sets/key_idle_power_cases.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 import logging
5
6 from telemetry.page import shared_page_state
7
8
9 class AndroidScreenRestorationSharedState(shared_page_state.SharedPageState):
10 """ Ensures the screen is on before and after each user story is run. """
11
12 def WillRunUserStory(self, page):
13 super(AndroidScreenRestorationSharedState, self).WillRunUserStory(page)
14 self._EnsureScreenOn()
15
16 def DidRunUserStory(self, results):
17 try:
18 super(AndroidScreenRestorationSharedState, self).DidRunUserStory(results)
19 finally:
20 self._EnsureScreenOn()
21
22 def CanRunOnBrowser(self, browser_info):
23 if not browser_info.browser_type.startswith('android'):
24 logging.warning('Browser is non-Android, skipping test')
25 return False
26 return True
27
28 def _EnsureScreenOn(self):
29 self.platform.android_action_runner.EnsureScreenOn()
OLDNEW
« no previous file with comments | « tools/perf/benchmarks/thread_times.py ('k') | tools/perf/page_sets/key_idle_power_cases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698