Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: build/android/run_tests_helper.py

Issue 8667008: Fix python scripts in src/build/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # 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
4 # found in the LICENSE file. 3 # found in the LICENSE file.
5 4
6 """Helper functions common to native test runners.""" 5 """Helper functions common to native test runners."""
7 6
8 import logging 7 import logging
9 import optparse 8 import optparse
10 import os 9 import os
11 import subprocess 10 import subprocess
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 Returns: 124 Returns:
126 True if the port on device is already used, otherwise returns False. 125 True if the port on device is already used, otherwise returns False.
127 """ 126 """
128 base_url = '127.0.0.1:%d' % device_port 127 base_url = '127.0.0.1:%d' % device_port
129 netstat_results = adb.RunShellCommand('netstat') 128 netstat_results = adb.RunShellCommand('netstat')
130 for single_connect in netstat_results: 129 for single_connect in netstat_results:
131 # Column 3 is the local address which we want to check with. 130 # Column 3 is the local address which we want to check with.
132 if single_connect.split()[3] == base_url: 131 if single_connect.split()[3] == base_url:
133 return True 132 return True
134 return False 133 return False
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698