Update broken references to image assets
[chromium-blink-merge.git] / content / test / gpu / page_sets / gpu_rasterization_tests.py
blob407381c15c3f65df4793f6bcb01fbf750e662d38
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 {'comment': 'body-r',
23 'color': [255, 255, 255],
24 'tolerance': 0,
25 'location': [215, 5]},
26 {'comment': 'body-b',
27 'color': [255, 255, 255],
28 'tolerance': 0,
29 'location': [215, 215]},
30 {'comment': 'body-l',
31 'color': [255, 255, 255],
32 'tolerance': 0,
33 'location': [5, 215]},
34 {'comment': 'background-t',
35 'color': [0, 0, 0],
36 'tolerance': 0,
37 'location': [30, 30]},
38 {'comment': 'background-r',
39 'color': [0, 0, 0],
40 'tolerance': 0,
41 'location': [170, 30]},
42 {'comment': 'background-b',
43 'color': [0, 0, 0],
44 'tolerance': 0,
45 'location': [170, 170]},
46 {'comment': 'background-l',
47 'color': [0, 0, 0],
48 'tolerance': 0,
49 'location': [30, 170]},
50 {'comment': 'box-t',
51 'color': [0, 0, 255],
52 'tolerance': 0,
53 'location': [70, 70]},
54 {'comment': 'box-r',
55 'color': [0, 0, 255],
56 'tolerance': 0,
57 'location': [140, 70]},
58 {'comment': 'box-b',
59 'color': [0, 0, 255],
60 'tolerance': 0,
61 'location': [140, 140]},
62 {'comment': 'box-l',
63 'color': [0, 0, 255],
64 'tolerance': 0,
65 'location': [70, 140]}
67 self.test_rect = [0, 0, 220, 220]
69 def RunNavigateStepsInner(self, action_runner):
70 action_runner.WaitForJavaScriptCondition(
71 'domAutomationController._finished', timeout_in_seconds=30)
74 class GpuRasterizationConcavePathsPage(gpu_test_base.PageBase):
76 def __init__(self, story_set, expectations):
77 super(GpuRasterizationConcavePathsPage, self).__init__(
78 url='file://../../data/gpu/concave_paths.html',
79 page_set=story_set,
80 name='GpuRasterization.ConcavePaths',
81 expectations=expectations)
83 self.expectations = [
84 {'comment': 'outside',
85 'color': [255, 255, 255],
86 'tolerance': 0,
87 'location': [5, 5]},
88 {'comment': 'inside',
89 'color': [255, 215, 0],
90 'tolerance': 0,
91 'location': [20, 50]},
93 self.test_rect = [0, 0, 100, 100]
95 def RunNavigateStepsInner(self, action_runner):
96 action_runner.WaitForJavaScriptCondition(
97 'domAutomationController._finished', timeout_in_seconds=30)
99 class GpuRasterizationTestsStorySet(story_set_module.StorySet):
101 """ Basic test cases for GPU rasterization. """
103 def __init__(self, expectations):
104 super(GpuRasterizationTestsStorySet, self).__init__()
106 self.AddStory(GpuRasterizationBlueBoxPage(self, expectations))
107 self.AddStory(GpuRasterizationConcavePathsPage(self, expectations))