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',
14 name
='GpuRasterization.BlueBox',
15 expectations
=expectations
)
19 'color': [255, 255, 255],
23 'color': [255, 255, 255],
25 'location': [215, 5]},
27 'color': [255, 255, 255],
29 'location': [215, 215]},
31 'color': [255, 255, 255],
33 'location': [5, 215]},
34 {'comment': 'background-t',
37 'location': [30, 30]},
38 {'comment': 'background-r',
41 'location': [170, 30]},
42 {'comment': 'background-b',
45 'location': [170, 170]},
46 {'comment': 'background-l',
49 'location': [30, 170]},
53 'location': [70, 70]},
57 'location': [140, 70]},
61 'location': [140, 140]},
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',
80 name
='GpuRasterization.ConcavePaths',
81 expectations
=expectations
)
84 {'comment': 'outside',
85 'color': [255, 255, 255],
89 'color': [255, 215, 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
))