| 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
|
| +
|
| + 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.
|
| + """
|
| + self.ready_state_predicate = predicate_function
|
| +
|
| + def Run(self):
|
| + raise NotImplementedError
|
| +
|
|
|