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 # pylint: disable=W0401,W0614 5 from telemetry.page.actions.all_page_actions import * 6 from telemetry.page import page as page_module 7 from telemetry.page import page_set as page_set_module 8 9 10 class PixelTestsPage(page_module.Page): 11 12 def __init__(self, url, name, test_rect, revision, page_set): 13 super(PixelTestsPage, self).__init__(url=url, page_set=page_set, name=name) 14 self.user_agent_type = 'desktop' 15 self.test_rect = test_rect 16 self.revision = revision 17 18 def RunNavigateSteps(self, action_runner): 19 action_runner.NavigateToPage(self) 20 action_runner.WaitForJavaScriptCondition( 21 'domAutomationController._finished', timeout=30) 22 23 24 class PixelTestsPageSet(page_set_module.PageSet): 25 26 """ Some basic test cases for GPU. """ 27 28 def __init__(self): 29 super(PixelTestsPageSet, self).__init__( 30 user_agent_type='desktop') 31 self.AddPage(PixelTestsPage( 32 url='file://../../data/gpu/pixel_canvas2d.html', 33 name='Pixel.Canvas2DRedBox', 34 test_rect=[0, 0, 300, 300], 35 revision=4, 36 page_set=self)) 37 38 self.AddPage(PixelTestsPage( 39 url='file://../../data/gpu/pixel_css3d.html', 40 name='Pixel.CSS3DBlueBox', 41 test_rect=[0, 0, 300, 300], 42 revision=9, 43 page_set=self)) 44 45 self.AddPage(PixelTestsPage( 46 url='file://../../data/gpu/pixel_webgl.html', 47 name='Pixel.WebGLGreenTriangle', 48 test_rect=[0, 0, 300, 300], 49 revision=8, 50 page_set=self)) 51