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],
24 'color': [255, 255, 255],
29 'color': [255, 255, 255],
31 'location': [215, 215],
34 'color': [255, 255, 255],
38 {'comment': 'background-t',
43 {'comment': 'background-r',
46 'location': [170, 30],
48 {'comment': 'background-b',
51 'location': [170, 170],
53 {'comment': 'background-l',
56 'location': [30, 170],
66 'location': [140, 70],
71 'location': [140, 140],
76 'location': [70, 140],
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',
92 name
='GpuRasterization.ConcavePaths',
93 expectations
=expectations
)
96 {'comment': 'outside',
97 'color': [255, 255, 255],
101 {'comment': 'inside',
102 'color': [255, 215, 0],
104 'location': [20, 50],
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
))