OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 from datetime import datetime | |
5 import glob | 4 import glob |
6 import json | 5 import json |
7 import optparse | |
8 import os | 6 import os |
9 import re | 7 import re |
10 | 8 |
11 import cloud_storage_test_base | 9 from gpu_tests import cloud_storage_test_base |
| 10 from gpu_tests import pixel_expectations |
12 import page_sets | 11 import page_sets |
13 import pixel_expectations | |
14 | 12 |
15 from catapult_base import cloud_storage | 13 from catapult_base import cloud_storage |
16 from telemetry.page import page_test | 14 from telemetry.page import page_test |
17 from telemetry.util import image_util | 15 from telemetry.util import image_util |
18 | 16 |
19 | 17 |
20 test_data_dir = os.path.abspath(os.path.join( | 18 test_data_dir = os.path.abspath(os.path.join( |
21 os.path.dirname(__file__), '..', '..', 'data', 'gpu')) | 19 os.path.dirname(__file__), '..', '..', 'data', 'gpu')) |
22 | 20 |
23 default_reference_image_dir = os.path.join(test_data_dir, 'gpu_reference') | 21 default_reference_image_dir = os.path.join(test_data_dir, 'gpu_reference') |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 ref_png = screenshot | 91 ref_png = screenshot |
94 else: | 92 else: |
95 # There was a preexisting reference image, so we might as well | 93 # There was a preexisting reference image, so we might as well |
96 # compare against it. | 94 # compare against it. |
97 ref_png = self._DownloadFromCloudStorage(image_name, page, tab) | 95 ref_png = self._DownloadFromCloudStorage(image_name, page, tab) |
98 elif self.options.download_refimg_from_cloud_storage: | 96 elif self.options.download_refimg_from_cloud_storage: |
99 # This bot doesn't have the ability to properly generate a | 97 # This bot doesn't have the ability to properly generate a |
100 # reference image, so download it from cloud storage. | 98 # reference image, so download it from cloud storage. |
101 try: | 99 try: |
102 ref_png = self._DownloadFromCloudStorage(image_name, page, tab) | 100 ref_png = self._DownloadFromCloudStorage(image_name, page, tab) |
103 except cloud_storage.NotFoundError as e: | 101 except cloud_storage.NotFoundError: |
104 # There is no reference image yet in cloud storage. This | 102 # There is no reference image yet in cloud storage. This |
105 # happens when the revision of the test is incremented or when | 103 # happens when the revision of the test is incremented or when |
106 # a new test is added, because the trybots are not allowed to | 104 # a new test is added, because the trybots are not allowed to |
107 # produce reference images, only the bots on the main | 105 # produce reference images, only the bots on the main |
108 # waterfalls. Report this as a failure so the developer has to | 106 # waterfalls. Report this as a failure so the developer has to |
109 # take action by explicitly suppressing the failure and | 107 # take action by explicitly suppressing the failure and |
110 # removing the suppression once the reference images have been | 108 # removing the suppression once the reference images have been |
111 # generated. Otherwise silent failures could happen for long | 109 # generated. Otherwise silent failures could happen for long |
112 # periods of time. | 110 # periods of time. |
113 raise page_test.Failure('Could not find image %s in cloud storage' % | 111 raise page_test.Failure('Could not find image %s in cloud storage' % |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 182 |
185 def CreateStorySet(self, options): | 183 def CreateStorySet(self, options): |
186 story_set = page_sets.PixelTestsStorySet(self.GetExpectations(), | 184 story_set = page_sets.PixelTestsStorySet(self.GetExpectations(), |
187 try_es3=True) | 185 try_es3=True) |
188 for page in story_set: | 186 for page in story_set: |
189 page.script_to_evaluate_on_commit = test_harness_script | 187 page.script_to_evaluate_on_commit = test_harness_script |
190 return story_set | 188 return story_set |
191 | 189 |
192 def _CreateExpectations(self): | 190 def _CreateExpectations(self): |
193 return pixel_expectations.PixelExpectations() | 191 return pixel_expectations.PixelExpectations() |
OLD | NEW |