[refactor] More post-NSS WebCrypto cleanups (utility functions).
[chromium-blink-merge.git] / content / test / gpu / page_sets / gpu_process_tests.py
blobe1fdb6915c78aaf03f1729aee1c7e7c6558d70fd
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
3 # found in the LICENSE file.
4 from telemetry.story import story_set as story_set_module
6 from gpu_tests import gpu_test_base
8 class GpuProcessTestsPage(gpu_test_base.PageBase):
10 def __init__(self, url, name, story_set, expectations):
11 super(GpuProcessTestsPage, self).__init__(url=url, page_set=story_set,
12 name=name,
13 expectations=expectations)
16 class FunctionalVideoPage(GpuProcessTestsPage):
18 def __init__(self, story_set, expectations):
19 super(FunctionalVideoPage, self).__init__(
20 url='file://../../data/gpu/functional_video.html',
21 name='GpuProcess.video',
22 story_set=story_set,
23 expectations=expectations)
25 def RunNavigateStepsInner(self, action_runner):
26 action_runner.WaitForJavaScriptCondition(
27 'domAutomationController._finished', timeout_in_seconds=30)
30 class GpuInfoCompletePage(GpuProcessTestsPage):
32 def __init__(self, story_set, expectations):
33 super(GpuInfoCompletePage, self).__init__(
34 url='file://../../data/gpu/functional_3d_css.html',
35 name='GpuProcess.gpu_info_complete',
36 story_set=story_set,
37 expectations=expectations)
39 def Validate(self, tab, results):
40 # Regression test for crbug.com/454906
41 if not tab.browser.supports_system_info:
42 raise page_test.Failure('Browser must support system info')
43 system_info = tab.browser.GetSystemInfo()
44 if not system_info.gpu:
45 raise page_test.Failure('Target machine must have a GPU')
46 if not system_info.gpu.aux_attributes:
47 raise page_test.Failure('Browser must support GPU aux attributes')
48 if not 'gl_renderer' in system_info.gpu.aux_attributes:
49 raise page_test.Failure('Browser must have gl_renderer in aux attribs')
50 if len(system_info.gpu.aux_attributes['gl_renderer']) <= 0:
51 raise page_test.Failure('Must have a non-empty gl_renderer string')
54 class GpuProcessTestsStorySet(story_set_module.StorySet):
56 """ Tests that accelerated content triggers the creation of a GPU process """
58 def __init__(self, expectations):
59 super(GpuProcessTestsStorySet, self).__init__(
60 serving_dirs=set(['../../../../content/test/data']))
62 urls_and_names_list = [
63 ('file://../../data/gpu/functional_canvas_demo.html',
64 'GpuProcess.canvas2d'),
65 ('file://../../data/gpu/functional_3d_css.html',
66 'GpuProcess.css3d'),
67 ('file://../../data/gpu/functional_webgl.html',
68 'GpuProcess.webgl')
71 for url, name in urls_and_names_list:
72 self.AddStory(GpuProcessTestsPage(url, name, self, expectations))
74 self.AddStory(FunctionalVideoPage(self, expectations))
75 self.AddStory(GpuInfoCompletePage(self, expectations))