| OLD | NEW |
| 1 # Copyright 2017 The Chromium Authors. All rights reserved. | 1 # Copyright 2017 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 import json | 5 import json |
| 6 import os | 6 import os |
| 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 maps_expectations | 11 from gpu_tests import maps_expectations |
| 12 from gpu_tests import path_util | 12 from gpu_tests import path_util |
| 13 from gpu_tests import color_profile_manager |
| 13 | 14 |
| 14 from py_utils import cloud_storage | 15 from py_utils import cloud_storage |
| 15 | 16 |
| 16 data_path = os.path.join(path_util.GetChromiumSrcDir(), | 17 data_path = os.path.join(path_util.GetChromiumSrcDir(), |
| 17 'content', 'test', 'gpu', 'page_sets', 'data') | 18 'content', 'test', 'gpu', 'page_sets', 'data') |
| 18 | 19 |
| 19 class MapsIntegrationTest( | 20 class MapsIntegrationTest( |
| 20 cloud_storage_integration_test_base.CloudStorageIntegrationTestBase): | 21 cloud_storage_integration_test_base.CloudStorageIntegrationTestBase): |
| 21 """Google Maps pixel tests. | 22 """Google Maps pixel tests. |
| 22 | 23 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 @classmethod | 55 @classmethod |
| 55 def Name(cls): | 56 def Name(cls): |
| 56 return 'maps' | 57 return 'maps' |
| 57 | 58 |
| 58 @classmethod | 59 @classmethod |
| 59 def _CreateExpectations(cls): | 60 def _CreateExpectations(cls): |
| 60 return maps_expectations.MapsExpectations() | 61 return maps_expectations.MapsExpectations() |
| 61 | 62 |
| 62 @classmethod | 63 @classmethod |
| 63 def SetUpProcess(cls): | 64 def SetUpProcess(cls): |
| 65 color_profile_manager.ForceUntilExitSRGB() |
| 64 super(MapsIntegrationTest, cls).SetUpProcess() | 66 super(MapsIntegrationTest, cls).SetUpProcess() |
| 65 cls.CustomizeBrowserArgs([]) | 67 cls.CustomizeBrowserArgs(['--force-color-profile=srgb']) |
| 66 cls.StartWPRServer(os.path.join(data_path, 'maps_004.wpr.updated'), | 68 cls.StartWPRServer(os.path.join(data_path, 'maps_004.wpr.updated'), |
| 67 cloud_storage.PUBLIC_BUCKET) | 69 cloud_storage.PUBLIC_BUCKET) |
| 68 cls.StartBrowser() | 70 cls.StartBrowser() |
| 69 | 71 |
| 70 @classmethod | 72 @classmethod |
| 71 def TearDownProcess(cls): | 73 def TearDownProcess(cls): |
| 72 super(cls, MapsIntegrationTest).TearDownProcess() | 74 super(cls, MapsIntegrationTest).TearDownProcess() |
| 73 cls.StopWPRServer() | 75 cls.StopWPRServer() |
| 74 | 76 |
| 75 @classmethod | 77 @classmethod |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 # screenshot are observed. Hack around this by specifying a scale | 133 # screenshot are observed. Hack around this by specifying a scale |
| 132 # factor for these bots in the test expectations. This relies on | 134 # factor for these bots in the test expectations. This relies on |
| 133 # the test-machine-name argument being specified on the command | 135 # the test-machine-name argument being specified on the command |
| 134 # line. | 136 # line. |
| 135 expected = self._ReadPixelExpectations(pixel_expectations_file) | 137 expected = self._ReadPixelExpectations(pixel_expectations_file) |
| 136 self._ValidateScreenshotSamples(tab, url, screenshot, expected, dpr) | 138 self._ValidateScreenshotSamples(tab, url, screenshot, expected, dpr) |
| 137 | 139 |
| 138 def load_tests(loader, tests, pattern): | 140 def load_tests(loader, tests, pattern): |
| 139 del loader, tests, pattern # Unused. | 141 del loader, tests, pattern # Unused. |
| 140 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) | 142 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) |
| OLD | NEW |