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 PixelTestsPage(gpu_test_base
.PageBase
):
10 def __init__(self
, url
, name
, test_rect
, revision
, story_set
, expectations
):
11 super(PixelTestsPage
, self
).__init
__(url
=url
, page_set
=story_set
, name
=name
,
12 expectations
=expectations
)
13 self
.test_rect
= test_rect
14 self
.revision
= revision
16 def RunNavigateStepsInner(self
, action_runner
):
17 action_runner
.WaitForJavaScriptCondition(
18 'domAutomationController._finished', timeout_in_seconds
=30)
21 class PixelTestsStorySet(story_set_module
.StorySet
):
23 """ Some basic test cases for GPU. """
25 def __init__(self
, expectations
, base_name
='Pixel'):
26 super(PixelTestsStorySet
, self
).__init
__()
27 self
.AddStory(PixelTestsPage(
28 url
='file://../../data/gpu/pixel_canvas2d.html',
29 name
=base_name
+ '.Canvas2DRedBox',
30 test_rect
=[0, 0, 300, 300],
33 expectations
=expectations
))
35 self
.AddStory(PixelTestsPage(
36 url
='file://../../data/gpu/pixel_css3d.html',
37 name
=base_name
+ '.CSS3DBlueBox',
38 test_rect
=[0, 0, 300, 300],
41 expectations
=expectations
))
43 self
.AddStory(PixelTestsPage(
44 url
='file://../../data/gpu/pixel_webgl.html',
45 name
=base_name
+ '.WebGLGreenTriangle',
46 test_rect
=[0, 0, 300, 300],
49 expectations
=expectations
))