Content settings: remove some plugin-related code/resources when... there are no...
[chromium-blink-merge.git] / content / test / gpu / page_sets / gpu_rasterization_tests.py
blob564641add32b76482330d6a42e49de27242863de
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 GpuRasterizationBlueBoxPage(gpu_test_base.PageBase):
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)
17 self.expectations = [
18 {'comment': 'body-t',
19 'color': [255, 255, 255],
20 'tolerance': 0,
21 'location': [5, 5],
22 'size': [1, 1]},
23 {'comment': 'body-r',
24 'color': [255, 255, 255],
25 'tolerance': 0,
26 'location': [215, 5],
27 'size': [1, 1]},
28 {'comment': 'body-b',
29 'color': [255, 255, 255],
30 'tolerance': 0,
31 'location': [215, 215],
32 'size': [1, 1]},
33 {'comment': 'body-l',
34 'color': [255, 255, 255],
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]}
79 self.test_rect = [0, 0, 220, 220]
81 def RunNavigateStepsInner(self, action_runner):
82 action_runner.WaitForJavaScriptCondition(
83 'domAutomationController._finished', timeout_in_seconds=30)
86 class GpuRasterizationConcavePathsPage(gpu_test_base.PageBase):
88 def __init__(self, story_set, expectations):
89 super(GpuRasterizationConcavePathsPage, self).__init__(
90 url='file://../../data/gpu/concave_paths.html',
91 page_set=story_set,
92 name='GpuRasterization.ConcavePaths',
93 expectations=expectations)
95 self.expectations = [
96 {'comment': 'outside',
97 'color': [255, 255, 255],
98 'tolerance': 0,
99 'location': [5, 5],
100 'size': [1, 1]},
101 {'comment': 'inside',
102 'color': [255, 215, 0],
103 'tolerance': 0,
104 'location': [20, 50],
105 'size': [1, 1]}
107 self.test_rect = [0, 0, 100, 100]
109 def RunNavigateStepsInner(self, action_runner):
110 action_runner.WaitForJavaScriptCondition(
111 'domAutomationController._finished', timeout_in_seconds=30)
113 class GpuRasterizationTestsStorySet(story_set_module.StorySet):
115 """ Basic test cases for GPU rasterization. """
117 def __init__(self, expectations):
118 super(GpuRasterizationTestsStorySet, self).__init__()
120 self.AddStory(GpuRasterizationBlueBoxPage(self, expectations))
121 self.AddStory(GpuRasterizationConcavePathsPage(self, expectations))