OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 # pylint: disable=W0401,W0614 | 4 # pylint: disable=W0401,W0614 |
5 from telemetry.page.actions.all_page_actions import * | 5 from telemetry.page.actions.all_page_actions import * |
6 from telemetry.page import page as page_module | 6 from telemetry.page import page as page_module |
7 from telemetry.page import page_set as page_set_module | 7 from telemetry.page import page_set as page_set_module |
8 | 8 |
9 | 9 |
10 class GpuProcessTestsPage(page_module.Page): | 10 class GpuProcessTestsPage(page_module.Page): |
11 | 11 |
12 def __init__(self, url, name, page_set): | 12 def __init__(self, url, name, page_set): |
13 super(GpuProcessTestsPage, self).__init__(url=url, page_set=page_set, | 13 super(GpuProcessTestsPage, self).__init__(url=url, page_set=page_set, |
14 name=name) | 14 name=name) |
15 self.user_agent_type = 'desktop' | 15 self.user_agent_type = 'desktop' |
16 | 16 |
17 def RunNavigateSteps(self, action_runner): | 17 def RunNavigateSteps(self, action_runner): |
18 action_runner.RunAction(NavigateAction()) | 18 action_runner.NavigateToPage(self) |
19 | 19 |
20 class FunctionalVideoPage(GpuProcessTestsPage): | 20 class FunctionalVideoPage(GpuProcessTestsPage): |
21 | 21 |
22 def __init__(self, page_set): | 22 def __init__(self, page_set): |
23 super(FunctionalVideoPage, self).__init__( | 23 super(FunctionalVideoPage, self).__init__( |
24 url='file://../../data/gpu/functional_video.html', | 24 url='file://../../data/gpu/functional_video.html', |
25 name='GpuProcess.video', | 25 name='GpuProcess.video', |
26 page_set=page_set) | 26 page_set=page_set) |
27 | 27 |
28 def RunNavigateSteps(self, action_runner): | 28 def RunNavigateSteps(self, action_runner): |
29 action_runner.RunAction(NavigateAction()) | 29 action_runner.NavigateToPage(self) |
30 action_runner.RunAction(WaitAction( | 30 action_runner.RunAction(WaitAction( |
31 { | 31 { |
32 'javascript': 'domAutomationController._finished', | 32 'javascript': 'domAutomationController._finished', |
33 'timeout': 30 | 33 'timeout': 30 |
34 })) | 34 })) |
35 | 35 |
36 | 36 |
37 class GpuProcessTestsPageSet(page_set_module.PageSet): | 37 class GpuProcessTestsPageSet(page_set_module.PageSet): |
38 | 38 |
39 """ Tests that accelerated content triggers the creation of a GPU process """ | 39 """ Tests that accelerated content triggers the creation of a GPU process """ |
40 | 40 |
41 def __init__(self): | 41 def __init__(self): |
42 super(GpuProcessTestsPageSet, self).__init__( | 42 super(GpuProcessTestsPageSet, self).__init__( |
43 serving_dirs=set(['../../../../content/test/data']), | 43 serving_dirs=set(['../../../../content/test/data']), |
44 user_agent_type='desktop') | 44 user_agent_type='desktop') |
45 | 45 |
46 urls_and_names_list = [ | 46 urls_and_names_list = [ |
47 ('file://../../data/gpu/functional_canvas_demo.html', | 47 ('file://../../data/gpu/functional_canvas_demo.html', |
48 'GpuProcess.canvas2d'), | 48 'GpuProcess.canvas2d'), |
49 ('file://../../data/gpu/functional_3d_css.html', | 49 ('file://../../data/gpu/functional_3d_css.html', |
50 'GpuProcess.css3d'), | 50 'GpuProcess.css3d'), |
51 ('file://../../data/gpu/functional_webgl.html', | 51 ('file://../../data/gpu/functional_webgl.html', |
52 'GpuProcess.webgl') | 52 'GpuProcess.webgl') |
53 ] | 53 ] |
54 | 54 |
55 for url, name in urls_and_names_list: | 55 for url, name in urls_and_names_list: |
56 self.AddPage(GpuProcessTestsPage(url, name, self)) | 56 self.AddPage(GpuProcessTestsPage(url, name, self)) |
57 | 57 |
58 self.AddPage(FunctionalVideoPage(self)) | 58 self.AddPage(FunctionalVideoPage(self)) |
OLD | NEW |