| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 from telemetry.story import story_set as story_set_module | 5 from telemetry.story import story_set as story_set_module |
| 6 | 6 |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 from gpu_tests import gpu_test_base | 9 from gpu_tests import gpu_test_base |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 test, finder_options, story_set) | 72 test, finder_options, story_set) |
| 73 finder_options.browser_options.AppendExtraBrowserArgs( | 73 finder_options.browser_options.AppendExtraBrowserArgs( |
| 74 ['--enable-experimental-canvas-features']) | 74 ['--enable-experimental-canvas-features']) |
| 75 | 75 |
| 76 class PixelTestsStorySet(story_set_module.StorySet): | 76 class PixelTestsStorySet(story_set_module.StorySet): |
| 77 | 77 |
| 78 """ Some basic test cases for GPU. """ | 78 """ Some basic test cases for GPU. """ |
| 79 def __init__(self, expectations, base_name='Pixel', try_es3=False): | 79 def __init__(self, expectations, base_name='Pixel', try_es3=False): |
| 80 super(PixelTestsStorySet, self).__init__() | 80 super(PixelTestsStorySet, self).__init__() |
| 81 self._AddAllPages(expectations, base_name, False) | 81 self._AddAllPages(expectations, base_name, False) |
| 82 |
| 83 # Pages requiring the use of --enable-experimental-canvas-features |
| 84 self.AddStory(PixelTestsPage( |
| 85 url='file://../../data/gpu/pixel_offscreenCanvas_transferToImageBitmap_mai
n.html', |
| 86 name=base_name + '.OffscreenCanvasTransferToImageBitmap', |
| 87 test_rect=[0, 0, 300, 300], |
| 88 revision=1, |
| 89 story_set=self, |
| 90 shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState, |
| 91 expectations=expectations)) |
| 92 |
| 93 self.AddStory(PixelTestsPage( |
| 94 url='file://../../data/gpu/pixel_offscreenCanvas_transferToImageBitmap_wor
ker.html', |
| 95 name=base_name + '.OffscreenCanvasTransferToImageBitmapWorker', |
| 96 test_rect=[0, 0, 300, 300], |
| 97 revision=1, |
| 98 story_set=self, |
| 99 shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState, |
| 100 expectations=expectations)) |
| 101 |
| 102 self.AddStory(PixelTestsPage( |
| 103 url='file://../../data/gpu/pixel_offscreenCanvas_webgl_commit_main.html', |
| 104 name=base_name + '.OffscreenCanvasWebGLGreenBox', |
| 105 test_rect=[0, 0, 300, 300], |
| 106 revision=2, |
| 107 story_set=self, |
| 108 shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState, |
| 109 expectations=expectations)) |
| 110 |
| 111 self.AddStory(PixelTestsPage( |
| 112 url='file://../../data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html'
, |
| 113 name=base_name + '.OffscreenCanvasWebGLRedBoxWorker', |
| 114 test_rect=[0, 0, 300, 300], |
| 115 revision=3, |
| 116 story_set=self, |
| 117 shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState, |
| 118 expectations=expectations)) |
| 119 |
| 120 self.AddStory(PixelTestsPage( |
| 121 url='file://../../data/gpu/pixel_acceleratedOffscreen2d_commit_main.html', |
| 122 name=base_name + '.OffscreenCanvasAccelerated2D', |
| 123 test_rect=[0, 0, 350, 350], |
| 124 revision=1, |
| 125 story_set=self, |
| 126 shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState, |
| 127 expectations=expectations)) |
| 128 |
| 129 self.AddStory(PixelTestsPage( |
| 130 url='file://../../data/gpu/pixel_acceleratedOffscreen2d_commit_worker.html
', |
| 131 name=base_name + '.OffscreenCanvasAccelerated2DWorker', |
| 132 test_rect=[0, 0, 350, 350], |
| 133 revision=1, |
| 134 story_set=self, |
| 135 shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState, |
| 136 expectations=expectations)) |
| 137 |
| 138 |
| 82 # Would be better to fetch this from Telemetry. | 139 # Would be better to fetch this from Telemetry. |
| 83 # TODO(kbr): enable this on all platforms. Don't know what will | 140 # TODO(kbr): enable this on all platforms. Don't know what will |
| 84 # happen on Android right now. | 141 # happen on Android right now. |
| 85 if try_es3 and sys.platform.startswith('darwin'): | 142 if try_es3 and sys.platform.startswith('darwin'): |
| 86 # Add all the tests again, this time with the | 143 # Add all the tests again, this time with the |
| 87 # --enable-unsafe-es3-apis command line argument. This has the | 144 # --enable-unsafe-es3-apis command line argument. This has the |
| 88 # side-effect of enabling the Core Profile rendering path on Mac | 145 # side-effect of enabling the Core Profile rendering path on Mac |
| 89 # OS. | 146 # OS. |
| 90 self._AddAllPages(expectations, base_name, True) | 147 self._AddAllPages(expectations, base_name, True) |
| 91 | 148 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 225 |
| 169 def _AddAllPages(self, expectations, base_name, use_es3): | 226 def _AddAllPages(self, expectations, base_name, use_es3): |
| 170 if use_es3: | 227 if use_es3: |
| 171 es3_suffix = 'ES3' | 228 es3_suffix = 'ES3' |
| 172 shared_page_state_class = PixelTestsES3SharedPageState | 229 shared_page_state_class = PixelTestsES3SharedPageState |
| 173 else: | 230 else: |
| 174 es3_suffix = '' | 231 es3_suffix = '' |
| 175 shared_page_state_class = gpu_test_base.GpuSharedPageState | 232 shared_page_state_class = gpu_test_base.GpuSharedPageState |
| 176 | 233 |
| 177 self.AddStory(PixelTestsPage( | 234 self.AddStory(PixelTestsPage( |
| 178 url='file://../../data/gpu/pixel_offscreenCanvas_webgl_commit_main.html', | |
| 179 name=base_name + '.OffscreenCanvasWebGLGreenBox' + es3_suffix, | |
| 180 test_rect=[0, 0, 300, 300], | |
| 181 revision=1, | |
| 182 story_set=self, | |
| 183 shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState, | |
| 184 expectations=expectations)) | |
| 185 | |
| 186 self.AddStory(PixelTestsPage( | |
| 187 url='file://../../data/gpu/pixel_offscreenCanvas_webgl_commit_worker.html'
, | |
| 188 name=base_name + '.OffscreenCanvasWebGLRedBoxWorker' + es3_suffix, | |
| 189 test_rect=[0, 0, 300, 300], | |
| 190 revision=2, | |
| 191 story_set=self, | |
| 192 shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState, | |
| 193 expectations=expectations)) | |
| 194 | |
| 195 self.AddStory(PixelTestsPage( | |
| 196 url='file://../../data/gpu/pixel_acceleratedOffscreen2d_commit_main.html', | |
| 197 name=base_name + '.OffscreenCanvasAccelerated2D' + es3_suffix, | |
| 198 test_rect=[0, 0, 350, 350], | |
| 199 revision=1, | |
| 200 story_set=self, | |
| 201 shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState, | |
| 202 expectations=expectations)) | |
| 203 | |
| 204 self.AddStory(PixelTestsPage( | |
| 205 url='file://../../data/gpu/pixel_acceleratedOffscreen2d_commit_worker.html
', | |
| 206 name=base_name + '.OffscreenCanvasAccelerated2DWorker' + es3_suffix, | |
| 207 test_rect=[0, 0, 350, 350], | |
| 208 revision=1, | |
| 209 story_set=self, | |
| 210 shared_page_state_class=EnableExperimentalCanvasFeaturesSharedPageState, | |
| 211 expectations=expectations)) | |
| 212 | |
| 213 self.AddStory(PixelTestsPage( | |
| 214 url='file://../../data/gpu/pixel_canvas2d.html', | 235 url='file://../../data/gpu/pixel_canvas2d.html', |
| 215 name=base_name + '.Canvas2DRedBox' + es3_suffix, | 236 name=base_name + '.Canvas2DRedBox' + es3_suffix, |
| 216 test_rect=[0, 0, 300, 300], | 237 test_rect=[0, 0, 300, 300], |
| 217 revision=7, | 238 revision=7, |
| 218 story_set=self, | 239 story_set=self, |
| 219 shared_page_state_class=shared_page_state_class, | 240 shared_page_state_class=shared_page_state_class, |
| 220 expectations=expectations)) | 241 expectations=expectations)) |
| 221 | 242 |
| 222 self.AddStory(PixelTestsPage( | 243 self.AddStory(PixelTestsPage( |
| 223 url='file://../../data/gpu/pixel_css3d.html', | 244 url='file://../../data/gpu/pixel_css3d.html', |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 story_set=self, | 312 story_set=self, |
| 292 shared_page_state_class=shared_page_state_class, | 313 shared_page_state_class=shared_page_state_class, |
| 293 expectations=expectations)) | 314 expectations=expectations)) |
| 294 | 315 |
| 295 @property | 316 @property |
| 296 def allow_mixed_story_states(self): | 317 def allow_mixed_story_states(self): |
| 297 # Return True here in order to be able to add the same tests with | 318 # Return True here in order to be able to add the same tests with |
| 298 # a different SharedPageState on Mac which tests them with the | 319 # a different SharedPageState on Mac which tests them with the |
| 299 # Core Profile rendering path. | 320 # Core Profile rendering path. |
| 300 return True | 321 return True |
| OLD | NEW |