| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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 import glob | 4 import glob |
| 5 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import re | 7 import re |
| 8 import sys |
| 8 | 9 |
| 9 from gpu_tests import cloud_storage_integration_test_base | 10 from gpu_tests import cloud_storage_integration_test_base |
| 10 from gpu_tests import pixel_expectations | 11 from gpu_tests import pixel_expectations |
| 11 from gpu_tests import pixel_test_pages | 12 from gpu_tests import pixel_test_pages |
| 12 | 13 |
| 13 from py_utils import cloud_storage | 14 from py_utils import cloud_storage |
| 14 from telemetry.util import image_util | 15 from telemetry.util import image_util |
| 15 | 16 |
| 16 | 17 |
| 17 test_data_dir = os.path.abspath(os.path.join( | 18 test_data_dir = os.path.abspath(os.path.join( |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 @classmethod | 108 @classmethod |
| 108 def _CreateExpectations(cls): | 109 def _CreateExpectations(cls): |
| 109 return pixel_expectations.PixelExpectations() | 110 return pixel_expectations.PixelExpectations() |
| 110 | 111 |
| 111 @classmethod | 112 @classmethod |
| 112 def GenerateGpuTests(cls, options): | 113 def GenerateGpuTests(cls, options): |
| 113 cls.SetParsedCommandLineOptions(options) | 114 cls.SetParsedCommandLineOptions(options) |
| 114 name = 'Pixel' | 115 name = 'Pixel' |
| 115 pages = pixel_test_pages.DefaultPages(name) | 116 pages = pixel_test_pages.DefaultPages(name) |
| 116 pages += pixel_test_pages.ExperimentalCanvasFeaturesPages(name) | 117 pages += pixel_test_pages.ExperimentalCanvasFeaturesPages(name) |
| 118 if sys.platform.startswith('darwin'): |
| 119 pages += pixel_test_pages.MacSpecificPages(name) |
| 117 for p in pages: | 120 for p in pages: |
| 118 yield(p.name, p.url, (p)) | 121 yield(p.name, p.url, (p)) |
| 119 | 122 |
| 120 def RunActualGpuTest(self, test_path, *args): | 123 def RunActualGpuTest(self, test_path, *args): |
| 121 page = args[0] | 124 page = args[0] |
| 122 # Some pixel tests require non-standard browser arguments. Need to | 125 # Some pixel tests require non-standard browser arguments. Need to |
| 123 # check before running each page that it can run in the current | 126 # check before running each page that it can run in the current |
| 124 # browser instance. | 127 # browser instance. |
| 125 self.RestartBrowserIfNecessaryWithArgs(page.browser_args) | 128 self.RestartBrowserIfNecessaryWithArgs(page.browser_args) |
| 126 url = self.UrlOfStaticFilePath(test_path) | 129 url = self.UrlOfStaticFilePath(test_path) |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 ref_png = None | 219 ref_png = None |
| 217 | 220 |
| 218 if ref_png is not None: | 221 if ref_png is not None: |
| 219 return ref_png | 222 return ref_png |
| 220 | 223 |
| 221 print ('Reference image not found. Writing tab contents as reference to: ' + | 224 print ('Reference image not found. Writing tab contents as reference to: ' + |
| 222 image_path) | 225 image_path) |
| 223 | 226 |
| 224 self._WriteImage(image_path, screenshot) | 227 self._WriteImage(image_path, screenshot) |
| 225 return screenshot | 228 return screenshot |
| OLD | NEW |