| 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 | 4 from datetime import datetime |
| 5 import glob | 5 import glob |
| 6 import optparse | 6 import optparse |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 | 9 |
| 10 import cloud_storage_test_base | 10 import cloud_storage_test_base |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 print 'Reference image not found. Writing tab contents as reference.' | 144 print 'Reference image not found. Writing tab contents as reference.' |
| 145 | 145 |
| 146 self._WriteImage(image_path, screenshot) | 146 self._WriteImage(image_path, screenshot) |
| 147 return screenshot | 147 return screenshot |
| 148 | 148 |
| 149 class Pixel(cloud_storage_test_base.TestBase): | 149 class Pixel(cloud_storage_test_base.TestBase): |
| 150 test = _PixelValidator | 150 test = _PixelValidator |
| 151 page_set = page_sets.PixelTestsPageSet | 151 page_set = page_sets.PixelTestsPageSet |
| 152 | 152 |
| 153 @classmethod | 153 @classmethod |
| 154 def Name(cls): |
| 155 return "pixel" |
| 156 |
| 157 @classmethod |
| 154 def AddTestCommandLineArgs(cls, group): | 158 def AddTestCommandLineArgs(cls, group): |
| 155 super(Pixel, cls).AddTestCommandLineArgs(group) | 159 super(Pixel, cls).AddTestCommandLineArgs(group) |
| 156 group.add_option('--reference-dir', | 160 group.add_option('--reference-dir', |
| 157 help='Overrides the default on-disk location for reference images ' | 161 help='Overrides the default on-disk location for reference images ' |
| 158 '(only used for local testing without a cloud storage account)', | 162 '(only used for local testing without a cloud storage account)', |
| 159 default=default_reference_image_dir) | 163 default=default_reference_image_dir) |
| 160 | 164 |
| 161 def CreatePageSet(self, options): | 165 def CreatePageSet(self, options): |
| 162 page_set = super(Pixel, self).CreatePageSet(options) | 166 page_set = super(Pixel, self).CreatePageSet(options) |
| 163 for page in page_set.pages: | 167 for page in page_set.pages: |
| 164 page.script_to_evaluate_on_commit = test_harness_script | 168 page.script_to_evaluate_on_commit = test_harness_script |
| 165 return page_set | 169 return page_set |
| 166 | 170 |
| 167 def CreateExpectations(self, page_set): | 171 def CreateExpectations(self, page_set): |
| 168 return pixel_expectations.PixelExpectations() | 172 return pixel_expectations.PixelExpectations() |
| OLD | NEW |