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