| 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()
|
| +
|
| + def DidRunUserStory(self, results):
|
| + try:
|
| + super(AndroidScreenRestorationSharedState, self).DidRunUserStory(results)
|
| + finally:
|
| + self._EnsureScreenOn()
|
| +
|
| + def _EnsureScreenOn(self):
|
| + self.platform.android_action_runner.TurnScreenOn()
|
| +
|
|
|