| 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 os | 5 import os |
| 6 import re | 6 import re |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 from gpu_tests import gpu_integration_test | 9 from gpu_tests import gpu_integration_test |
| 10 from gpu_tests import cloud_storage_integration_test_base | 10 from gpu_tests import cloud_storage_integration_test_base |
| 11 from gpu_tests import path_util | 11 from gpu_tests import path_util |
| 12 from gpu_tests import pixel_expectations | 12 from gpu_tests import pixel_expectations |
| 13 from gpu_tests import pixel_test_pages | 13 from gpu_tests import pixel_test_pages |
| 14 from gpu_tests import color_profile_manager |
| 14 | 15 |
| 15 from py_utils import cloud_storage | 16 from py_utils import cloud_storage |
| 16 from telemetry.util import image_util | 17 from telemetry.util import image_util |
| 17 | 18 |
| 18 gpu_relative_path = "content/test/data/gpu/" | 19 gpu_relative_path = "content/test/data/gpu/" |
| 19 gpu_data_dir = os.path.join(path_util.GetChromiumSrcDir(), gpu_relative_path) | 20 gpu_data_dir = os.path.join(path_util.GetChromiumSrcDir(), gpu_relative_path) |
| 20 | 21 |
| 21 default_reference_image_dir = os.path.join(gpu_data_dir, 'gpu_reference') | 22 default_reference_image_dir = os.path.join(gpu_data_dir, 'gpu_reference') |
| 22 | 23 |
| 23 test_data_dirs = [gpu_data_dir, | 24 test_data_dirs = [gpu_data_dir, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 48 | 49 |
| 49 class PixelIntegrationTest( | 50 class PixelIntegrationTest( |
| 50 cloud_storage_integration_test_base.CloudStorageIntegrationTestBase): | 51 cloud_storage_integration_test_base.CloudStorageIntegrationTestBase): |
| 51 @classmethod | 52 @classmethod |
| 52 def Name(cls): | 53 def Name(cls): |
| 53 """The name by which this test is invoked on the command line.""" | 54 """The name by which this test is invoked on the command line.""" |
| 54 return 'pixel' | 55 return 'pixel' |
| 55 | 56 |
| 56 @classmethod | 57 @classmethod |
| 57 def SetUpProcess(cls): | 58 def SetUpProcess(cls): |
| 59 color_profile_manager.ForceUntilExitSRGB() |
| 58 super(PixelIntegrationTest, cls).SetUpProcess() | 60 super(PixelIntegrationTest, cls).SetUpProcess() |
| 59 cls.CustomizeBrowserArgs(cls._AddDefaultArgs([])) | 61 cls.CustomizeBrowserArgs(cls._AddDefaultArgs([])) |
| 60 cls.StartBrowser() | 62 cls.StartBrowser() |
| 61 cls.SetStaticServerDirs(test_data_dirs) | 63 cls.SetStaticServerDirs(test_data_dirs) |
| 62 | 64 |
| 63 @staticmethod | 65 @staticmethod |
| 64 def _AddDefaultArgs(browser_args): | 66 def _AddDefaultArgs(browser_args): |
| 65 if not browser_args: | 67 if not browser_args: |
| 66 browser_args = [] | 68 browser_args = [] |
| 67 # All tests receive the following options. | 69 # All tests receive the following options. |
| 68 return [ | 70 return [ |
| 71 '--force-color-profile=srgb', |
| 69 '--enable-gpu-benchmarking', | 72 '--enable-gpu-benchmarking', |
| 70 '--test-type=gpu'] + browser_args | 73 '--test-type=gpu'] + browser_args |
| 71 | 74 |
| 72 @classmethod | 75 @classmethod |
| 73 def StopBrowser(cls): | 76 def StopBrowser(cls): |
| 74 super(PixelIntegrationTest, cls).StopBrowser() | 77 super(PixelIntegrationTest, cls).StopBrowser() |
| 75 cls.ResetGpuInfo() | 78 cls.ResetGpuInfo() |
| 76 | 79 |
| 77 @classmethod | 80 @classmethod |
| 78 def AddCommandlineArgs(cls, parser): | 81 def AddCommandlineArgs(cls, parser): |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 209 |
| 207 print ('Reference image not found. Writing tab contents as reference to: ' + | 210 print ('Reference image not found. Writing tab contents as reference to: ' + |
| 208 image_path) | 211 image_path) |
| 209 | 212 |
| 210 self._WriteImage(image_path, screenshot) | 213 self._WriteImage(image_path, screenshot) |
| 211 return screenshot | 214 return screenshot |
| 212 | 215 |
| 213 def load_tests(loader, tests, pattern): | 216 def load_tests(loader, tests, pattern): |
| 214 del loader, tests, pattern # Unused. | 217 del loader, tests, pattern # Unused. |
| 215 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) | 218 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) |
| OLD | NEW |