OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 | 4 |
5 """Base class for linker-specific test cases. | 5 """Base class for linker-specific test cases. |
6 | 6 |
7 The custom dynamic linker can only be tested through a custom test case | 7 The custom dynamic linker can only be tested through a custom test case |
8 for various technical reasons: | 8 for various technical reasons: |
9 | 9 |
10 - It's an 'invisible feature', i.e. it doesn't expose a new API or | 10 - It's an 'invisible feature', i.e. it doesn't expose a new API or |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 linker test status lines appear in the logcat, recorded through |device|. | 116 linker test status lines appear in the logcat, recorded through |device|. |
117 Args: | 117 Args: |
118 device: A DeviceUtils instance. | 118 device: A DeviceUtils instance. |
119 timeout: Timeout in seconds | 119 timeout: Timeout in seconds |
120 Returns: | 120 Returns: |
121 A (status, logs) tuple, where status is a ResultType constant, and logs | 121 A (status, logs) tuple, where status is a ResultType constant, and logs |
122 if the final logcat output as a string. | 122 if the final logcat output as a string. |
123 """ | 123 """ |
124 | 124 |
125 # 1. Start recording logcat with appropriate filters. | 125 # 1. Start recording logcat with appropriate filters. |
126 with device.GetLogcatMonitor(filters=_LOGCAT_FILTERS) as logmon: | 126 with device.GetLogcatMonitor(filter_specs=_LOGCAT_FILTERS) as logmon: |
127 | 127 |
128 # 2. Force-start activity. | 128 # 2. Force-start activity. |
129 device.StartActivity( | 129 device.StartActivity( |
130 intent.Intent(package=_PACKAGE_NAME, activity=_ACTIVITY_NAME), | 130 intent.Intent(package=_PACKAGE_NAME, activity=_ACTIVITY_NAME), |
131 force_stop=True) | 131 force_stop=True) |
132 | 132 |
133 # 3. Wait up to |timeout| seconds until the test status is in the logcat. | 133 # 3. Wait up to |timeout| seconds until the test status is in the logcat. |
134 result = ResultType.PASS | 134 result = ResultType.PASS |
135 try: | 135 try: |
136 browser_match = logmon.WaitFor(_RE_BROWSER_STATUS_LINE, timeout=timeout) | 136 browser_match = logmon.WaitFor(_RE_BROWSER_STATUS_LINE, timeout=timeout) |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 # Note that this behaviour doesn't seem to happen when starting an | 487 # Note that this behaviour doesn't seem to happen when starting an |
488 # application 'normally', i.e. when using the application launcher to | 488 # application 'normally', i.e. when using the application launcher to |
489 # start the activity. | 489 # start the activity. |
490 logging.info('Ignoring system\'s low randomization of browser libraries' + | 490 logging.info('Ignoring system\'s low randomization of browser libraries' + |
491 ' for regular devices') | 491 ' for regular devices') |
492 | 492 |
493 if not renderer_status: | 493 if not renderer_status: |
494 return ResultType.FAIL, renderer_logs | 494 return ResultType.FAIL, renderer_logs |
495 | 495 |
496 return ResultType.PASS, logs | 496 return ResultType.PASS, logs |
OLD | NEW |