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 GpuProcessTestsPage(page_module
.Page
):
10 def __init__(self
, url
, name
, page_set
):
11 super(GpuProcessTestsPage
, self
).__init
__(url
=url
, page_set
=page_set
,
13 self
.user_agent_type
= 'desktop'
15 def RunNavigateSteps(self
, action_runner
):
16 action_runner
.NavigateToPage(self
)
18 class FunctionalVideoPage(GpuProcessTestsPage
):
20 def __init__(self
, page_set
):
21 super(FunctionalVideoPage
, self
).__init
__(
22 url
='file://../../data/gpu/functional_video.html',
23 name
='GpuProcess.video',
26 def RunNavigateSteps(self
, action_runner
):
27 action_runner
.NavigateToPage(self
)
28 action_runner
.WaitForJavaScriptCondition(
29 'domAutomationController._finished', timeout_in_seconds
=30)
32 class GpuProcessTestsPageSet(page_set_module
.PageSet
):
34 """ Tests that accelerated content triggers the creation of a GPU process """
37 super(GpuProcessTestsPageSet
, self
).__init
__(
38 serving_dirs
=set(['../../../../content/test/data']),
39 user_agent_type
='desktop')
41 urls_and_names_list
= [
42 ('file://../../data/gpu/functional_canvas_demo.html',
43 'GpuProcess.canvas2d'),
44 ('file://../../data/gpu/functional_3d_css.html',
46 ('file://../../data/gpu/functional_webgl.html',
50 for url
, name
in urls_and_names_list
:
51 self
.AddPage(GpuProcessTestsPage(url
, name
, self
))
53 self
.AddPage(FunctionalVideoPage(self
))