Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(570)

Side by Side Diff: content/test/gpu/gpu_tests/maps_integration_test.py

Issue 2944733002: Force sRGB color profile on Mac for pixel tests (Closed)
Patch Set: Include maps, dont enable color correction Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 cls._color_profile_manager = color_profile_manager.ColorProfileManager()
66 cls._color_profile_manager.ForceSRGB()
64 super(MapsIntegrationTest, cls).SetUpProcess() 67 super(MapsIntegrationTest, cls).SetUpProcess()
65 cls.CustomizeBrowserArgs([]) 68 cls.CustomizeBrowserArgs(['--force-color-profile=srgb'])
66 cls.StartWPRServer(os.path.join(data_path, 'maps_004.wpr.updated'), 69 cls.StartWPRServer(os.path.join(data_path, 'maps_004.wpr.updated'),
67 cloud_storage.PUBLIC_BUCKET) 70 cloud_storage.PUBLIC_BUCKET)
68 cls.StartBrowser() 71 cls.StartBrowser()
69 72
70 @classmethod 73 @classmethod
71 def TearDownProcess(cls): 74 def TearDownProcess(cls):
72 super(cls, MapsIntegrationTest).TearDownProcess() 75 super(cls, MapsIntegrationTest).TearDownProcess()
73 cls.StopWPRServer() 76 cls.StopWPRServer()
77 cls._color_profile_manager.Restore()
Ken Russell (switch to Gerrit) 2017/06/20 22:55:02 See above comment about whether this class should
ccameron 2017/06/21 06:45:42 Done -- this (and the whole method for pixel) are
74 78
75 @classmethod 79 @classmethod
76 def GenerateGpuTests(cls, options): 80 def GenerateGpuTests(cls, options):
77 cls.SetParsedCommandLineOptions(options) 81 cls.SetParsedCommandLineOptions(options)
78 yield('Maps_maps_004', 82 yield('Maps_maps_004',
79 'http://map-test/performance.html', 83 'http://map-test/performance.html',
80 ('maps_004_expectations.json')) 84 ('maps_004_expectations.json'))
81 85
82 def _ReadPixelExpectations(self, expectations_file): 86 def _ReadPixelExpectations(self, expectations_file):
83 expectations_path = os.path.join(data_path, expectations_file) 87 expectations_path = os.path.join(data_path, expectations_file)
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 # screenshot are observed. Hack around this by specifying a scale 135 # screenshot are observed. Hack around this by specifying a scale
132 # factor for these bots in the test expectations. This relies on 136 # factor for these bots in the test expectations. This relies on
133 # the test-machine-name argument being specified on the command 137 # the test-machine-name argument being specified on the command
134 # line. 138 # line.
135 expected = self._ReadPixelExpectations(pixel_expectations_file) 139 expected = self._ReadPixelExpectations(pixel_expectations_file)
136 self._ValidateScreenshotSamples(tab, url, screenshot, expected, dpr) 140 self._ValidateScreenshotSamples(tab, url, screenshot, expected, dpr)
137 141
138 def load_tests(loader, tests, pattern): 142 def load_tests(loader, tests, pattern):
139 del loader, tests, pattern # Unused. 143 del loader, tests, pattern # Unused.
140 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__]) 144 return gpu_integration_test.LoadAllTestsInModule(sys.modules[__name__])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698