| 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 content shell (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 json | 10 import json |
| 11 import optparse | 11 import optparse |
| 12 import os | 12 import os |
| 13 import platform | 13 import platform |
| 14 import shutil | 14 import shutil |
| 15 import subprocess | 15 import subprocess |
| 16 import sys | 16 import sys |
| 17 import tempfile | 17 import tempfile |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 def InRunhooks(): | 106 def InRunhooks(): |
| 107 '''True if this script was called by "gclient runhooks" or "gclient sync"''' | 107 '''True if this script was called by "gclient runhooks" or "gclient sync"''' |
| 108 return 'runhooks' in sys.argv | 108 return 'runhooks' in sys.argv |
| 109 | 109 |
| 110 | 110 |
| 111 def EnsureConfig(): | 111 def EnsureConfig(): |
| 112 # If ~/.boto doesn't exist, tell the user to run "gsutil config" | 112 # If ~/.boto doesn't exist, tell the user to run "gsutil config" |
| 113 if not HasBotoConfig(): | 113 if not HasBotoConfig(): |
| 114 print >>sys.stderr, ''' | 114 print >>sys.stderr, ''' |
| 115 ******************************************************************************* | 115 ******************************************************************************* |
| 116 * WARNING: Can't download DumpRenderTree! This is required to test client apps. | 116 * WARNING: Can't download content shell! This is required to test client apps. |
| 117 * You need to do a one-time configuration step to access Google Storage. | 117 * You need to do a one-time configuration step to access Google Storage. |
| 118 * Please run this command and follow the instructions: | 118 * Please run this command and follow the instructions: |
| 119 * %s config | 119 * %s config |
| 120 * | 120 * |
| 121 * NOTE: When prompted you can leave "project-id" blank. Just hit enter. | 121 * NOTE: When prompted you can leave "project-id" blank. Just hit enter. |
| 122 ******************************************************************************* | 122 ******************************************************************************* |
| 123 ''' % GSUTIL | 123 ''' % GSUTIL |
| 124 sys.exit(1) | 124 sys.exit(1) |
| 125 | 125 |
| 126 | 126 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 DARTIUM_LATEST_PATTERN, DARTIUM_PERMANENT_PATTERN, | 340 DARTIUM_LATEST_PATTERN, DARTIUM_PERMANENT_PATTERN, |
| 341 args.revision) | 341 args.revision) |
| 342 elif positional[0] == 'chromedriver': | 342 elif positional[0] == 'chromedriver': |
| 343 GetDartiumRevision('chromedriver', CHROMEDRIVER_DIR, CHROMEDRIVER_VERSION, | 343 GetDartiumRevision('chromedriver', CHROMEDRIVER_DIR, CHROMEDRIVER_VERSION, |
| 344 CHROMEDRIVER_LATEST_PATTERN, | 344 CHROMEDRIVER_LATEST_PATTERN, |
| 345 CHROMEDRIVER_PERMANENT_PATTERN, args.revision) | 345 CHROMEDRIVER_PERMANENT_PATTERN, args.revision) |
| 346 elif positional[0] == 'sdk': | 346 elif positional[0] == 'sdk': |
| 347 GetSdkRevision('sdk', SDK_DIR, SDK_VERSION, SDK_LATEST_PATTERN, | 347 GetSdkRevision('sdk', SDK_DIR, SDK_VERSION, SDK_LATEST_PATTERN, |
| 348 SDK_PERMANENT, args.revision) | 348 SDK_PERMANENT, args.revision) |
| 349 elif positional[0] == 'drt': | 349 elif positional[0] == 'drt': |
| 350 GetDartiumRevision('DumpRenderTree', DRT_DIR, DRT_VERSION, | 350 GetDartiumRevision('content_shell', DRT_DIR, DRT_VERSION, |
| 351 DRT_LATEST_PATTERN, DRT_PERMANENT_PATTERN, | 351 DRT_LATEST_PATTERN, DRT_PERMANENT_PATTERN, |
| 352 args.revision) | 352 args.revision) |
| 353 CopyDrtFont(DRT_DIR) | 353 CopyDrtFont(DRT_DIR) |
| 354 else: | 354 else: |
| 355 print ('Please specify the target you wish to download from Google Storage ' | 355 print ('Please specify the target you wish to download from Google Storage ' |
| 356 '("drt", "dartium", "chromedriver", or "sdk")') | 356 '("drt", "dartium", "chromedriver", or "sdk")') |
| 357 | 357 |
| 358 if __name__ == '__main__': | 358 if __name__ == '__main__': |
| 359 sys.exit(main()) | 359 sys.exit(main()) |
| OLD | NEW |