| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 | 47 |
| 48 class WebGLNonChromiumImageSharedPageState(gpu_test_base.GpuSharedPageState): | 48 class WebGLNonChromiumImageSharedPageState(gpu_test_base.GpuSharedPageState): |
| 49 def __init__(self, test, finder_options, story_set): | 49 def __init__(self, test, finder_options, story_set): |
| 50 super(WebGLNonChromiumImageSharedPageState, self).__init__( | 50 super(WebGLNonChromiumImageSharedPageState, self).__init__( |
| 51 test, finder_options, story_set) | 51 test, finder_options, story_set) |
| 52 finder_options.browser_options.AppendExtraBrowserArgs( | 52 finder_options.browser_options.AppendExtraBrowserArgs( |
| 53 ['--disable-webgl-image-chromium']) | 53 ['--disable-webgl-image-chromium']) |
| 54 | 54 |
| 55 | 55 |
| 56 class DisableMacOverlaysSharedPageState(gpu_test_base.GpuSharedPageState): |
| 57 def __init__(self, test, finder_options, story_set): |
| 58 super(DisableMacOverlaysSharedPageState, self).__init__( |
| 59 test, finder_options, story_set) |
| 60 finder_options.browser_options.AppendExtraBrowserArgs( |
| 61 ['--disable-mac-overlays']) |
| 62 |
| 63 |
| 56 class PixelTestsStorySet(story_set_module.StorySet): | 64 class PixelTestsStorySet(story_set_module.StorySet): |
| 57 | 65 |
| 58 """ Some basic test cases for GPU. """ | 66 """ Some basic test cases for GPU. """ |
| 59 def __init__(self, expectations, base_name='Pixel', try_es3=False): | 67 def __init__(self, expectations, base_name='Pixel', try_es3=False): |
| 60 super(PixelTestsStorySet, self).__init__() | 68 super(PixelTestsStorySet, self).__init__() |
| 61 self._AddAllPages(expectations, base_name, False) | 69 self._AddAllPages(expectations, base_name, False) |
| 62 # Would be better to fetch this from Telemetry. | 70 # Would be better to fetch this from Telemetry. |
| 63 # TODO(kbr): enable this on all platforms. Don't know what will | 71 # TODO(kbr): enable this on all platforms. Don't know what will |
| 64 # happen on Android right now. | 72 # happen on Android right now. |
| 65 if try_es3 and sys.platform.startswith('darwin'): | 73 if try_es3 and sys.platform.startswith('darwin'): |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 126 |
| 119 self.AddStory(PixelTestsPage( | 127 self.AddStory(PixelTestsPage( |
| 120 url='file://../../data/gpu/pixel_webgl_noaa_noalpha.html', | 128 url='file://../../data/gpu/pixel_webgl_noaa_noalpha.html', |
| 121 name=base_name + '.WebGLGreenTriangle.NonChromiumImage.NoAA.NoAlpha', | 129 name=base_name + '.WebGLGreenTriangle.NonChromiumImage.NoAA.NoAlpha', |
| 122 test_rect=[0, 0, 300, 300], | 130 test_rect=[0, 0, 300, 300], |
| 123 revision=1, | 131 revision=1, |
| 124 story_set=self, | 132 story_set=self, |
| 125 shared_page_state_class=WebGLNonChromiumImageSharedPageState, | 133 shared_page_state_class=WebGLNonChromiumImageSharedPageState, |
| 126 expectations=expectations)) | 134 expectations=expectations)) |
| 127 | 135 |
| 136 # On macOS, test CSS filter effects with and without the CA compositor. |
| 137 self.AddStory(PixelTestsPage( |
| 138 url='file://../../data/gpu/filter_effects.html', |
| 139 name=base_name + '.CSSFilterEffects', |
| 140 test_rect=[0, 0, 300, 300], |
| 141 revision=1, |
| 142 story_set=self, |
| 143 shared_page_state_class=gpu_test_base.GpuSharedPageState, |
| 144 expectations=expectations)) |
| 145 |
| 146 self.AddStory(PixelTestsPage( |
| 147 url='file://../../data/gpu/filter_effects.html', |
| 148 name=base_name + '.CSSFilterEffects.NoOverlays', |
| 149 test_rect=[0, 0, 300, 300], |
| 150 revision=1, |
| 151 story_set=self, |
| 152 shared_page_state_class=DisableMacOverlaysSharedPageState, |
| 153 expectations=expectations)) |
| 154 |
| 128 def _AddAllPages(self, expectations, base_name, use_es3): | 155 def _AddAllPages(self, expectations, base_name, use_es3): |
| 129 if use_es3: | 156 if use_es3: |
| 130 es3_suffix = 'ES3' | 157 es3_suffix = 'ES3' |
| 131 shared_page_state_class = PixelTestsES3SharedPageState | 158 shared_page_state_class = PixelTestsES3SharedPageState |
| 132 else: | 159 else: |
| 133 es3_suffix = '' | 160 es3_suffix = '' |
| 134 shared_page_state_class = gpu_test_base.GpuSharedPageState | 161 shared_page_state_class = gpu_test_base.GpuSharedPageState |
| 135 | 162 |
| 136 self.AddStory(PixelTestsPage( | 163 self.AddStory(PixelTestsPage( |
| 137 url='file://../../data/gpu/pixel_canvas2d.html', | 164 url='file://../../data/gpu/pixel_canvas2d.html', |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 story_set=self, | 241 story_set=self, |
| 215 shared_page_state_class=shared_page_state_class, | 242 shared_page_state_class=shared_page_state_class, |
| 216 expectations=expectations)) | 243 expectations=expectations)) |
| 217 | 244 |
| 218 @property | 245 @property |
| 219 def allow_mixed_story_states(self): | 246 def allow_mixed_story_states(self): |
| 220 # Return True here in order to be able to add the same tests with | 247 # Return True here in order to be able to add the same tests with |
| 221 # a different SharedPageState on Mac which tests them with the | 248 # a different SharedPageState on Mac which tests them with the |
| 222 # Core Profile rendering path. | 249 # Core Profile rendering path. |
| 223 return True | 250 return True |
| OLD | NEW |