| 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 from telemetry.story import story_set as story_set_module | 4 from telemetry.story import story_set as story_set_module |
| 5 from telemetry.page import page_test | 5 from telemetry.page import page_test |
| 6 | 6 |
| 7 from gpu_tests import gpu_test_base | 7 from gpu_tests import gpu_test_base |
| 8 | 8 |
| 9 class GpuProcessTestsPage(gpu_test_base.PageBase): | 9 class GpuProcessTestsPage(gpu_test_base.PageBase): |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 system_info = tab.browser.GetSystemInfo() | 45 system_info = tab.browser.GetSystemInfo() |
| 46 if not system_info.gpu: | 46 if not system_info.gpu: |
| 47 raise page_test.Failure('Target machine must have a GPU') | 47 raise page_test.Failure('Target machine must have a GPU') |
| 48 if not system_info.gpu.aux_attributes: | 48 if not system_info.gpu.aux_attributes: |
| 49 raise page_test.Failure('Browser must support GPU aux attributes') | 49 raise page_test.Failure('Browser must support GPU aux attributes') |
| 50 if not 'gl_renderer' in system_info.gpu.aux_attributes: | 50 if not 'gl_renderer' in system_info.gpu.aux_attributes: |
| 51 raise page_test.Failure('Browser must have gl_renderer in aux attribs') | 51 raise page_test.Failure('Browser must have gl_renderer in aux attribs') |
| 52 if len(system_info.gpu.aux_attributes['gl_renderer']) <= 0: | 52 if len(system_info.gpu.aux_attributes['gl_renderer']) <= 0: |
| 53 raise page_test.Failure('Must have a non-empty gl_renderer string') | 53 raise page_test.Failure('Must have a non-empty gl_renderer string') |
| 54 | 54 |
| 55 | |
| 56 class GpuProcessTestsStorySet(story_set_module.StorySet): | 55 class GpuProcessTestsStorySet(story_set_module.StorySet): |
| 57 | 56 |
| 58 """ Tests that accelerated content triggers the creation of a GPU process """ | 57 """ Tests that accelerated content triggers the creation of a GPU process """ |
| 59 | 58 |
| 60 def __init__(self, expectations): | 59 def __init__(self, expectations): |
| 61 super(GpuProcessTestsStorySet, self).__init__( | 60 super(GpuProcessTestsStorySet, self).__init__( |
| 62 serving_dirs=set(['../../../../content/test/data'])) | 61 serving_dirs=set(['../../../../content/test/data'])) |
| 63 | 62 |
| 64 urls_and_names_list = [ | 63 urls_and_names_list = [ |
| 65 ('file://../../data/gpu/functional_canvas_demo.html', | 64 ('file://../../data/gpu/functional_canvas_demo.html', |
| 66 'GpuProcess.canvas2d'), | 65 'GpuProcess.canvas2d'), |
| 67 ('file://../../data/gpu/functional_3d_css.html', | 66 ('file://../../data/gpu/functional_3d_css.html', |
| 68 'GpuProcess.css3d'), | 67 'GpuProcess.css3d'), |
| 69 ('file://../../data/gpu/functional_webgl.html', | 68 ('file://../../data/gpu/functional_webgl.html', |
| 70 'GpuProcess.webgl') | 69 'GpuProcess.webgl') |
| 71 ] | 70 ] |
| 72 | 71 |
| 73 for url, name in urls_and_names_list: | 72 for url, name in urls_and_names_list: |
| 74 self.AddStory(GpuProcessTestsPage(url, name, self, expectations)) | 73 self.AddStory(GpuProcessTestsPage(url, name, self, expectations)) |
| 75 | 74 |
| 76 self.AddStory(FunctionalVideoPage(self, expectations)) | 75 self.AddStory(FunctionalVideoPage(self, expectations)) |
| 77 self.AddStory(GpuInfoCompletePage(self, expectations)) | 76 self.AddStory(GpuInfoCompletePage(self, expectations)) |
| OLD | NEW |