| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import default_flavor | 5 import default_flavor |
| 6 import subprocess | 6 import subprocess |
| 7 | 7 |
| 8 # Data should go under in _data_dir, which may be preserved across runs. | 8 # Data should go under in _data_dir, which may be preserved across runs. |
| 9 _data_dir = '/sdcard/revenge_of_the_skiabot/' | 9 _data_dir = '/sdcard/revenge_of_the_skiabot/' |
| 10 # Executables go under _bin_dir, which, well, allows executable files. | 10 # Executables go under _bin_dir, which, well, allows executable files. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 if len(tokens) == 11 and tokens[-7] == 'F' and tokens[-3] == 'pc': | 91 if len(tokens) == 11 and tokens[-7] == 'F' and tokens[-3] == 'pc': |
| 92 addr, path = tokens[-2:] | 92 addr, path = tokens[-2:] |
| 93 local = os.path.join(out, os.path.basename(path)) | 93 local = os.path.join(out, os.path.basename(path)) |
| 94 if os.path.exists(local): | 94 if os.path.exists(local): |
| 95 sym = subprocess.check_output(['addr2line', '-Cfpe', local, addr]) | 95 sym = subprocess.check_output(['addr2line', '-Cfpe', local, addr]) |
| 96 line = line.replace(addr, addr + ' ' + sym.strip()) | 96 line = line.replace(addr, addr + ' ' + sym.strip()) |
| 97 print line | 97 print line |
| 98 """, | 98 """, |
| 99 args=[self.m.vars.skia_out.join(self.m.vars.configuration)], | 99 args=[self.m.vars.skia_out.join(self.m.vars.configuration)], |
| 100 infra_step=True) | 100 infra_step=True) |
| 101 self._adb('reboot', 'reboot') | |
| 102 self._adb('kill adb server', 'kill-server') | 101 self._adb('kill adb server', 'kill-server') |
| 103 | 102 |
| 104 def step(self, name, cmd, env=None, **kwargs): | 103 def step(self, name, cmd, env=None, **kwargs): |
| 105 app = self.m.vars.skia_out.join(self.m.vars.configuration, cmd[0]) | 104 app = self.m.vars.skia_out.join(self.m.vars.configuration, cmd[0]) |
| 106 self._adb('push %s' % cmd[0], | 105 self._adb('push %s' % cmd[0], |
| 107 'push', app, _bin_dir) | 106 'push', app, _bin_dir) |
| 108 | 107 |
| 109 sh = '%s.sh' % cmd[0] | 108 sh = '%s.sh' % cmd[0] |
| 110 self.m.run.writefile(self.m.vars.tmp_dir.join(sh), | 109 self.m.run.writefile(self.m.vars.tmp_dir.join(sh), |
| 111 'set -x; %s%s; echo $? >%src' % | 110 'set -x; %s%s; echo $? >%src' % |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 def read_file_on_device(self, path): | 155 def read_file_on_device(self, path): |
| 157 return self._adb('read %s' % path, | 156 return self._adb('read %s' % path, |
| 158 'shell', 'cat', path, stdout=self.m.raw_io.output()).stdout | 157 'shell', 'cat', path, stdout=self.m.raw_io.output()).stdout |
| 159 | 158 |
| 160 def remove_file_on_device(self, path): | 159 def remove_file_on_device(self, path): |
| 161 self._adb('rm %s' % path, 'shell', 'rm', '-f', path) | 160 self._adb('rm %s' % path, 'shell', 'rm', '-f', path) |
| 162 | 161 |
| 163 def create_clean_device_dir(self, path): | 162 def create_clean_device_dir(self, path): |
| 164 self._adb('rm %s' % path, 'shell', 'rm', '-rf', path) | 163 self._adb('rm %s' % path, 'shell', 'rm', '-rf', path) |
| 165 self._adb('mkdir %s' % path, 'shell', 'mkdir', '-p', path) | 164 self._adb('mkdir %s' % path, 'shell', 'mkdir', '-p', path) |
| OLD | NEW |