OLD | NEW |
| (Empty) |
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 | |
5 | |
6 from gpu_tests import gpu_test_base | |
7 | |
8 class GpuRasterizationBlueBoxPage(gpu_test_base.PageBase): | |
9 | |
10 def __init__(self, story_set, expectations): | |
11 super(GpuRasterizationBlueBoxPage, self).__init__( | |
12 url='file://../../data/gpu/pixel_background.html', | |
13 page_set=story_set, | |
14 name='GpuRasterization.BlueBox', | |
15 expectations=expectations) | |
16 | |
17 self.expectations = [ | |
18 {'comment': 'body-t', | |
19 'color': [0, 128, 0], | |
20 'tolerance': 0, | |
21 'location': [5, 5], | |
22 'size': [1, 1]}, | |
23 {'comment': 'body-r', | |
24 'color': [0, 128, 0], | |
25 'tolerance': 0, | |
26 'location': [215, 5], | |
27 'size': [1, 1]}, | |
28 {'comment': 'body-b', | |
29 'color': [0, 128, 0], | |
30 'tolerance': 0, | |
31 'location': [215, 215], | |
32 'size': [1, 1]}, | |
33 {'comment': 'body-l', | |
34 'color': [0, 128, 0], | |
35 'tolerance': 0, | |
36 'location': [5, 215], | |
37 'size': [1, 1]}, | |
38 {'comment': 'background-t', | |
39 'color': [0, 0, 0], | |
40 'tolerance': 0, | |
41 'location': [30, 30], | |
42 'size': [1, 1]}, | |
43 {'comment': 'background-r', | |
44 'color': [0, 0, 0], | |
45 'tolerance': 0, | |
46 'location': [170, 30], | |
47 'size': [1, 1]}, | |
48 {'comment': 'background-b', | |
49 'color': [0, 0, 0], | |
50 'tolerance': 0, | |
51 'location': [170, 170], | |
52 'size': [1, 1]}, | |
53 {'comment': 'background-l', | |
54 'color': [0, 0, 0], | |
55 'tolerance': 0, | |
56 'location': [30, 170], | |
57 'size': [1, 1]}, | |
58 {'comment': 'box-t', | |
59 'color': [0, 0, 255], | |
60 'tolerance': 0, | |
61 'location': [70, 70], | |
62 'size': [1, 1]}, | |
63 {'comment': 'box-r', | |
64 'color': [0, 0, 255], | |
65 'tolerance': 0, | |
66 'location': [140, 70], | |
67 'size': [1, 1]}, | |
68 {'comment': 'box-b', | |
69 'color': [0, 0, 255], | |
70 'tolerance': 0, | |
71 'location': [140, 140], | |
72 'size': [1, 1]}, | |
73 {'comment': 'box-l', | |
74 'color': [0, 0, 255], | |
75 'tolerance': 0, | |
76 'location': [70, 140], | |
77 'size': [1, 1]} | |
78 ] | |
79 self.test_rect = [0, 0, 220, 220] | |
80 | |
81 def RunNavigateSteps(self, action_runner): | |
82 super(GpuRasterizationBlueBoxPage, self).RunNavigateSteps(action_runner) | |
83 action_runner.WaitForJavaScriptCondition( | |
84 'domAutomationController._finished', timeout_in_seconds=30) | |
85 | |
86 | |
87 class GpuRasterizationConcavePathsPage(gpu_test_base.PageBase): | |
88 | |
89 def __init__(self, story_set, expectations): | |
90 super(GpuRasterizationConcavePathsPage, self).__init__( | |
91 url='file://../../data/gpu/concave_paths.html', | |
92 page_set=story_set, | |
93 name='GpuRasterization.ConcavePaths', | |
94 expectations=expectations) | |
95 | |
96 self.expectations = [ | |
97 {'comment': 'outside', | |
98 'color': [255, 255, 255], | |
99 'tolerance': 0, | |
100 'location': [80, 60], | |
101 'size': [1, 1]}, | |
102 {'comment': 'outside', | |
103 'color': [255, 255, 255], | |
104 'tolerance': 0, | |
105 'location': [28, 20], | |
106 'size': [1, 1]}, | |
107 {'comment': 'inside', | |
108 'color': [255, 215, 0], | |
109 'tolerance': 0, | |
110 'location': [32, 25], | |
111 'size': [1, 1]}, | |
112 {'comment': 'inside', | |
113 'color': [255, 215, 0], | |
114 'tolerance': 0, | |
115 'location': [80, 80], | |
116 'size': [1, 1]} | |
117 ] | |
118 self.test_rect = [0, 0, 100, 100] | |
119 | |
120 def RunNavigateSteps(self, action_runner): | |
121 super(GpuRasterizationConcavePathsPage, self).RunNavigateSteps( | |
122 action_runner) | |
123 action_runner.WaitForJavaScriptCondition( | |
124 'domAutomationController._finished', timeout_in_seconds=30) | |
125 | |
126 class GpuRasterizationTestsStorySet(story_set_module.StorySet): | |
127 | |
128 """ Basic test cases for GPU rasterization. """ | |
129 | |
130 def __init__(self, expectations): | |
131 super(GpuRasterizationTestsStorySet, self).__init__() | |
132 | |
133 self.AddStory(GpuRasterizationBlueBoxPage(self, expectations)) | |
134 self.AddStory(GpuRasterizationConcavePathsPage(self, expectations)) | |
OLD | NEW |