| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Base classes for a test and validator which upload results | 5 """Base classes for a test and validator which upload results |
| 6 (reference images, error images) to cloud storage.""" | 6 (reference images, error images) to cloud storage.""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 import tempfile | 10 import tempfile |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 if self.options.test_machine_name: | 211 if self.options.test_machine_name: |
| 212 self._UploadErrorImagesToCloudStorage(image_name, screenshot, None) | 212 self._UploadErrorImagesToCloudStorage(image_name, screenshot, None) |
| 213 else: | 213 else: |
| 214 self._WriteErrorImages(self.options.generated_dir, image_name, | 214 self._WriteErrorImages(self.options.generated_dir, image_name, |
| 215 screenshot, None) | 215 screenshot, None) |
| 216 raise | 216 raise |
| 217 | 217 |
| 218 | 218 |
| 219 class TestBase(benchmark.Benchmark): | 219 class TestBase(benchmark.Benchmark): |
| 220 @classmethod | 220 @classmethod |
| 221 def AddBenchmarkCommandLineArgs(cls, group): | 221 def AddTestCommandLineArgs(cls, group): |
| 222 group.add_option('--build-revision', | 222 group.add_option('--build-revision', |
| 223 help='Chrome revision being tested.', | 223 help='Chrome revision being tested.', |
| 224 default="unknownrev") | 224 default="unknownrev") |
| 225 group.add_option('--upload-refimg-to-cloud-storage', | 225 group.add_option('--upload-refimg-to-cloud-storage', |
| 226 dest='upload_refimg_to_cloud_storage', | 226 dest='upload_refimg_to_cloud_storage', |
| 227 action='store_true', default=False, | 227 action='store_true', default=False, |
| 228 help='Upload resulting images to cloud storage as reference images') | 228 help='Upload resulting images to cloud storage as reference images') |
| 229 group.add_option('--download-refimg-from-cloud-storage', | 229 group.add_option('--download-refimg-from-cloud-storage', |
| 230 dest='download_refimg_from_cloud_storage', | 230 dest='download_refimg_from_cloud_storage', |
| 231 action='store_true', default=False, | 231 action='store_true', default=False, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 244 default='') | 244 default='') |
| 245 group.add_option('--test-machine-name', | 245 group.add_option('--test-machine-name', |
| 246 help='Name of the test machine. Specifying this argument causes this ' | 246 help='Name of the test machine. Specifying this argument causes this ' |
| 247 'script to upload failure images and diffs to cloud storage directly, ' | 247 'script to upload failure images and diffs to cloud storage directly, ' |
| 248 'instead of relying on the archive_gpu_pixel_test_results.py script.', | 248 'instead of relying on the archive_gpu_pixel_test_results.py script.', |
| 249 default='') | 249 default='') |
| 250 group.add_option('--generated-dir', | 250 group.add_option('--generated-dir', |
| 251 help='Overrides the default on-disk location for generated test images ' | 251 help='Overrides the default on-disk location for generated test images ' |
| 252 '(only used for local testing without a cloud storage account)', | 252 '(only used for local testing without a cloud storage account)', |
| 253 default=default_generated_data_dir) | 253 default=default_generated_data_dir) |
| OLD | NEW |