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

Unified 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: Code review Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: tools/perf/page_sets/android_screen_restoration_shared_state.py
diff --git a/tools/perf/page_sets/android_screen_restoration_shared_state.py b/tools/perf/page_sets/android_screen_restoration_shared_state.py
new file mode 100644
index 0000000000000000000000000000000000000000..c08af94f089634f98bb8b2658b1151284ef6ccc7
--- /dev/null
+++ b/tools/perf/page_sets/android_screen_restoration_shared_state.py
@@ -0,0 +1,22 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+from telemetry.page import shared_page_state
+
+
+class AndroidScreenRestorationSharedState(shared_page_state.SharedPageState):
+ """ Ensures the screen is on before and after each user story run. """
+
+ def WillRunUserStory(self, page):
+ super(AndroidScreenRestorationSharedState, self).WillRunUserStory(page)
+ self._EnsureScreenOn()
+
nednguyen 2015/04/27 17:47:49 You will want to override GetTestExpectationAndSki
jdduke (slow) 2015/04/28 21:30:29 Done. (overrode CanRunOnBrowser).
+ def DidRunUserStory(self, results):
+ try:
+ super(AndroidScreenRestorationSharedState, self).DidRunUserStory(results)
+ finally:
+ self._EnsureScreenOn()
+
+ def _EnsureScreenOn(self):
+ self.platform.android_action_runner.TurnScreenOn()
+

Powered by Google App Engine
This is Rietveld 408576698