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

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

Issue 776883004: Basic android app implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a couple errors Created 6 years 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/telemetry/telemetry/user_story/android/__init__.py
diff --git a/tools/telemetry/telemetry/user_story/android/__init__.py b/tools/telemetry/telemetry/user_story/android/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..1b19cd487182796f51a9ec61ff9cd1ce6d40956e
--- /dev/null
+++ b/tools/telemetry/telemetry/user_story/android/__init__.py
@@ -0,0 +1,37 @@
+# Copyright 2014 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 import user_story
+from telemetry.user_story.android import shared_app_state
+
+class AppStory(user_story.UserStory):
+ def __init__(self, start_intent, name='', labels=None):
+ super(AppStory, self).__init__(
+ shared_app_state.SharedAppState, name, labels)
+ self.start_intent = start_intent
+ self.ready_state_predicate = self._CheckThatProcessHasStarted
+
+ def _CheckThatProcessHasStarted(self):
+ return True
chrishenry 2014/12/05 06:21:01 TODO here or remove ready_state_predicate in this
slamm 2014/12/06 00:39:59 Done.
+
+ def SetReadyStatePredicate(self, predicate_function):
+ """Overrides the default ready state predicate function.
+
+ This is used to determine whether an application has started
+ successfully and reached a state where the user story has run. The
+ default predicate checks whether the process has started. Returns
+ True when the application is ready.
+
+ Here is an example: An app that requires a WebView to start may
+ want to check that the WebView has started before returning True.
+
+ Args:
+ predicate_function: The predicate function that returns True
+ when the application is ready to run the user story.
chrishenry 2014/12/05 06:21:01 (We worked on this pydoc already, so I kept the te
slamm 2014/12/06 00:39:59 Done.
+ """
+ self.ready_state_predicate = predicate_function
+
+ def Run(self):
chrishenry 2014/12/05 06:21:01 Can you add a TODO, to indicate that this would no
slamm 2014/12/06 00:39:59 Done.
+ raise NotImplementedError
+

Powered by Google App Engine
This is Rietveld 408576698