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

Unified Diff: tools/telemetry/telemetry/user_story/android/shared_app_state.py

Issue 852623002: Call test methods from shared_app_state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DidRunUserStory. Drop tracing_controller temp reference. Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/user_story/android/shared_app_state.py
diff --git a/tools/telemetry/telemetry/user_story/android/shared_app_state.py b/tools/telemetry/telemetry/user_story/android/shared_app_state.py
index 80825271e4e61d6c1901341e547bb11fe37437b7..79777e41c8b622a75a6a83a4135625e43b35068e 100644
--- a/tools/telemetry/telemetry/user_story/android/shared_app_state.py
+++ b/tools/telemetry/telemetry/user_story/android/shared_app_state.py
@@ -11,8 +11,6 @@ from telemetry.user_story import shared_user_story_state
from telemetry.web_perf import timeline_based_measurement
-# TODO(slamm): Interact with TimelineBasedMeasurement when it no longer
-# depends on browser logic.
class SharedAppState(shared_user_story_state.SharedUserStoryState):
"""Manage test state/transitions across multiple android.UserStory's.
@@ -34,6 +32,7 @@ class SharedAppState(shared_user_story_state.SharedUserStoryState):
raise ValueError(
'SharedAppState only accepts TimelineBasedMeasurement tests'
' (not %s).' % test.__class__)
+ self._test = test
self._finder_options = finder_options
self._android_app = None
self._current_user_story = None
@@ -53,21 +52,28 @@ class SharedAppState(shared_user_story_state.SharedUserStoryState):
def WillRunUserStory(self, user_story):
assert not self._android_app
+ self._test.WillRunUserStory(self._android_platform.tracing_controller)
self._current_user_story = user_story
self._android_app = self._android_platform.LaunchAndroidApplication(
user_story.start_intent, user_story.is_app_ready_predicate)
def RunUserStory(self, results):
self._current_user_story.Run(self)
+ self._test.Measure(self._android_platform.tracing_controller, results)
def DidRunUserStory(self, results):
+ self._test.DidRunUserStory(self._android_platform.tracing_controller)
if self._android_app:
self._android_app.Close()
self._android_app = None
def GetTestExpectationAndSkipValue(self, expectations):
- # TODO(chrishenry): Implement this properly.
+ """This does not apply to android app user stories."""
return 'pass', None
def TearDownState(self, results):
+ """Tear down anything created in the __init__ method that is not needed.
+
+ Currently, there is no clean-up needed from SharedAppState.__init__.
+ """
pass
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698