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 | 4 |
5 """Run specific test on specific environment.""" | 5 """Run specific test on specific environment.""" |
6 | 6 |
7 import json | 7 import json |
8 import logging | 8 import logging |
9 import os | 9 import os |
10 import re | 10 import re |
11 import shutil | 11 import shutil |
12 import string | 12 import string |
13 import tempfile | 13 import tempfile |
14 import time | 14 import time |
15 import zipfile | 15 import zipfile |
16 | 16 |
17 | 17 from devil.utils import zip_utils |
18 from pylib.base import base_test_result | 18 from pylib.base import base_test_result |
19 from pylib.base import test_run | 19 from pylib.base import test_run |
20 from pylib.remote.device import appurify_constants | 20 from pylib.remote.device import appurify_constants |
21 from pylib.remote.device import appurify_sanitized | 21 from pylib.remote.device import appurify_sanitized |
22 from pylib.remote.device import remote_device_helper | 22 from pylib.remote.device import remote_device_helper |
23 from pylib.utils import zip_utils | |
24 | 23 |
25 _DEVICE_OFFLINE_RE = re.compile('error: device not found') | 24 _DEVICE_OFFLINE_RE = re.compile('error: device not found') |
26 _LONG_MSG_RE = re.compile('longMsg=') | 25 _LONG_MSG_RE = re.compile('longMsg=') |
27 _SHORT_MSG_RE = re.compile('shortMsg=') | 26 _SHORT_MSG_RE = re.compile('shortMsg=') |
28 | 27 |
29 | 28 |
30 class RemoteDeviceTestRun(test_run.TestRun): | 29 class RemoteDeviceTestRun(test_run.TestRun): |
31 """Run tests on a remote device.""" | 30 """Run tests on a remote device.""" |
32 | 31 |
33 _TEST_RUN_KEY = 'test_run' | 32 _TEST_RUN_KEY = 'test_run' |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 base_test_result.ResultType.UNKNOWN)) | 379 base_test_result.ResultType.UNKNOWN)) |
381 elif self._DidDeviceGoOffline(): | 380 elif self._DidDeviceGoOffline(): |
382 self._LogLogcat() | 381 self._LogLogcat() |
383 self._LogAdbTraceLog() | 382 self._LogAdbTraceLog() |
384 raise remote_device_helper.RemoteDeviceError( | 383 raise remote_device_helper.RemoteDeviceError( |
385 'Remote service unable to reach device.', is_infra_error=True) | 384 'Remote service unable to reach device.', is_infra_error=True) |
386 else: | 385 else: |
387 results.AddResult(base_test_result.BaseTestResult( | 386 results.AddResult(base_test_result.BaseTestResult( |
388 'Remote Service detected error.', | 387 'Remote Service detected error.', |
389 base_test_result.ResultType.UNKNOWN)) | 388 base_test_result.ResultType.UNKNOWN)) |
OLD | NEW |