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
.page
import page
as page_module
5 from telemetry
.page
import page_set
as page_set_module
8 class PixelTestsPage(page_module
.Page
):
10 def __init__(self
, url
, name
, test_rect
, revision
, page_set
):
11 super(PixelTestsPage
, self
).__init
__(url
=url
, page_set
=page_set
, name
=name
)
12 self
.user_agent_type
= 'desktop'
13 self
.test_rect
= test_rect
14 self
.revision
= revision
16 def RunNavigateSteps(self
, action_runner
):
17 action_runner
.NavigateToPage(self
)
18 action_runner
.WaitForJavaScriptCondition(
19 'domAutomationController._finished', timeout_in_seconds
=30)
22 class PixelTestsPageSet(page_set_module
.PageSet
):
24 """ Some basic test cases for GPU. """
27 super(PixelTestsPageSet
, self
).__init
__(
28 user_agent_type
='desktop')
29 self
.AddPage(PixelTestsPage(
30 url
='file://../../data/gpu/pixel_canvas2d.html',
31 name
='Pixel.Canvas2DRedBox',
32 test_rect
=[0, 0, 300, 300],
36 self
.AddPage(PixelTestsPage(
37 url
='file://../../data/gpu/pixel_css3d.html',
38 name
='Pixel.CSS3DBlueBox',
39 test_rect
=[0, 0, 300, 300],
43 self
.AddPage(PixelTestsPage(
44 url
='file://../../data/gpu/pixel_webgl.html',
45 name
='Pixel.WebGLGreenTriangle',
46 test_rect
=[0, 0, 300, 300],