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

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

Issue 2363343002: Ported pixel_test to new gpu_integration_test harness. (Closed)
Patch Set: Update revision for OffscreenCanvasWebGLGreenBox. Created 4 years, 2 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
(Empty)
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
3 # found in the LICENSE file.
4
5 class PixelTestPage(object):
6 """A wrapper class mimicking the functionality of the PixelTestsStorySet
7 from the old-style GPU tests.
8 """
9 def __init__(self, url, name, test_rect, revision,
10 expected_colors=None, tolerance=2, browser_args=None):
11 super(PixelTestPage, self).__init__()
12 self.url = url
13 self.name = name
14 self.test_rect = test_rect
15 self.revision = revision
16 # The expected colors can be specified as a list of dictionaries,
17 # in which case these specific pixels will be sampled instead of
18 # comparing the entire image snapshot. The format is only defined
19 # by contract with _CompareScreenshotSamples in
20 # cloud_storage_integration_test_base.py.
21 self.expected_colors = expected_colors
22 # The tolerance when comparing against the reference image.
23 self.tolerance = tolerance
24 self.browser_args = browser_args
25
26 def CopyWithNewBrowserArgsAndSuffix(self, browser_args, suffix):
27 return PixelTestPage(
28 self.url, self.name + suffix, self.test_rect, self.revision,
29 self.expected_colors, self.tolerance, browser_args)
30
31 def CopyWithNewBrowserArgsAndPrefix(self, browser_args, prefix):
32 # Assuming the test name is 'Pixel'.
33 split = self.name.split('_', 1)
34 return PixelTestPage(
35 self.url, split[0] + '_' + prefix + split[1], self.test_rect,
36 self.revision, self.expected_colors, self.tolerance, browser_args)
37
38
39 def CopyPagesWithNewBrowserArgsAndSuffix(pages, browser_args, suffix):
40 return [
41 p.CopyWithNewBrowserArgsAndSuffix(browser_args, suffix) for p in pages]
42
43
44 def CopyPagesWithNewBrowserArgsAndPrefix(pages, browser_args, prefix):
45 return [
46 p.CopyWithNewBrowserArgsAndPrefix(browser_args, prefix) for p in pages]
47
48
49 # Pages that should be run both with and without --enable-unsafe-es3-apis.
50 # TODO(kbr): eliminate the "ES3" versions of these tests once WebGL 2.0
51 # is enabled by default. crbug.com/295792
52 def ES2AndES3Pages(base_name):
53 return [
54 PixelTestPage(
55 'pixel_canvas2d.html',
56 base_name + '_Canvas2DRedBox',
57 test_rect=[0, 0, 300, 300],
58 revision=7),
59
60 PixelTestPage(
61 'pixel_css3d.html',
62 base_name + '_CSS3DBlueBox',
63 test_rect=[0, 0, 300, 300],
64 revision=15),
65
66 PixelTestPage(
67 'pixel_webgl_aa_alpha.html',
68 base_name + '_WebGLGreenTriangle_AA_Alpha',
69 test_rect=[0, 0, 300, 300],
70 revision=1),
71
72 PixelTestPage(
73 'pixel_webgl_noaa_alpha.html',
74 base_name + '_WebGLGreenTriangle_NoAA_Alpha',
75 test_rect=[0, 0, 300, 300],
76 revision=1),
77
78 PixelTestPage(
79 'pixel_webgl_aa_noalpha.html',
80 base_name + '_WebGLGreenTriangle_AA_NoAlpha',
81 test_rect=[0, 0, 300, 300],
82 revision=1),
83
84 PixelTestPage(
85 'pixel_webgl_noaa_noalpha.html',
86 base_name + '_WebGLGreenTriangle_NoAA_NoAlpha',
87 test_rect=[0, 0, 300, 300],
88 revision=1),
89
90 PixelTestPage(
91 'pixel_scissor.html',
92 base_name + '_ScissorTestWithPreserveDrawingBuffer',
93 test_rect=[0, 0, 300, 300],
94 revision=0, # This is not used.
95 expected_colors=[
96 {
97 'comment': 'red top',
98 'location': [1, 1],
99 'size': [198, 188],
100 'color': [255, 0, 0],
101 'tolerance': 3
102 },
103 {
104 'comment': 'green bottom left',
105 'location': [1, 191],
106 'size': [8, 8],
107 'color': [0, 255, 0],
108 'tolerance': 3
109 },
110 {
111 'comment': 'red bottom right',
112 'location': [11, 191],
113 'size': [188, 8],
114 'color': [255, 0, 0],
115 'tolerance': 3
116 }
117 ]),
118
119 PixelTestPage(
120 'pixel_canvas2d_webgl.html',
121 base_name + '_2DCanvasWebGL',
122 test_rect=[0, 0, 300, 300],
123 revision=2),
124
125 PixelTestPage(
126 'pixel_background.html',
127 base_name + '_SolidColorBackground',
128 test_rect=[500, 500, 100, 100],
129 revision=1),
130 ]
131
132
133 # Pages that should be run with experimental canvas features.
134 def ExperimentalCanvasFeaturesPages(base_name):
135 browser_args = ['--enable-experimental-canvas-features']
136
137 return [
138 PixelTestPage(
139 'pixel_offscreenCanvas_transferToImageBitmap_main.html',
140 base_name + '_OffscreenCanvasTransferToImageBitmap',
141 test_rect=[0, 0, 300, 300],
142 revision=1,
143 browser_args=browser_args),
144
145 PixelTestPage(
146 'pixel_offscreenCanvas_transferToImageBitmap_worker.html',
147 base_name + '_OffscreenCanvasTransferToImageBitmapWorker',
148 test_rect=[0, 0, 300, 300],
149 revision=1,
150 browser_args=browser_args),
151
152 PixelTestPage(
153 'pixel_offscreenCanvas_webgl_commit_main.html',
154 base_name + '_OffscreenCanvasWebGLGreenBox',
155 test_rect=[0, 0, 300, 300],
156 revision=2,
157 browser_args=browser_args),
158
159 PixelTestPage(
160 'pixel_offscreenCanvas_webgl_commit_worker.html',
161 base_name + '_OffscreenCanvasWebGLRedBoxWorker',
162 test_rect=[0, 0, 300, 300],
163 revision=3,
164 browser_args=browser_args),
165
166 PixelTestPage(
167 'pixel_acceleratedOffscreen2d_commit_main.html',
168 base_name + '_OffscreenCanvasAccelerated2D',
169 test_rect=[0, 0, 350, 350],
170 revision=1,
171 browser_args=browser_args),
172
173 PixelTestPage(
174 'pixel_acceleratedOffscreen2d_commit_worker.html',
175 base_name + '_OffscreenCanvasAccelerated2DWorker',
176 test_rect=[0, 0, 350, 350],
177 revision=1,
178 browser_args=browser_args),
179 ]
180
181 # Pages that should be run with various macOS specific command line
182 # arguments.
183 def MacSpecificPages(base_name):
184 iosurface_2d_canvas_args = [
185 '--enable-accelerated-2d-canvas',
186 '--disable-display-list-2d-canvas']
187
188 non_chromium_image_args = ['--disable-webgl-image-chromium']
189
190 return [
191 # On macOS, test the IOSurface 2D Canvas compositing path.
192 PixelTestPage(
193 'pixel_canvas2d_accelerated.html',
194 base_name + '_IOSurface2DCanvas',
195 test_rect=[0, 0, 400, 400],
196 revision=1,
197 browser_args=iosurface_2d_canvas_args),
198 PixelTestPage(
199 'pixel_canvas2d_webgl.html',
200 base_name + '_IOSurface2DCanvasWebGL',
201 test_rect=[0, 0, 300, 300],
202 revision=2,
203 browser_args=iosurface_2d_canvas_args),
204
205 # On macOS, test WebGL non-Chromium Image compositing path.
206 PixelTestPage(
207 'pixel_webgl_aa_alpha.html',
208 base_name + '_WebGLGreenTriangle_NonChromiumImage_AA_Alpha',
209 test_rect=[0, 0, 300, 300],
210 revision=1,
211 browser_args=non_chromium_image_args),
212 PixelTestPage(
213 'pixel_webgl_noaa_alpha.html',
214 base_name + '_WebGLGreenTriangle_NonChromiumImage_NoAA_Alpha',
215 test_rect=[0, 0, 300, 300],
216 revision=1,
217 browser_args=non_chromium_image_args),
218 PixelTestPage(
219 'pixel_webgl_aa_noalpha.html',
220 base_name + '_WebGLGreenTriangle_NonChromiumImage_AA_NoAlpha',
221 test_rect=[0, 0, 300, 300],
222 revision=1,
223 browser_args=non_chromium_image_args),
224 PixelTestPage(
225 'pixel_webgl_noaa_noalpha.html',
226 base_name + '_WebGLGreenTriangle_NonChromiumImage_NoAA_NoAlpha',
227 test_rect=[0, 0, 300, 300],
228 revision=1,
229 browser_args=non_chromium_image_args),
230
231 # On macOS, test CSS filter effects with and without the CA compositor.
232 PixelTestPage(
233 'filter_effects.html',
234 base_name + '_CSSFilterEffects',
235 test_rect=[0, 0, 300, 300],
236 revision=2),
237 PixelTestPage(
238 'filter_effects.html',
239 base_name + '_CSSFilterEffects_NoOverlays',
240 test_rect=[0, 0, 300, 300],
241 revision=2,
242 tolerance=10,
243 browser_args=['--disable-mac-overlays']),
244 ]
OLDNEW
« no previous file with comments | « content/test/gpu/gpu_tests/pixel_integration_test.py ('k') | testing/buildbot/chromium.gpu.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698