| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS 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 os, shutil, time | 5 import os, shutil, time |
| 6 from autotest_lib.client.bin import test, utils | 6 from autotest_lib.client.bin import test, utils |
| 7 | 7 |
| 8 def get_pids(program_name): | 8 def get_pids(program_name): |
| 9 """ | 9 """ |
| 10 Collect a list of pids for all the instances of a program. | 10 Collect a list of pids for all the instances of a program. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 Setup playground files. | 59 Setup playground files. |
| 60 | 60 |
| 61 @param src path | 61 @param src path |
| 62 @param dst path | 62 @param dst path |
| 63 @param optionfile | 63 @param optionfile |
| 64 """ | 64 """ |
| 65 shutil.rmtree(dst, ignore_errors=True) | 65 shutil.rmtree(dst, ignore_errors=True) |
| 66 shutil.copytree(src, dst) | 66 shutil.copytree(src, dst) |
| 67 utils.run('chown chronos %s -R' % dst) | 67 utils.run('chown chronos %s -R' % dst) |
| 68 | 68 |
| 69 dst_path= '/home/chronos/.Google/' | 69 dst_path= '/home/chronos/.config/' |
| 70 opt_path= os.path.join(dst_path, 'Google Talk Plugin') | 70 opt_path= os.path.join(dst_path, 'google-googletalkplugin') |
| 71 dst_opt = os.path.join(opt_path, 'options') | 71 dst_opt = os.path.join(opt_path, 'options') |
| 72 utils.run('mkdir -p \'%s\'' % opt_path) | 72 utils.run('mkdir -p \'%s\'' % opt_path) |
| 73 utils.run('cp -f %s \'%s\'' % (optionfile, dst_opt)) | 73 utils.run('cp -f %s \'%s\'' % (optionfile, dst_opt)) |
| 74 utils.run('chown chronos \'%s\' -R' % dst_path) | 74 utils.run('chown chronos \'%s\' -R' % dst_path) |
| 75 utils.run('chmod o+r+w \'%s\'' % dst_opt) | 75 utils.run('chmod o+r+w \'%s\'' % dst_opt) |
| 76 | 76 |
| 77 | 77 |
| 78 def cleanup_playground(playground, testdone=False): | 78 def cleanup_playground(playground, testdone=False): |
| 79 """ | 79 """ |
| 80 Cleanup playground files. | 80 Cleanup playground files. |
| 81 | 81 |
| 82 @param playground path | 82 @param playground path |
| 83 @param testdone | 83 @param testdone |
| 84 """ | 84 """ |
| 85 utils.run('pkill chrome', ignore_status=True) | 85 utils.run('pkill chrome', ignore_status=True) |
| 86 time.sleep(10) | 86 time.sleep(10) |
| 87 utils.run('pkill GoogleTalkPlugin', ignore_status=True) | 87 utils.run('pkill GoogleTalkPlugin', ignore_status=True) |
| 88 time.sleep(10) | 88 time.sleep(10) |
| 89 utils.run('rm -f /tmp/tmp.log', ignore_status=True) | 89 utils.run('rm -f /tmp/tmp.log', ignore_status=True) |
| 90 if testdone: | 90 if testdone: |
| 91 shutil.rmtree(playground) | 91 shutil.rmtree(playground) |
| 92 | 92 |
| 93 # Delete previous browser state if any | 93 # Delete previous browser state if any |
| 94 shutil.rmtree('/home/chronos/.config/chromium', ignore_errors=True) | 94 shutil.rmtree('/home/chronos/.config/chromium', ignore_errors=True) |
| 95 shutil.rmtree('/home/chronos/.config/google-chrome', ignore_errors=True) | 95 shutil.rmtree('/home/chronos/.config/google-chrome', ignore_errors=True) |
| 96 | 96 |
| 97 # Delete previous GTalk state if any |
| 98 shutil.rmtree('/home/chronos/.config/google-googletalkplugin', |
| 99 ignore_errors=True) |
| 100 |
| OLD | NEW |