OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 import os | 4 import os |
5 | 5 |
6 from telemetry.core import platform | 6 from telemetry.core import platform |
7 from telemetry.core.platform import android_platform | 7 from telemetry.core.platform import android_platform |
8 from telemetry.core import wpr_modes | 8 from telemetry.core import wpr_modes |
9 from telemetry.core.platform import android_device | 9 from telemetry.core.platform import android_device |
10 from telemetry.user_story import shared_user_story_state | 10 from telemetry.user_story import shared_user_story_state |
(...skipping 19 matching lines...) Expand all Loading... |
30 if not isinstance( | 30 if not isinstance( |
31 test, timeline_based_measurement.TimelineBasedMeasurement): | 31 test, timeline_based_measurement.TimelineBasedMeasurement): |
32 raise ValueError( | 32 raise ValueError( |
33 'SharedAppState only accepts TimelineBasedMeasurement tests' | 33 'SharedAppState only accepts TimelineBasedMeasurement tests' |
34 ' (not %s).' % test.__class__) | 34 ' (not %s).' % test.__class__) |
35 self._test = test | 35 self._test = test |
36 self._finder_options = finder_options | 36 self._finder_options = finder_options |
37 self._android_app = None | 37 self._android_app = None |
38 self._current_user_story = None | 38 self._current_user_story = None |
39 self._android_platform = platform.GetPlatformForDevice( | 39 self._android_platform = platform.GetPlatformForDevice( |
40 android_device.GetDevice(finder_options), finder_options) | 40 android_device.GetDevice(finder_options)) |
41 assert self._android_platform, 'Unable to create android platform.' | 41 assert self._android_platform, 'Unable to create android platform.' |
42 assert isinstance( | 42 assert isinstance( |
43 self._android_platform, android_platform.AndroidPlatform) | 43 self._android_platform, android_platform.AndroidPlatform) |
44 | 44 |
45 @property | 45 @property |
46 def app(self): | 46 def app(self): |
47 return self._android_app | 47 return self._android_app |
48 | 48 |
49 @property | 49 @property |
50 def platform(self): | 50 def platform(self): |
(...skipping 19 matching lines...) Expand all Loading... |
70 def GetTestExpectationAndSkipValue(self, expectations): | 70 def GetTestExpectationAndSkipValue(self, expectations): |
71 """This does not apply to android app user stories.""" | 71 """This does not apply to android app user stories.""" |
72 return 'pass', None | 72 return 'pass', None |
73 | 73 |
74 def TearDownState(self, results): | 74 def TearDownState(self, results): |
75 """Tear down anything created in the __init__ method that is not needed. | 75 """Tear down anything created in the __init__ method that is not needed. |
76 | 76 |
77 Currently, there is no clean-up needed from SharedAppState.__init__. | 77 Currently, there is no clean-up needed from SharedAppState.__init__. |
78 """ | 78 """ |
79 pass | 79 pass |
OLD | NEW |