OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 # pylint: disable=R0201 | 5 # pylint: disable=R0201 |
6 | 6 |
7 import glob | 7 import glob |
8 import logging | 8 import logging |
9 import os.path | 9 import os.path |
10 import subprocess | 10 import subprocess |
11 import sys | 11 import sys |
12 | 12 |
13 from devil.android import device_errors | 13 from devil.android import device_errors |
14 from devil.android.valgrind_tools import base_tool | 14 from devil.android.valgrind_tools import base_tool |
15 from pylib.constants import DIR_SOURCE_ROOT | 15 from pylib.constants import DIR_SOURCE_ROOT |
16 | 16 |
17 | 17 |
18 def SetChromeTimeoutScale(device, scale): | 18 def SetChromeTimeoutScale(device, scale): |
19 """Sets the timeout scale in /data/local/tmp/chrome_timeout_scale to scale.""" | 19 """Sets the timeout scale in /data/local/tmp/chrome_timeout_scale to scale.""" |
20 path = '/data/local/tmp/chrome_timeout_scale' | 20 path = '/data/local/tmp/chrome_timeout_scale' |
21 if not scale or scale == 1.0: | 21 if not scale or scale == 1.0: |
22 # Delete if scale is None/0.0/1.0 since the default timeout scale is 1.0 | 22 # Delete if scale is None/0.0/1.0 since the default timeout scale is 1.0 |
23 device.RunShellCommand('rm %s' % path) | 23 device.RemovePath(path, force=True, as_root=True) |
24 else: | 24 else: |
25 device.WriteFile(path, '%f' % scale, as_root=True) | 25 device.WriteFile(path, '%f' % scale, as_root=True) |
26 | 26 |
27 | 27 |
28 | 28 |
29 class AddressSanitizerTool(base_tool.BaseTool): | 29 class AddressSanitizerTool(base_tool.BaseTool): |
30 """AddressSanitizer tool.""" | 30 """AddressSanitizer tool.""" |
31 | 31 |
32 WRAPPER_NAME = '/system/bin/asanwrapper' | 32 WRAPPER_NAME = '/system/bin/asanwrapper' |
33 # Disable memcmp overlap check.There are blobs (gl drivers) | 33 # Disable memcmp overlap check.There are blobs (gl drivers) |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 return | 226 return |
227 | 227 |
228 clazz = TOOL_REGISTRY.get(tool_name) | 228 clazz = TOOL_REGISTRY.get(tool_name) |
229 if clazz: | 229 if clazz: |
230 clazz.CopyFiles(device) | 230 clazz.CopyFiles(device) |
231 else: | 231 else: |
232 print 'Unknown tool %s, available tools: %s' % ( | 232 print 'Unknown tool %s, available tools: %s' % ( |
233 tool_name, ', '.join(sorted(TOOL_REGISTRY.keys()))) | 233 tool_name, ', '.join(sorted(TOOL_REGISTRY.keys()))) |
234 sys.exit(1) | 234 sys.exit(1) |
235 | 235 |
OLD | NEW |