OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 # Gets or updates a DumpRenderTree (a nearly headless build of chrome). This is | 7 # Gets or updates a DumpRenderTree (a nearly headless build of chrome). This is |
8 # used for running browser tests of client applications. | 8 # used for running browser tests of client applications. |
9 | 9 |
10 import optparse | 10 import optparse |
(...skipping 20 matching lines...) Expand all Loading... |
31 DRT_LATEST_PATTERN = ( | 31 DRT_LATEST_PATTERN = ( |
32 'gs://dartium-archive/latest/drt-%(osname)s-inc-*.zip') | 32 'gs://dartium-archive/latest/drt-%(osname)s-inc-*.zip') |
33 DRT_PERMANENT_PREFIX = 'gs://dartium-archive/drt-%(osname)s-inc' | 33 DRT_PERMANENT_PREFIX = 'gs://dartium-archive/drt-%(osname)s-inc' |
34 | 34 |
35 DARTIUM_DIR = os.path.join('client', 'tests', 'dartium') | 35 DARTIUM_DIR = os.path.join('client', 'tests', 'dartium') |
36 DARTIUM_VERSION = os.path.join(DARTIUM_DIR, 'LAST_VERSION') | 36 DARTIUM_VERSION = os.path.join(DARTIUM_DIR, 'LAST_VERSION') |
37 DARTIUM_LATEST_PATTERN = ( | 37 DARTIUM_LATEST_PATTERN = ( |
38 'gs://dartium-archive/latest/dartium-%(osname)s-inc-*.zip') | 38 'gs://dartium-archive/latest/dartium-%(osname)s-inc-*.zip') |
39 DARTIUM_PERMANENT_PREFIX = 'gs://dartium-archive/dartium-%(osname)s-inc' | 39 DARTIUM_PERMANENT_PREFIX = 'gs://dartium-archive/dartium-%(osname)s-inc' |
40 | 40 |
| 41 CHROMEDRIVER_DIR = os.path.join('tools', 'testing', 'dartium-chromedriver') |
| 42 CHROMEDRIVER_VERSION = os.path.join(CHROMEDRIVER_DIR, 'LAST_VERSION') |
| 43 CHROMEDRIVER_LATEST_PATTERN = ( |
| 44 'gs://dartium-archive/latest/chromedriver-%(osname)s-inc-*.zip') |
| 45 CHROMEDRIVER_PERMANENT_PREFIX = ( |
| 46 'gs://dartium-archive/chromedriver-%(osname)s-inc') |
| 47 |
41 sys.path.append(os.path.join(GSUTIL_DIR, 'boto')) | 48 sys.path.append(os.path.join(GSUTIL_DIR, 'boto')) |
42 import boto | 49 import boto |
43 | 50 |
44 | 51 |
45 def execute_command(*cmd): | 52 def execute_command(*cmd): |
46 """Execute a command in a subprocess.""" | 53 """Execute a command in a subprocess.""" |
47 pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | 54 pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
48 output, error = pipe.communicate() | 55 output, error = pipe.communicate() |
49 return pipe.returncode, output | 56 return pipe.returncode, output |
50 | 57 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 190 |
184 print 'Successfully downloaded to %s' % directory | 191 print 'Successfully downloaded to %s' % directory |
185 return 0 | 192 return 0 |
186 | 193 |
187 | 194 |
188 def main(): | 195 def main(): |
189 parser = optparse.OptionParser() | 196 parser = optparse.OptionParser() |
190 parser.add_option('--dartium', dest='dartium', | 197 parser.add_option('--dartium', dest='dartium', |
191 help='Get latest Dartium', action='store_true', | 198 help='Get latest Dartium', action='store_true', |
192 default=False) | 199 default=False) |
| 200 parser.add_option('--chromedriver', dest='chromedriver', |
| 201 help='Get the latest built ChromeDriver', |
| 202 action='store_true', default=False) |
193 args, _ = parser.parse_args() | 203 args, _ = parser.parse_args() |
194 | 204 |
195 if args.dartium: | 205 if args.dartium: |
196 get_latest('Dartium', DARTIUM_DIR, DARTIUM_VERSION, | 206 get_latest('Dartium', DARTIUM_DIR, DARTIUM_VERSION, |
197 DARTIUM_LATEST_PATTERN, DARTIUM_PERMANENT_PREFIX) | 207 DARTIUM_LATEST_PATTERN, DARTIUM_PERMANENT_PREFIX) |
| 208 elif args.chromedriver: |
| 209 get_latest('chromedriver', CHROMEDRIVER_DIR, CHROMEDRIVER_VERSION, |
| 210 CHROMEDRIVER_LATEST_PATTERN, CHROMEDRIVER_PERMANENT_PREFIX) |
198 else: | 211 else: |
199 get_latest('DumpRenderTree', DRT_DIR, DRT_VERSION, | 212 get_latest('DumpRenderTree', DRT_DIR, DRT_VERSION, |
200 DRT_LATEST_PATTERN, DRT_PERMANENT_PREFIX) | 213 DRT_LATEST_PATTERN, DRT_PERMANENT_PREFIX) |
201 | 214 |
202 if __name__ == '__main__': | 215 if __name__ == '__main__': |
203 sys.exit(main()) | 216 sys.exit(main()) |
OLD | NEW |